diff options
Diffstat (limited to 'functest')
-rw-r--r-- | functest/ci/download_images.sh | 10 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/refstack_client/refstack_client.py | 13 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/snaps/snaps_test_runner.py | 3 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/tempest/tempest.py | 17 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/vping/vping_base.py | 3 | ||||
-rw-r--r-- | functest/tests/unit/utils/test_functest_utils.py | 26 | ||||
-rw-r--r-- | functest/utils/functest_utils.py | 16 |
7 files changed, 29 insertions, 59 deletions
diff --git a/functest/ci/download_images.sh b/functest/ci/download_images.sh index cc0abc14..47c8f867 100644 --- a/functest/ci/download_images.sh +++ b/functest/ci/download_images.sh @@ -5,17 +5,17 @@ set -ex wget_opts="-N --tries=1 --connect-timeout=30" cat << EOF | wget ${wget_opts} -i - -P ${1:-/home/opnfv/functest/images} -http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img +http://artifacts.opnfv.org/functest/images/cirros-0.3.5-x86_64-disk.img https://cloud-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img http://repository.cloudifysource.org/cloudify/4.0.1/sp-release/cloudify-manager-premium-4.0.1.qcow2 http://marketplace.openbaton.org:8082/api/v1/images/52e2ccc0-1dce-4663-894d-28aab49323aa/img http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img -http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-lxc.tar.gz -http://download.cirros-cloud.net/daily/20161201/cirros-d161201-aarch64-disk.img -http://download.cirros-cloud.net/daily/20161201/cirros-d161201-aarch64-initramfs -http://download.cirros-cloud.net/daily/20161201/cirros-d161201-aarch64-kernel +http://artifacts.opnfv.org/functest/images/cirros-0.3.5-x86_64-lxc.tar.gz +http://artifacts.opnfv.org/functest/images/cirros-d161201-aarch64-disk.img +http://artifacts.opnfv.org/functest/images/cirros-d161201-aarch64-initramfs +http://artifacts.opnfv.org/functest/images/cirros-d161201-aarch64-kernel https://cloud-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-arm64-uefi1.img http://cloud.centos.org/altarch/7/images/aarch64/CentOS-7-aarch64-GenericCloud.qcow2.xz EOF diff --git a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py index d4a1f072..17e02466 100644 --- a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py +++ b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py @@ -224,11 +224,14 @@ class RefstackClient(testcase.TestCase): if not self.tempestconf: self.generate_conf() - os_utils.init_tempest_cleanup( - self.tempestconf.DEPLOYMENT_DIR, 'tempest.conf', - os.path.join(conf_utils.REFSTACK_RESULTS_DIR, - "tempest-cleanup-init.log") - ) + try: + os_utils.init_tempest_cleanup( + self.tempestconf.DEPLOYMENT_DIR, 'tempest.conf', + os.path.join(conf_utils.REFSTACK_RESULTS_DIR, + "tempest-cleanup-init.log")) + except Exception as err: + LOGGER.error(str(err)) + return testcase.TestCase.EX_RUN_ERROR return super(RefstackClient, self).create_snapshot() diff --git a/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py b/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py index 19c6a87f..bfdcd862 100644 --- a/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py +++ b/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py @@ -10,7 +10,6 @@ import logging from functest.core import unit from functest.opnfv_tests.openstack.snaps import snaps_utils -from functest.utils import functest_utils from functest.utils.constants import CONST from snaps.openstack import create_flavor @@ -44,7 +43,7 @@ class SnapsTestRunner(unit.Suite): self.use_fip = CONST.__getattribute__('snaps_use_floating_ips') self.use_keystone = CONST.__getattribute__('snaps_use_keystone') - scenario = functest_utils.get_scenario() + scenario = CONST.__getattribute__('DEPLOY_SCENARIO') self.flavor_metadata = None if 'ovs' in scenario or 'fdio' in scenario: diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index c7ad4df2..b8a4e9ad 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -267,11 +267,14 @@ class TempestCommon(testcase.TestCase): # Make sure that the verifier is configured conf_utils.configure_verifier(self.DEPLOYMENT_DIR) - os_utils.init_tempest_cleanup( - self.DEPLOYMENT_DIR, 'tempest.conf', - os.path.join(conf_utils.TEMPEST_RESULTS_DIR, - "tempest-cleanup-init.log") - ) + try: + os_utils.init_tempest_cleanup( + self.DEPLOYMENT_DIR, 'tempest.conf', + os.path.join(conf_utils.TEMPEST_RESULTS_DIR, + "tempest-cleanup-init.log")) + except Exception as err: + logger.error(str(err)) + return testcase.TestCase.EX_RUN_ERROR return super(TempestCommon, self).create_snapshot() @@ -442,7 +445,7 @@ class TempestResourcesManager(object): if (CONST.__getattribute__('tempest_use_custom_flavors') or use_custom_flavors): logger.info("Creating flavor for Tempest suite") - scenario = ft_utils.get_scenario() + scenario = CONST.__getattribute__('DEPLOY_SCENARIO') flavor_metadata = None if 'ovs' in scenario or 'fdio' in scenario: flavor_metadata = create_flavor.MEM_PAGE_SIZE_LARGE @@ -461,7 +464,7 @@ class TempestResourcesManager(object): if use_custom_flavors: logger.info("Creating 2nd flavor for Tempest suite") - scenario = ft_utils.get_scenario() + scenario = CONST.__getattribute__('DEPLOY_SCENARIO') flavor_metadata_alt = None if 'ovs' in scenario or 'fdio' in scenario: flavor_metadata_alt = create_flavor.MEM_PAGE_SIZE_LARGE diff --git a/functest/opnfv_tests/openstack/vping/vping_base.py b/functest/opnfv_tests/openstack/vping/vping_base.py index 6e908065..c93d2f26 100644 --- a/functest/opnfv_tests/openstack/vping/vping_base.py +++ b/functest/opnfv_tests/openstack/vping/vping_base.py @@ -13,7 +13,6 @@ import time import uuid from functest.core import testcase -from functest.utils import functest_utils from functest.utils.constants import CONST from snaps.openstack import create_flavor @@ -139,7 +138,7 @@ class VPingBase(testcase.TestCase): self.logger.info( "Creating flavor with name: '%s'" % self.flavor_name) - scenario = functest_utils.get_scenario() + scenario = CONST.__getattribute__('DEPLOY_SCENARIO') flavor_metadata = None if 'ovs' in scenario or 'fdio' in scenario: flavor_metadata = create_flavor.MEM_PAGE_SIZE_LARGE diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py index cd3693c7..d67f4135 100644 --- a/functest/tests/unit/utils/test_functest_utils.py +++ b/functest/tests/unit/utils/test_functest_utils.py @@ -114,25 +114,6 @@ class FunctestUtilsTesting(unittest.TestCase): self.assertEqual(functest_utils.get_installer_type(), self.installer) - @mock.patch('functest.utils.functest_utils.logger.info') - def test_get_scenario_failed(self, mock_logger_info): - with mock.patch.dict(os.environ, - {}, - clear=True): - self.assertEqual(functest_utils.get_scenario(), - "os-nosdn-nofeature-noha") - mock_logger_info.assert_called_once_with("Impossible to retrieve " - "the scenario.Use " - "default " - "os-nosdn-nofeature-noha") - - def test_get_scenario_default(self): - with mock.patch.dict(os.environ, - {'DEPLOY_SCENARIO': 'test_scenario'}, - clear=True): - self.assertEqual(functest_utils.get_scenario(), - self.scenario) - def test_get_version_daily_job(self): CONST.__setattr__('BUILD_TAG', self.build_tag) self.assertEqual(functest_utils.get_version(), self.version) @@ -154,10 +135,9 @@ class FunctestUtilsTesting(unittest.TestCase): CONST.__setattr__('results_test_db_url', self.db_url) CONST.__setattr__('BUILD_TAG', self.build_tag) CONST.__setattr__('NODE_NAME', self.node_name) - with mock.patch('functest.utils.functest_utils.get_scenario', - return_value=self.scenario), \ - mock.patch('functest.utils.functest_utils.get_version', - return_value=self.version): + CONST.__setattr__('DEPLOY_SCENARIO', self.scenario) + with mock.patch('functest.utils.functest_utils.get_version', + return_value=self.version): functest_utils.logger_test_results(self.project, self.case_name, self.status, self.details) mock_logger_info.assert_called_once_with( diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index 5bf3adb6..a7c61ce1 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -81,20 +81,6 @@ def get_installer_type(): return installer -def get_scenario(): - """ - Get scenario - """ - try: - scenario = os.environ['DEPLOY_SCENARIO'] - except KeyError: - logger.info("Impossible to retrieve the scenario." - "Use default os-nosdn-nofeature-noha") - scenario = "os-nosdn-nofeature-noha" - - return scenario - - def get_version(): """ Get version @@ -122,7 +108,7 @@ def logger_test_results(project, case_name, status, details): Format test case results for the logger """ pod_name = CONST.__getattribute__('NODE_NAME') - scenario = get_scenario() + scenario = CONST.__getattribute__('DEPLOY_SCENARIO') version = get_version() build_tag = CONST.__getattribute__('BUILD_TAG') db_url = CONST.__getattribute__("results_test_db_url") |