From c66abf22ffef53fa42c4425d3dceec4289af622b Mon Sep 17 00:00:00 2001 From: boucherv Date: Tue, 21 Feb 2017 15:37:48 +0100 Subject: Fix neutron auth issue Adding admin role to the new_user for the new tenant It will fix this bug for other tests based on this class JIRA: FUNCTEST-734 Change-Id: Ia3b8797fa391f528d24425a5b13c1b329cb992f4 Signed-off-by: boucherv --- functest/core/vnf_base.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'functest/core/vnf_base.py') diff --git a/functest/core/vnf_base.py b/functest/core/vnf_base.py index 07b64fd05..9438dca10 100644 --- a/functest/core/vnf_base.py +++ b/functest/core/vnf_base.py @@ -111,9 +111,9 @@ class VnfOnBoardingBase(base.TestcaseBase): self.keystone_client = os_utils.get_keystone_client() self.logger.info("Prepare OpenStack plateform(create tenant and user)") - user_id = os_utils.get_user_id(self.keystone_client, - self.creds['username']) - if user_id == '': + admin_user_id = os_utils.get_user_id(self.keystone_client, + self.creds['username']) + if admin_user_id == '': self.step_failure("Failed to get id of " + self.creds['username']) @@ -133,7 +133,7 @@ class VnfOnBoardingBase(base.TestcaseBase): self.logger.error("Failed to get id for %s role" % role_name) self.step_failure("Failed to get role id of " + role_name) - if not os_utils.add_role_user(self.keystone_client, user_id, + if not os_utils.add_role_user(self.keystone_client, admin_user_id, role_id, tenant_id): self.logger.error("Failed to add %s on tenant" % self.creds['username']) @@ -149,6 +149,13 @@ class VnfOnBoardingBase(base.TestcaseBase): self.logger.error("Failed to create %s user" % self.tenant_name) self.step_failure("Failed to create user ") + if not os_utils.add_role_user(self.keystone_client, user_id, + role_id, tenant_id): + self.logger.error("Failed to add %s on tenant" % + self.tenant_name) + self.step_failure("Failed to add %s on tenant" % + self.tenant_name) + self.logger.info("Update OpenStack creds informations") self.admin_creds = self.creds.copy() self.admin_creds.update({ -- cgit 1.2.3-korg