From a1b0f64bccea682e55ec5086aef979df57cf686f Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 21 Feb 2018 10:01:30 +0100 Subject: Automatically download defcore.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It stops writing files in Functest package dirs and cleans instance variables in refstack modules too. Change-Id: Iaddbe4fbaf12d1af207b86d4e44258efdc6d6f3a Signed-off-by: Cédric Ollivier --- .../opnfv_tests/openstack/tempest/conf_utils.py | 50 ++-------------------- 1 file changed, 3 insertions(+), 47 deletions(-) (limited to 'functest/opnfv_tests/openstack/tempest/conf_utils.py') diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py index 4fe05e46..6fc44d89 100644 --- a/functest/opnfv_tests/openstack/tempest/conf_utils.py +++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py @@ -39,13 +39,8 @@ TEMPEST_CUSTOM = pkg_resources.resource_filename( 'functest', 'opnfv_tests/openstack/tempest/custom_tests/test_list.txt') TEMPEST_BLACKLIST = pkg_resources.resource_filename( 'functest', 'opnfv_tests/openstack/tempest/custom_tests/blacklist.txt') -TEMPEST_DEFCORE = pkg_resources.resource_filename( - 'functest', - 'opnfv_tests/openstack/tempest/custom_tests/defcore_req.txt') TEMPEST_RAW_LIST = os.path.join(TEMPEST_RESULTS_DIR, 'test_raw_list.txt') TEMPEST_LIST = os.path.join(TEMPEST_RESULTS_DIR, 'test_list.txt') -REFSTACK_RESULTS_DIR = os.path.join( - getattr(config.CONF, 'dir_results'), 'refstack') TEMPEST_CONF_YAML = pkg_resources.resource_filename( 'functest', 'opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml') TEST_ACCOUNTS_FILE = pkg_resources.resource_filename( @@ -194,41 +189,6 @@ def configure_tempest(deployment_dir, network_name=None, image_id=None, flavor_id, compute_cnt) -def configure_tempest_defcore(deployment_dir, network_name, image_id, - flavor_id, image_id_alt, flavor_id_alt, - tenant_id): - # pylint: disable=too-many-arguments - """ - Add/update needed parameters into tempest.conf file - """ - conf_file = configure_verifier(deployment_dir) - configure_tempest_update_params(conf_file, network_name, image_id, - flavor_id) - - LOGGER.debug("Updating selected tempest.conf parameters for defcore...") - rconfig = ConfigParser.RawConfigParser() - rconfig.read(conf_file) - rconfig.set('DEFAULT', 'log_file', '{}/tempest.log'.format(deployment_dir)) - rconfig.set('oslo_concurrency', 'lock_path', - '{}/lock_files'.format(deployment_dir)) - generate_test_accounts_file(tenant_id=tenant_id) - rconfig.set('auth', 'test_accounts_file', TEST_ACCOUNTS_FILE) - rconfig.set('scenario', 'img_dir', '{}'.format(deployment_dir)) - rconfig.set('scenario', 'img_file', 'tempest-image') - rconfig.set('compute', 'image_ref', image_id) - rconfig.set('compute', 'image_ref_alt', image_id_alt) - rconfig.set('compute', 'flavor_ref', flavor_id) - rconfig.set('compute', 'flavor_ref_alt', flavor_id_alt) - - with open(conf_file, 'wb') as config_file: - rconfig.write(config_file) - - confpath = pkg_resources.resource_filename( - 'functest', - 'opnfv_tests/openstack/refstack_client/refstack_tempest.conf') - shutil.copyfile(conf_file, confpath) - - def generate_test_accounts_file(tenant_id): """ Add needed tenant and user params into test_accounts.yaml @@ -314,13 +274,9 @@ def configure_tempest_update_params(tempest_conf_file, network_name=None, if os.environ.get('OS_ENDPOINT_TYPE') is not None: sections = rconfig.sections() - services_list = ['compute', - 'volume', - 'image', - 'network', - 'data-processing', - 'object-storage', - 'orchestration'] + services_list = [ + 'compute', 'volume', 'image', 'network', 'data-processing', + 'object-storage', 'orchestration'] for service in services_list: if service not in sections: rconfig.add_section(service) -- cgit 1.2.3-korg