From 13e71a2fff4618eebbb37afeaef6b9560b8b00a6 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 14 Feb 2018 23:08:29 +0100 Subject: Add suffixes to OpenStack resource names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All vnf testcases have to add suffixes in OpenStack resources names simply because the password is now generated before any run [1]. Snaps mainly creates the resource only if unfound in all tenants [2]. Then one remaining resource could easily raise permissions denied. It avoid conflicts between vrouter and cloudify_ims which are using the same names. [1] https://gerrit.opnfv.org/gerrit/#/c/50747/ [2] https://jira.opnfv.org/browse/SNAPS-257 Depends-On: If56cc44fe35ca06bc9033af620ddd3c0586877fe Change-Id: I1800886e575189b64fdc580a5ee6b59c81fcde5c Signed-off-by: Cédric Ollivier --- functest/core/vnf.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'functest/core') diff --git a/functest/core/vnf.py b/functest/core/vnf.py index 0da8f6db..05baf432 100644 --- a/functest/core/vnf.py +++ b/functest/core/vnf.py @@ -50,8 +50,9 @@ class VnfOnBoarding(testcase.TestCase): def __init__(self, **kwargs): super(VnfOnBoarding, self).__init__(**kwargs) - self.user_name = self.case_name - self.tenant_name = self.case_name + self.uuid = uuid.uuid4() + self.user_name = "{}-{}".format(self.case_name, self.uuid) + self.tenant_name = "{}-{}".format(self.case_name, self.uuid) self.snaps_creds = {} self.created_object = [] self.os_project = None @@ -106,7 +107,7 @@ class VnfOnBoarding(testcase.TestCase): """ try: self.__logger.info( - "Prepare VNF: %s, description: %s", self.tenant_name, + "Prepare VNF: %s, description: %s", self.case_name, self.tenant_description) snaps_creds = openstack_tests.get_credentials( os_env_file=self.env_file) -- cgit 1.2.3-korg