summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorboucherv <valentin.boucher@orange.com>2017-02-21 15:37:48 +0100
committerboucherv <valentin.boucher@orange.com>2017-02-21 15:37:48 +0100
commitc66abf22ffef53fa42c4425d3dceec4289af622b (patch)
tree4e925c8ea75abd66c74952aba97d6602b904cfe1
parentc860e5488c5a1ebe69fe6dbe734372a67304f301 (diff)
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 <valentin.boucher@orange.com>
-rw-r--r--functest/core/vnf_base.py15
1 files changed, 11 insertions, 4 deletions
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({