GLANCE_IMAGE_PATH = os.path.join(
getattr(config.CONF, 'dir_functest_images'),
getattr(config.CONF, 'openstack_image_file_name'))
-TEMPEST_RESULTS_DIR = os.path.join(
- getattr(config.CONF, 'dir_results'), 'tempest')
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_RAW_LIST = os.path.join(TEMPEST_RESULTS_DIR, 'test_raw_list.txt')
-TEMPEST_LIST = os.path.join(TEMPEST_RESULTS_DIR, 'test_list.txt')
TEMPEST_CONF_YAML = pkg_resources.resource_filename(
'functest', 'opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml')
-TEST_ACCOUNTS_FILE = pkg_resources.resource_filename(
- 'functest',
- 'opnfv_tests/openstack/tempest/custom_tests/test_accounts.yaml')
CI_INSTALLER_TYPE = env.get('INSTALLER_TYPE')
getattr(config.CONF, 'tempest_verifier_name'))
ft_utils.execute_command(cmd, error_msg=(
"Verifier %s does not exist."
- % getattr(config.CONF, 'tempest_verifier_name')),
- verbose=False)
+ % getattr(config.CONF, 'tempest_verifier_name')), verbose=False)
cmd = ("rally verify create-verifier --source {0} "
"--name {1} --type tempest --system-wide"
.format(getattr(config.CONF, 'dir_repo_tempest'),
'for-deployment-{}'.format(deployment_id))
-def backup_tempest_config(conf_file):
+def backup_tempest_config(conf_file, res_dir):
"""
Copy config file to tempest results directory
"""
- if not os.path.exists(TEMPEST_RESULTS_DIR):
- os.makedirs(TEMPEST_RESULTS_DIR)
+ if not os.path.exists(res_dir):
+ os.makedirs(res_dir)
shutil.copyfile(conf_file,
- os.path.join(TEMPEST_RESULTS_DIR, 'tempest.conf'))
-
-
-def configure_tempest(deployment_dir, network_name=None, image_id=None,
- flavor_id=None, compute_cnt=None):
- """
- Calls rally verify and updates the generated tempest.conf with
- given parameters
- """
- conf_file = configure_verifier(deployment_dir)
- configure_tempest_update_params(conf_file, network_name, image_id,
- flavor_id, compute_cnt)
-
-
-def generate_test_accounts_file(tenant_id):
- """
- Add needed tenant and user params into test_accounts.yaml
- """
-
- LOGGER.debug("Add needed params into test_accounts.yaml...")
- accounts_list = [
- {
- 'tenant_name': getattr(
- config.CONF, 'tempest_identity_tenant_name'),
- 'tenant_id': str(tenant_id),
- 'username': getattr(config.CONF, 'tempest_identity_user_name'),
- 'password': getattr(config.CONF, 'tempest_identity_user_password')
- }
- ]
-
- with open(TEST_ACCOUNTS_FILE, "w") as tfile:
- yaml.dump(accounts_list, tfile, default_flow_style=False)
+ os.path.join(res_dir, 'tempest.conf'))
def update_tempest_conf_file(conf_file, rconfig):
rconfig.write(config_file)
-def configure_tempest_update_params(tempest_conf_file, network_name=None,
- image_id=None, flavor_id=None,
- compute_cnt=1):
- # pylint: disable=too-many-branches
+def configure_tempest_update_params(tempest_conf_file, res_dir,
+ network_name=None, image_id=None,
+ flavor_id=None, compute_cnt=1):
+ # pylint: disable=too-many-branches, too-many-arguments
"""
Add/update needed parameters into tempest.conf file
"""
rconfig = ConfigParser.RawConfigParser()
rconfig.read(tempest_conf_file)
rconfig.set('compute', 'fixed_network_name', network_name)
- if CI_INSTALLER_TYPE == 'fuel':
- # backward compatibility till Fuel jobs set the right env var
- rconfig.set('compute', 'volume_device_name', 'vdc')
- else:
- rconfig.set(
- 'compute', 'volume_device_name', env.get('VOLUME_DEVICE_NAME'))
+ rconfig.set('compute', 'volume_device_name', env.get('VOLUME_DEVICE_NAME'))
if image_id is not None:
rconfig.set('compute', 'image_ref', image_id)
if IMAGE_ID_ALT is not None:
rconfig.set('identity', 'v3_endpoint_type',
os.environ.get('OS_ENDPOINT_TYPE'))
+ rconfig.set('network-feature-enabled', 'api_extensions', 'all')
+
if os.environ.get('OS_ENDPOINT_TYPE') is not None:
sections = rconfig.sections()
services_list = [
'into tempest.conf file')
update_tempest_conf_file(tempest_conf_file, rconfig)
- backup_tempest_config(tempest_conf_file)
+ backup_tempest_config(tempest_conf_file, res_dir)
def configure_verifier(deployment_dir):