diff options
Diffstat (limited to 'functest/opnfv_tests')
-rw-r--r-- | functest/opnfv_tests/features/netready.py | 22 | ||||
-rwxr-xr-x | functest/opnfv_tests/features/security_scan.py | 2 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/tempest/conf_utils.py | 45 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/tempest/tempest.py | 6 | ||||
-rw-r--r-- | functest/opnfv_tests/vnf/ims/cloudify_ims.py | 13 |
5 files changed, 51 insertions, 37 deletions
diff --git a/functest/opnfv_tests/features/netready.py b/functest/opnfv_tests/features/netready.py new file mode 100644 index 00000000..dec2a23c --- /dev/null +++ b/functest/opnfv_tests/features/netready.py @@ -0,0 +1,22 @@ +#!/usr/bin/python +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# + +# +import functest.core.feature_base as base + + +class GluonVping(base.FeatureBase): + + def __init__(self): + super(GluonVping, self).__init__(project='netready', + case='gluon_vping', + repo='dir_repo_netready') + dir_netready_functest = '{}/test/functest'.format(self.repo) + self.cmd = ('cd %s && python ./gluon-test-suite.py' % + dir_netready_functest) diff --git a/functest/opnfv_tests/features/security_scan.py b/functest/opnfv_tests/features/security_scan.py index bcae516b..2db44175 100755 --- a/functest/opnfv_tests/features/security_scan.py +++ b/functest/opnfv_tests/features/security_scan.py @@ -14,7 +14,7 @@ from functest.utils.constants import CONST class SecurityScan(base.FeatureBase): def __init__(self): - super(SecurityScan, self).__init__(project='security_scan', + super(SecurityScan, self).__init__(project='securityscanning', case='security_scan', repo='dir_repo_securityscan') self.cmd = ('bash {0} && ' diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py index 028b085c..893fff8c 100644 --- a/functest/opnfv_tests/openstack/tempest/conf_utils.py +++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py @@ -106,7 +106,19 @@ def get_verifier_deployment_dir(verifier_id, deployment_id): 'for-deployment-{}'.format(deployment_id)) -def configure_tempest(deployment_dir, IMAGE_ID=None, FLAVOR_ID=None): +def backup_tempest_config(conf_file): + """ + Copy config file to tempest results directory + """ + if not os.path.exists(TEMPEST_RESULTS_DIR): + os.makedirs(TEMPEST_RESULTS_DIR) + + shutil.copyfile(conf_file, + os.path.join(TEMPEST_RESULTS_DIR, 'tempest.conf')) + + +def configure_tempest(deployment_dir, IMAGE_ID=None, FLAVOR_ID=None, + MODE=None): """ Calls rally verify and updates the generated tempest.conf with given parameters @@ -114,6 +126,8 @@ def configure_tempest(deployment_dir, IMAGE_ID=None, FLAVOR_ID=None): conf_file = configure_verifier(deployment_dir) configure_tempest_update_params(conf_file, IMAGE_ID, FLAVOR_ID) + if MODE == 'feature_multisite': + configure_tempest_multisite_params(conf_file) def configure_tempest_update_params(tempest_conf_file, @@ -164,12 +178,7 @@ def configure_tempest_update_params(tempest_conf_file, with open(tempest_conf_file, 'wb') as config_file: config.write(config_file) - # Copy tempest.conf to /home/opnfv/functest/results/tempest/ - if not os.path.exists(TEMPEST_RESULTS_DIR): - os.makedirs(TEMPEST_RESULTS_DIR) - - shutil.copyfile(tempest_conf_file, - os.path.join(TEMPEST_RESULTS_DIR, 'tempest.conf')) + backup_tempest_config(tempest_conf_file) def configure_verifier(deployment_dir): @@ -196,25 +205,11 @@ def configure_verifier(deployment_dir): return tempest_conf_file -def configure_tempest_multisite(deployment_dir): +def configure_tempest_multisite_params(tempest_conf_file): """ - Add/update needed parameters into tempest.conf file generated by Rally + Add/update multisite parameters into tempest.conf file generated by Rally """ - logger.debug("configure the tempest") - configure_tempest(deployment_dir) - - logger.debug("Finding tempest.conf file...") - tempest_conf_old = os.path.join(deployment_dir, 'tempest.conf') - if not os.path.isfile(tempest_conf_old): - raise Exception("Tempest configuration file %s NOT found." - % tempest_conf_old) - - # Copy tempest.conf to /home/opnfv/functest/results/tempest/ - cur_path = os.path.split(os.path.realpath(__file__))[0] - tempest_conf_file = os.path.join(cur_path, 'tempest_multisite.conf') - shutil.copyfile(tempest_conf_old, tempest_conf_file) - - logger.debug("Updating selected tempest.conf parameters...") + logger.debug("Updating multisite tempest.conf parameters...") config = ConfigParser.RawConfigParser() config.read(tempest_conf_file) @@ -279,3 +274,5 @@ def configure_tempest_multisite(deployment_dir): config.set('kingbird', 'api_version', kingbird_api_version) with open(tempest_conf_file, 'wb') as config_file: config.write(config_file) + + backup_tempest_config(tempest_conf_file) diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index 13d9e4e6..f925336d 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -113,7 +113,7 @@ class TempestCommon(testcase_base.TestcaseBase): if self.MODE == 'smoke': testr_mode = "smoke" elif self.MODE == 'feature_multisite': - testr_mode = " | grep -i kingbird " + testr_mode = "'[Kk]ingbird'" elif self.MODE == 'full': testr_mode = "" else: @@ -272,7 +272,8 @@ class TempestCommon(testcase_base.TestcaseBase): self.create_tempest_resources() conf_utils.configure_tempest(self.DEPLOYMENT_DIR, self.IMAGE_ID, - self.FLAVOR_ID) + self.FLAVOR_ID, + self.MODE) self.generate_test_list(self.VERIFIER_REPO_DIR) self.apply_tempest_blacklist() self.run_verifier_tests() @@ -319,7 +320,6 @@ class TempestMultisite(TempestCommon): self.case_name = "multisite" self.MODE = "feature_multisite" self.OPTION = "--concurrency 1" - conf_utils.configure_tempest_multisite(self.DEPLOYMENT_DIR) class TempestCustom(TempestCommon): diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py index e2508c22..e354563e 100644 --- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py +++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py @@ -68,10 +68,10 @@ class ImsVnf(vnf_base.VnfOnBoardingBase): def deploy_orchestrator(self, **kwargs): self.logger.info("Additional pre-configuration steps") - self.neutron_client = os_utils.get_neutron_client(self.creds) - self.glance_client = os_utils.get_glance_client(self.creds) - self.keystone_client = os_utils.get_keystone_client(self.creds) - self.nova_client = os_utils.get_nova_client(self.creds) + self.neutron_client = os_utils.get_neutron_client(self.admin_creds) + self.glance_client = os_utils.get_glance_client(self.admin_creds) + self.keystone_client = os_utils.get_keystone_client(self.admin_creds) + self.nova_client = os_utils.get_nova_client(self.admin_creds) # needs some images self.logger.info("Upload some OS images if it doesn't exist") @@ -176,11 +176,6 @@ class ImsVnf(vnf_base.VnfOnBoardingBase): cfy.set_nameservers(ns) self.logger.debug("Resolvconf set") - if 'compute' in self.nova_client.client.services_url: - cfy.set_nova_url(self.nova_client.client.services_url['compute']) - if self.neutron_client.httpclient.endpoint_url is not None: - cfy.set_neutron_url(self.neutron_client.httpclient.endpoint_url) - self.logger.info("Prepare virtualenv for cloudify-cli") cmd = "chmod +x " + self.case_dir + "create_venv.sh" ft_utils.execute_command(cmd) |