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:14:45 +0200 |
commit | 4a1fa0c50c4fe90f31eb3909a33b9a60b550f60d (patch) | |
tree | 3323829b22eef5d4d034ec22f6f230eace8166bc | |
parent | 08c0ab211e30f213705036b049dc9556c4279b80 (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 2505ae92f..62fec4831 100644 --- a/functest/opnfv_tests/openstack/tempest/conf_utils.py +++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py @@ -177,7 +177,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 @@ -207,14 +207,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', @@ -226,7 +218,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 999c142e4..071755b2a 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, @@ -348,7 +348,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) |