aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/tempest/conf_utils.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-02-21 10:01:30 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2018-02-24 13:29:45 +0100
commita1b0f64bccea682e55ec5086aef979df57cf686f (patch)
tree3da4de0c032d840322f7e84427c7e76b8e27167c /functest/opnfv_tests/openstack/tempest/conf_utils.py
parent02bd6e30668b477781ab007e82bfe2a207baa8b7 (diff)
Automatically download defcore.txt
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 <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/tempest/conf_utils.py')
-rw-r--r--functest/opnfv_tests/openstack/tempest/conf_utils.py50
1 files changed, 3 insertions, 47 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index 4fe05e46b..6fc44d892 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)