diff options
author | boucherv <valentin.boucher@orange.com> | 2017-06-21 16:37:56 +0200 |
---|---|---|
committer | boucherv <valentin.boucher@orange.com> | 2017-07-03 17:50:36 +0200 |
commit | 642987dcca77cdf1ae551d824ab44272f3406f70 (patch) | |
tree | 20a0b1d146316c0bd858eee1bc1d45cdf35e3788 /functest/tests/unit/vnf/ims/test_clearwater.py | |
parent | 3ccd401b18775cf152e883c44cc4937287f4e62d (diff) |
[cloudify_ims] Support Cloudify 4.0
- Delete all shell commands to use cloudify python lib
- Cloudify Manager installation with a packaged image
- SNAPS integration
- Adapt test_vnf unit tests
- Initiate test cloudify_ims unit tests (to be completed)
JIRA: FUNCTEST-838
Change-Id: Ia4b499d4155e6af5d37d6d5cf4310a5a9693c7ce
Signed-off-by: boucherv <valentin.boucher@orange.com>
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'functest/tests/unit/vnf/ims/test_clearwater.py')
-rw-r--r-- | functest/tests/unit/vnf/ims/test_clearwater.py | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/functest/tests/unit/vnf/ims/test_clearwater.py b/functest/tests/unit/vnf/ims/test_clearwater.py deleted file mode 100644 index bc31c33e..00000000 --- a/functest/tests/unit/vnf/ims/test_clearwater.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python - -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 - -import logging -import unittest - -import mock - -from functest.opnfv_tests.vnf.ims import clearwater -from functest.opnfv_tests.vnf.ims import orchestrator_cloudify - - -class ClearwaterTesting(unittest.TestCase): - - def setUp(self): - self.clearwater = clearwater.Clearwater() - self.orchestrator = orchestrator_cloudify.Orchestrator('test_dir') - self.clearwater.orchestrator = self.orchestrator - self.clearwater.dep_name = 'test_dep_name' - self.bp = {'file_name': 'test_file', - 'destination_folder': 'test_folder', - 'url': 'test_url', - 'branch': 'test_branch'} - - def test_deploy_vnf_blueprint_download_failed(self): - with mock.patch.object(self.clearwater.orchestrator, - 'download_upload_and_deploy_blueprint', - return_value='error'): - self.assertEqual(self.clearwater.deploy_vnf(self.bp), - 'error') - - def test_deploy_vnf_blueprint_download_passed(self): - with mock.patch.object(self.clearwater.orchestrator, - 'download_upload_and_deploy_blueprint', - return_value=''): - self.clearwater.deploy_vnf(self.bp) - self.assertEqual(self.clearwater.deploy, True) - - def test_undeploy_vnf_deployment_passed(self): - with mock.patch.object(self.clearwater.orchestrator, - 'undeploy_deployment'): - self.clearwater.deploy = True - self.clearwater.undeploy_vnf() - self.assertEqual(self.clearwater.deploy, False) - - def test_undeploy_vnf_deployment_with_undeploy(self): - with mock.patch.object(self.clearwater.orchestrator, - 'undeploy_deployment') as m: - self.clearwater.deploy = False - self.clearwater.undeploy_vnf(), - self.assertEqual(self.clearwater.deploy, False) - self.assertFalse(m.called) - - self.clearwater.orchestrator = None - self.clearwater.deploy = True - self.clearwater.undeploy_vnf(), - self.assertEqual(self.clearwater.deploy, True) - - self.clearwater.deploy = False - self.clearwater.undeploy_vnf(), - self.assertEqual(self.clearwater.deploy, False) - - def test_set_methods(self): - self.clearwater.set_orchestrator(self.orchestrator) - self.assertTrue(self.clearwater.orchestrator, self.orchestrator) - self.clearwater.set_flavor_id('test_flavor_id') - self.assertTrue(self.clearwater.config['flavor_id'], 'test_flavor_id') - self.clearwater.set_image_id('test_image_id') - self.assertTrue(self.clearwater.config['image_id'], 'test_image_id') - self.clearwater.set_agent_user('test_user') - self.assertTrue(self.clearwater.config['agent_user'], 'test_user') - self.clearwater.set_external_network_name('test_network') - self.assertTrue(self.clearwater.config['external_network_name'], - 'test_network') - self.clearwater.set_public_domain('test_domain') - self.assertTrue(self.clearwater.config['public_domain'], - 'test_domain') - -if __name__ == "__main__": - logging.disable(logging.CRITICAL) - unittest.main(verbosity=2) |