From 2185f7ba88abae4c5b575a98cffd1fe9cfcfb42d Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 16 Mar 2018 07:14:40 +0100 Subject: Set project_name arg when creating users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It also print snaps_creds to ease debugging [1]. [1] https://build.opnfv.org/ci/view/functest/job/functest-joid-baremetal-daily-master/22/console Change-Id: I5b0d0dcffe3e45d8fa7d1d7d8ce19172fc42aaa1 Signed-off-by: Cédric Ollivier --- functest/core/vnf.py | 1 + functest/opnfv_tests/vnf/epc/juju_epc.py | 6 +++++- functest/opnfv_tests/vnf/router/cloudify_vrouter.py | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/functest/core/vnf.py b/functest/core/vnf.py index 2f9c5a71f..a6afd4e6b 100644 --- a/functest/core/vnf.py +++ b/functest/core/vnf.py @@ -110,6 +110,7 @@ class VnfOnBoarding(vnf.VnfOnBoarding): user_creator.create() self.created_object.append(user_creator) self.snaps_creds = user_creator.get_os_creds(self.tenant_name) + self.__logger.debug("snaps creds: %s", self.snaps_creds) return vnf.VnfOnBoarding.EX_OK except Exception: # pylint: disable=broad-except diff --git a/functest/opnfv_tests/vnf/epc/juju_epc.py b/functest/opnfv_tests/vnf/epc/juju_epc.py index 39678916d..9e5f8d33b 100644 --- a/functest/opnfv_tests/vnf/epc/juju_epc.py +++ b/functest/opnfv_tests/vnf/epc/juju_epc.py @@ -130,7 +130,9 @@ class JujuEpc(vnf.VnfOnBoarding): user_creator = OpenStackUser( self.snaps_creds, UserConfig( - name=name, password=str(uuid.uuid4()), + name=name, + password=str(uuid.uuid4()), + project_name=self.tenant_name, domain=self.snaps_creds.user_domain_name, roles={'_member_': self.tenant_name})) user_creator.create() @@ -161,6 +163,7 @@ class JujuEpc(vnf.VnfOnBoarding): user_creator = self._bypass_juju_network_discovery_bug( 'juju_network_discovery_bug') snaps_creds = user_creator.get_os_creds(self.snaps_creds.project_name) + self.__logger.debug("snaps creds: %s", snaps_creds) credentials_yaml = os.path.join(self.res_dir, "credentials.yaml") creds_data = { 'pass': snaps_creds.password, @@ -178,6 +181,7 @@ class JujuEpc(vnf.VnfOnBoarding): user_creator = self._bypass_juju_network_discovery_bug( 'juju_network_discovery_bug') snaps_creds = user_creator.get_os_creds(self.snaps_creds.project_name) + self.__logger.debug("snaps creds: %s", snaps_creds) credentials_yaml = os.path.join(self.res_dir, "credentials.yaml") creds_data = { 'pass': snaps_creds.password, diff --git a/functest/opnfv_tests/vnf/router/cloudify_vrouter.py b/functest/opnfv_tests/vnf/router/cloudify_vrouter.py index 14269ad36..e23bba119 100644 --- a/functest/opnfv_tests/vnf/router/cloudify_vrouter.py +++ b/functest/opnfv_tests/vnf/router/cloudify_vrouter.py @@ -334,11 +334,13 @@ class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase): UserConfig( name='cloudify_network_bug-{}'.format(self.uuid), password=str(uuid.uuid4()), + project_name=self.tenant_name, domain=self.snaps_creds.user_domain_name, roles={'_member_': self.tenant_name})) user_creator.create() self.created_object.append(user_creator) snaps_creds = user_creator.get_os_creds(self.snaps_creds.project_name) + self.__logger.debug("snaps creds: %s", snaps_creds) self.vnf['inputs'].update(dict(target_vnf_image_id=image.id)) self.vnf['inputs'].update(dict(reference_vnf_image_id=image.id)) -- cgit 1.2.3-korg