diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-09-22 21:35:04 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-09-22 22:13:22 +0200 |
commit | 35764b15ffc508398a70547e7db5cb1680ab6eb1 (patch) | |
tree | bce8db77268e198a5a4c606e64a320634a3c25dc | |
parent | 47e21b230cdc31bd2b5d5f8213485ed7665ab681 (diff) |
Set admin_domain_scope to True (tempest)
It completes the previous commit [1].
It also sets cidr and fully forces Keystone v3.
[1] https://gerrit.opnfv.org/gerrit/#/c/62777/
Change-Id: Ida948a4ff051dc1d1325d29a815c201366a1e33e
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit f4b545efe2339bdb5f6117d484e127adda5c8021)
-rw-r--r-- | functest/opnfv_tests/openstack/tempest/conf_utils.py | 20 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/tempest/tempest.py | 10 |
2 files changed, 15 insertions, 15 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py index d31e45f37..382b04863 100644 --- a/functest/opnfv_tests/openstack/tempest/conf_utils.py +++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py @@ -173,7 +173,7 @@ def update_tempest_conf_file(conf_file, rconfig): def configure_tempest_update_params( tempest_conf_file, image_id=None, flavor_id=None, compute_cnt=1, image_alt_id=None, flavor_alt_id=None, - domain_name="Default"): + admin_role_name='admin', cidr='192.168.120.0/24'): # pylint: disable=too-many-branches, too-many-arguments """ Add/update needed parameters into tempest.conf file @@ -203,14 +203,6 @@ def configure_tempest_update_params( convert_list_to_ini(filters)) if os.environ.get('OS_REGION_NAME'): rconfig.set('identity', 'region', os.environ.get('OS_REGION_NAME')) - identity_api_version = os.environ.get("OS_IDENTITY_API_VERSION", '3') - rconfig.set('auth', 'admin_domain_scope', True) - rconfig.set('auth', 'default_credentials_domain_name', domain_name) - if identity_api_version == '3': - auth_version = 'v3' - rconfig.set('identity-feature-enabled', 'api_v2', False) - else: - auth_version = 'v2' if env.get("NEW_USER_ROLE").lower() != "member": rconfig.set( 'auth', 'tempest_roles', @@ -222,7 +214,15 @@ def configure_tempest_update_params( assert os.path.exists( account_file), "{} doesn't exist".format(account_file) rconfig.set('auth', 'test_accounts_file', account_file) - rconfig.set('identity', 'auth_version', auth_version) + rconfig.set('identity', 'auth_version', 'v3') + rconfig.set('identity', 'admin_role', admin_role_name) + rconfig.set('identity', 'admin_domain_scope', True) + rconfig.set('identity-feature-enabled', 'api_v2', False) + rconfig.set('identity-feature-enabled', 'api_v2_admin', False) + if not rconfig.has_section('neutron'): + rconfig.add_section('neutron') + rconfig.set('neutron', 'default_network', cidr) + rconfig.set('neutron', 'project_network_cidr', cidr) rconfig.set( 'validation', 'ssh_timeout', getattr(config.CONF, 'tempest_validation_ssh_timeout')) diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index a4fff4756..e9ab53c90 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -46,17 +46,17 @@ class TempestCommon(singlevm.VmReady2): assert self.cloud assert self.project if self.orig_cloud.get_role("admin"): - role_name = "admin" + self.role_name = "admin" elif self.orig_cloud.get_role("Admin"): - role_name = "Admin" + self.role_name = "Admin" else: raise Exception("Cannot detect neither admin nor Admin") self.orig_cloud.grant_role( - role_name, user=self.project.user.id, + self.role_name, user=self.project.user.id, project=self.project.project.id, domain=self.project.domain.id) self.orig_cloud.grant_role( - role_name, user=self.project.user.id, + self.role_name, user=self.project.user.id, domain=self.project.domain.id) environ = dict( os.environ, @@ -409,7 +409,7 @@ class TempestCommon(singlevm.VmReady2): compute_cnt=compute_cnt, image_alt_id=self.image_alt.id, flavor_alt_id=self.flavor_alt.id, - domain_name=self.cloud.auth.get("project_domain_name", "Default")) + admin_role_name=self.role_name, cidr=self.cidr) self.update_scenario_section() self.backup_tempest_config(self.conf_file, self.res_dir) |