X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=functest%2Fopnfv_tests%2Fopenstack%2Ftempest%2Fconf_utils.py;h=7f7db35eb4e865f708769c28d8f42af4253c5363;hb=3e2c8edac0af2523bc941e2c7d7c55b040c4aeed;hp=52fa600320228b1cf475f5a1274bb0f9972b6276;hpb=f793114a359467deb494770c05689c87b1007707;p=functest.git diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py index 52fa60032..7f7db35eb 100644 --- a/functest/opnfv_tests/openstack/tempest/conf_utils.py +++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py @@ -115,33 +115,25 @@ def get_verifier_deployment_dir(verifier_id, deployment_id): 'for-deployment-{}'.format(deployment_id)) -def get_repo_tag(repo): - """ - Returns last tag of current branch - """ - cmd = ("git -C {0} describe --abbrev=0 HEAD".format(repo)) - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) - tag = p.stdout.readline().rstrip() - - return str(tag) - - 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): + 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, image_id, flavor_id) + configure_tempest_update_params(conf_file, image_id, flavor_id, + compute_cnt) def configure_tempest_defcore(deployment_dir, image_id, flavor_id, @@ -197,8 +189,8 @@ def generate_test_accounts_file(tenant_id): yaml.dump(accounts_list, f, default_flow_style=False) -def configure_tempest_update_params(tempest_conf_file, - image_id=None, flavor_id=None): +def configure_tempest_update_params(tempest_conf_file, image_id=None, + flavor_id=None, compute_cnt=1): """ Add/update needed parameters into tempest.conf file """ @@ -221,6 +213,11 @@ def configure_tempest_update_params(tempest_conf_file, config.set('compute', 'flavor_ref', flavor_id) if FLAVOR_ID_ALT is not None: config.set('compute', 'flavor_ref_alt', FLAVOR_ID_ALT) + if compute_cnt > 1: + # enable multinode tests + config.set('compute', 'min_compute_nodes', compute_cnt) + config.set('compute-feature-enabled', 'live_migration', True) + config.set('identity', 'region', 'RegionOne') if os_utils.is_keystone_v3(): auth_version = 'v3'