diff options
Diffstat (limited to 'functest/tests/unit/vnf')
-rw-r--r-- | functest/tests/unit/vnf/__init__.py | 0 | ||||
-rw-r--r-- | functest/tests/unit/vnf/epc/__init__.py | 0 | ||||
-rw-r--r-- | functest/tests/unit/vnf/epc/test_juju_epc.py | 79 | ||||
-rw-r--r-- | functest/tests/unit/vnf/ims/__init__.py | 0 | ||||
-rw-r--r-- | functest/tests/unit/vnf/ims/test_cloudify_ims.py | 67 | ||||
-rw-r--r-- | functest/tests/unit/vnf/ims/test_ims_base.py | 42 | ||||
-rw-r--r-- | functest/tests/unit/vnf/ims/test_orchestra_clearwaterims.py | 120 | ||||
-rw-r--r-- | functest/tests/unit/vnf/ims/test_orchestra_openims.py | 122 | ||||
-rw-r--r-- | functest/tests/unit/vnf/router/__init__.py | 0 | ||||
-rw-r--r-- | functest/tests/unit/vnf/router/test_cloudify_vrouter.py | 74 | ||||
-rw-r--r-- | functest/tests/unit/vnf/router/test_vrouter_base.py | 30 |
11 files changed, 0 insertions, 534 deletions
diff --git a/functest/tests/unit/vnf/__init__.py b/functest/tests/unit/vnf/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/functest/tests/unit/vnf/__init__.py +++ /dev/null diff --git a/functest/tests/unit/vnf/epc/__init__.py b/functest/tests/unit/vnf/epc/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/functest/tests/unit/vnf/epc/__init__.py +++ /dev/null diff --git a/functest/tests/unit/vnf/epc/test_juju_epc.py b/functest/tests/unit/vnf/epc/test_juju_epc.py deleted file mode 100644 index 6b413706..00000000 --- a/functest/tests/unit/vnf/epc/test_juju_epc.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2017 Rebaca and others. -# -# 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 - -""" Unit test testcase for JuJu EPC Implementation""" - -import logging -import unittest - -import mock - -from functest.opnfv_tests.vnf.epc import juju_epc - - -class JujuEpcTesting(unittest.TestCase): - # pylint: disable=missing-docstring - """Unittest for ABoT EPC with juju orchestrator""" - - def setUp(self): - - self.tenant = 'juju_epc' - self.creds = {'username': 'user', - 'password': 'pwd'} - self.orchestrator = {'name': 'juju', - 'version': '2.0', - 'object': 'foo', - 'requirements': {'flavor': {'name': 'm1.small', - 'ram_min': 2048}, - 'pip': 'python3-pip', - 'repo_link': 'ppa:juju/stable', - 'dep_package': 'software-' - 'properties' - '-common', - 'pip3_packages': 'juju-wait'}} - self.vnf = {'name': 'juju_epc', - 'descriptor': {'version': '1', - 'file_name': '/src/epc-test/' - 'abot_charm/' - 'functest-abot-' - 'epc-bundle/bundle.yaml', - 'name': 'abot-oai-epc', - 'requirements': {'flavor': - {'name': 'm1.medium', - 'ram_min': 4096}}}} - with mock.patch('functest.opnfv_tests.vnf.epc.juju_epc.os.makedirs'), \ - mock.patch('functest.opnfv_tests.vnf.epc.juju_epc.get_config', - return_value={'tenant_images': 'foo', - 'orchestrator': self.orchestrator, - 'vnf': self.vnf, 'vnf_test_suite': '', - 'version': 'whatever'}): - self.epc_vnf = juju_epc.JujuEpc() - - self.images = {'image1': 'url1', - 'image2': 'url2'} - self.details = {'orchestrator': {'status': 'PASS', 'duration': 120}, - 'vnf': {}, - 'test_vnf': {}} - - @unittest.skip("It must be fixed. Please see JIRA FUNCTEST-915") - @mock.patch('snaps.openstack.create_image.OpenStackImage.create') - @mock.patch('os.system') - def test_prepare_default(self, *args): - """ Unittest for Prepare testcase """ - self.epc_vnf.orchestrator = self.orchestrator - self.assertIsNone(self.epc_vnf.prepare()) - args[4].assert_called_once_with('test', - 'debayan', - 'OAI EPC deployed ' - 'with Juju') - - -if __name__ == "__main__": - logging.disable(logging.CRITICAL) - unittest.main(verbosity=2) diff --git a/functest/tests/unit/vnf/ims/__init__.py b/functest/tests/unit/vnf/ims/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/functest/tests/unit/vnf/ims/__init__.py +++ /dev/null diff --git a/functest/tests/unit/vnf/ims/test_cloudify_ims.py b/functest/tests/unit/vnf/ims/test_cloudify_ims.py deleted file mode 100644 index 79069a5d..00000000 --- a/functest/tests/unit/vnf/ims/test_cloudify_ims.py +++ /dev/null @@ -1,67 +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 - -# pylint: disable=missing-docstring - -import logging -import unittest - -import mock - -from functest.core import vnf -from functest.opnfv_tests.vnf.ims import cloudify_ims - - -class CloudifyImsTesting(unittest.TestCase): - - def setUp(self): - - self.tenant = 'cloudify_ims' - self.creds = {'username': 'user', - 'password': 'pwd'} - self.orchestrator = {'name': 'cloudify', - 'version': '4.0', - 'object': 'foo', - 'requirements': {'flavor': {'name': 'm1.medium', - 'ram_min': 4096}, - 'os_image': 'manager_4.0'}} - - self.vnf = {'name': 'clearwater', - 'descriptor': {'version': '108', - 'file_name': 'openstack-blueprint.yaml', - 'name': 'clearwater-opnfv', - 'url': 'https://foo', - 'requirements': {'flavor': - {'name': 'm1.medium', - 'ram_min': 2048}}}} - - with mock.patch('functest.opnfv_tests.vnf.ims.cloudify_ims.' - 'os.makedirs'), \ - mock.patch('functest.opnfv_tests.vnf.ims.cloudify_ims.' - 'get_config', return_value={ - 'tenant_images': 'foo', - 'orchestrator': self.orchestrator, - 'vnf': self.vnf, - 'vnf_test_suite': '', - 'version': 'whatever'}): - - self.ims_vnf = cloudify_ims.CloudifyIms() - - self.images = {'image1': 'url1', - 'image2': 'url2'} - self.details = {'orchestrator': {'status': 'PASS', 'duration': 120}, - 'vnf': {}, - 'test_vnf': {}} - - def test_prepare_missing_param(self): - with self.assertRaises(vnf.VnfPreparationException): - self.ims_vnf.prepare() - - -if __name__ == "__main__": - logging.disable(logging.CRITICAL) - unittest.main(verbosity=2) diff --git a/functest/tests/unit/vnf/ims/test_ims_base.py b/functest/tests/unit/vnf/ims/test_ims_base.py deleted file mode 100644 index 97654748..00000000 --- a/functest/tests/unit/vnf/ims/test_ims_base.py +++ /dev/null @@ -1,42 +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 - -# pylint: disable=missing-docstring - -import logging -import unittest - -import mock - -from functest.opnfv_tests.vnf.ims import clearwater_ims_base as ims_base - - -class ClearwaterOnBoardingBaseTesting(unittest.TestCase): - - def setUp(self): - with mock.patch('functest.opnfv_tests.vnf.ims.cloudify_ims.' - 'os.makedirs'): - self.ims_vnf = ims_base.ClearwaterOnBoardingBase() - - self.mock_post = mock.Mock() - attrs = {'status_code': 201, - 'cookies': ""} - self.mock_post.configure_mock(**attrs) - - self.mock_post_200 = mock.Mock() - attrs = {'status_code': 200, - 'cookies': ""} - self.mock_post_200.configure_mock(**attrs) - - self.mock_post_500 = mock.Mock() - attrs = {'status_code': 500, - 'cookies': ""} - self.mock_post_200.configure_mock(**attrs) - -if __name__ == "__main__": - logging.disable(logging.CRITICAL) - unittest.main(verbosity=2) diff --git a/functest/tests/unit/vnf/ims/test_orchestra_clearwaterims.py b/functest/tests/unit/vnf/ims/test_orchestra_clearwaterims.py deleted file mode 100644 index 2e83f30a..00000000 --- a/functest/tests/unit/vnf/ims/test_orchestra_clearwaterims.py +++ /dev/null @@ -1,120 +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 - -"""Test module for orchestra_clearwaterims""" - -import logging -import unittest - -import mock - -from functest.core import vnf -from functest.opnfv_tests.vnf.ims import orchestra_clearwaterims - - -class OrchestraClearwaterImsTesting(unittest.TestCase): - """Test class for orchestra_clearwaterims""" - def setUp(self): - - self.tenant = 'orchestra_clearwaterims' - self.creds = {'username': 'mocked_username', - 'password': 'mocked_password'} - self.tenant_images = { - 'image1': 'mocked_image_url_1', - 'image2': 'mocked_image_url_2' - } - self.mano = { - 'name': 'openbaton', - 'version': '3.2.0', - 'object': 'foo', - 'requirements': { - 'flavor': { - 'name': 'mocked_flavor', - 'ram_min': 4096, - 'disk': 5, - 'vcpus': 2 - }, - 'os_image': 'mocked_image' - }, - 'bootstrap': { - 'url': 'mocked_bootstrap_url', - 'config': { - 'url': 'mocked_config_url'} - }, - 'gvnfm': { - 'userdata': { - 'url': 'mocked_userdata_url' - } - }, - 'credentials': { - 'username': 'mocked_username', - 'password': 'mocked_password' - } - } - self.vnf = { - 'name': 'openims', - 'descriptor': { - 'url': 'mocked_descriptor_url' - }, - 'requirements': { - 'flavor': { - 'name': 'mocked_flavor', - 'ram_min': 2048, - 'disk': 5, - 'vcpus': 2} - } - } - self.clearwaterims = { - 'scscf': { - 'ports': [3870, 6060] - }, - 'pcscf': { - 'ports': [4060] - }, - 'icscf': { - 'ports': [3869, 5060] - }, - 'fhoss': { - 'ports': [3868] - }, - 'bind9': { - 'ports': [] - } - } - with mock.patch('functest.opnfv_tests.vnf.ims.orchestra_clearwaterims.' - 'os.makedirs'),\ - mock.patch('functest.opnfv_tests.vnf.ims.orchestra_clearwaterims.' - 'get_config', return_value={ - 'orchestrator': self.mano, - 'name': self.mano['name'], - 'version': self.mano['version'], - 'requirements': self.mano['requirements'], - 'credentials': self.mano['credentials'], - 'bootstrap': self.mano['bootstrap'], - 'gvnfm': self.mano['gvnfm'], - 'os_image': self.mano['requirements']['os_image'], - 'flavor': self.mano['requirements']['flavor'], - 'url': self.mano['bootstrap']['url'], - 'config': self.mano['bootstrap']['config'], - 'tenant_images': self.tenant_images, - 'vnf': self.vnf, - 'orchestra_clearwaterims': self.clearwaterims}): - self.ims_vnf = orchestra_clearwaterims.ClearwaterImsVnf() - - self.details = {'orchestrator': {'status': 'PASS', 'duration': 120}, - 'vnf': {}, - 'test_vnf': {}} - - def test_prepare_missing_param(self): - """Testing prepare function with missing param""" - with self.assertRaises(vnf.VnfPreparationException): - self.ims_vnf.prepare() - - -if __name__ == "__main__": - logging.disable(logging.CRITICAL) - unittest.main(verbosity=2) diff --git a/functest/tests/unit/vnf/ims/test_orchestra_openims.py b/functest/tests/unit/vnf/ims/test_orchestra_openims.py deleted file mode 100644 index 47a8d033..00000000 --- a/functest/tests/unit/vnf/ims/test_orchestra_openims.py +++ /dev/null @@ -1,122 +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 - -"""Test module for orchestra_openims""" - -import logging -import unittest - -import mock - -from functest.core import vnf -from functest.opnfv_tests.vnf.ims import orchestra_openims - - -class OrchestraOpenImsTesting(unittest.TestCase): - """Test class for orchestra_openims""" - def setUp(self): - - self.tenant = 'orchestra_openims' - self.creds = {'username': 'mocked_username', - 'password': 'mocked_password'} - self.tenant_images = { - 'image1': 'mocked_image_url_1', - 'image2': 'mocked_image_url_2' - } - self.mano = { - 'name': 'openbaton', - 'version': '3.2.0', - 'object': 'foo', - 'requirements': { - 'flavor': { - 'name': 'mocked_flavor', - 'ram_min': 4096, - 'disk': 5, - 'vcpus': 2 - }, - 'os_image': 'mocked_image' - }, - 'bootstrap': { - 'url': 'mocked_bootstrap_url', - 'config': { - 'url': 'mocked_config_url'} - }, - 'gvnfm': { - 'userdata': { - 'url': 'mocked_userdata_url' - } - }, - 'credentials': { - 'username': 'mocked_username', - 'password': 'mocked_password' - } - } - self.vnf = { - 'name': 'openims', - 'descriptor': { - 'url': 'mocked_descriptor_url' - }, - 'requirements': { - 'flavor': { - 'name': 'mocked_flavor', - 'ram_min': 2048, - 'disk': 5, - 'vcpus': 2} - } - } - self.openims = { - 'scscf': { - 'ports': [3870, 6060] - }, - 'pcscf': { - 'ports': [4060] - }, - 'icscf': { - 'ports': [3869, 5060] - }, - 'fhoss': { - 'ports': [3868] - }, - 'bind9': { - 'ports': [] - } - } - with mock.patch('functest.opnfv_tests.vnf.ims.orchestra_openims.' - 'os.makedirs'),\ - mock.patch('functest.opnfv_tests.vnf.ims.orchestra_openims.' - 'get_config', return_value={ - 'orchestrator': self.mano, - 'name': self.mano['name'], - 'version': self.mano['version'], - 'requirements': self.mano['requirements'], - 'credentials': self.mano['credentials'], - 'bootstrap': self.mano['bootstrap'], - 'gvnfm': self.mano['gvnfm'], - 'os_image': - self.mano['requirements']['os_image'], - 'flavor': - self.mano['requirements']['flavor'], - 'url': self.mano['bootstrap']['url'], - 'config': self.mano['bootstrap']['config'], - 'tenant_images': self.tenant_images, - 'vnf': self.vnf, - 'orchestra_openims': self.openims}): - self.ims_vnf = orchestra_openims.OpenImsVnf() - - self.details = {'orchestrator': {'status': 'PASS', 'duration': 120}, - 'vnf': {}, - 'test_vnf': {}} - - def test_prepare_missing_param(self): - """Testing prepare function with missing param""" - with self.assertRaises(vnf.VnfPreparationException): - self.ims_vnf.prepare() - - -if __name__ == "__main__": - logging.disable(logging.CRITICAL) - unittest.main(verbosity=2) diff --git a/functest/tests/unit/vnf/router/__init__.py b/functest/tests/unit/vnf/router/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/functest/tests/unit/vnf/router/__init__.py +++ /dev/null diff --git a/functest/tests/unit/vnf/router/test_cloudify_vrouter.py b/functest/tests/unit/vnf/router/test_cloudify_vrouter.py deleted file mode 100644 index db03d716..00000000 --- a/functest/tests/unit/vnf/router/test_cloudify_vrouter.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2017 Okinawa Open Laboratory and others. -# -# 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 - -# pylint: disable=missing-docstring - -import logging -import unittest - -import mock - -from functest.core import vnf -from functest.opnfv_tests.vnf.router import cloudify_vrouter - - -class CloudifyVrouterTesting(unittest.TestCase): - - def setUp(self): - - self.tenant = 'cloudify_vrouter' - self.creds = {'username': 'user', - 'password': 'pwd'} - self.orchestrator = {'name': 'cloudify', - 'version': '4.0', - 'object': 'foo', - 'requirements': {'flavor': {'name': 'm1.medium', - 'ram_min': 4096}, - 'os_image': 'manager_4.0'}} - - self.vnf = {'name': 'vrouter', - 'descriptor': {'version': '100', - 'file_name': 'function-test-' + - 'openstack-blueprint.yaml', - 'name': 'vrouter-opnfv', - 'url': 'https://foo', - 'requirements': {'flavor': - {'name': 'm1.medium', - 'ram_min': 2048}}}} - - # pylint: disable=bad-continuation - with mock.patch( - 'functest.opnfv_tests.vnf.router.cloudify_vrouter.Utilvnf'), \ - mock.patch('functest.opnfv_tests.vnf.router.' - 'cloudify_vrouter.vrouter_base.Utilvnf'), \ - mock.patch('os.makedirs'), \ - mock.patch( - 'functest.utils.functest_utils.get_parameter_from_yaml', - return_value={ - 'tenant_images': 'foo', - 'orchestrator': self.orchestrator, - 'vnf': self.vnf, 'vnf_test_suite': '', - 'version': 'whatever'}): - - self.router_vnf = cloudify_vrouter.CloudifyVrouter() - - self.images = {'image1': 'url1', - 'image2': 'url2'} - self.details = {'orchestrator': {'status': 'PASS', 'duration': 120}, - 'vnf': {}, - 'test_vnf': {}} - - def test_prepare_missing_param(self): - with self.assertRaises(vnf.VnfPreparationException): - self.router_vnf.prepare() - - -if __name__ == "__main__": - logging.disable(logging.CRITICAL) - unittest.main(verbosity=2) diff --git a/functest/tests/unit/vnf/router/test_vrouter_base.py b/functest/tests/unit/vnf/router/test_vrouter_base.py deleted file mode 100644 index 1851b201..00000000 --- a/functest/tests/unit/vnf/router/test_vrouter_base.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2017 Okinawa Open Laboratory and others. -# -# 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 - -# pylint: disable=missing-docstring - -import logging -import unittest - -import mock - -from functest.opnfv_tests.vnf.router import vrouter_base - - -class VrouterOnBoardingBaseTesting(unittest.TestCase): - - def setUp(self): - with mock.patch('functest.opnfv_tests.vnf.router.cloudify_vrouter.' - 'os.makedirs'): - self.vrouter_vnf = vrouter_base.VrouterOnBoardingBase() - - -if __name__ == "__main__": - logging.disable(logging.CRITICAL) - unittest.main(verbosity=2) |