From 2965fd64df9c85b7a4c384b6f33aeea96ccbbece Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 2 Oct 2019 05:26:45 +0200 Subject: Switch to Tempest password generator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Functest depends on Tempest (master) then we can safely leverage on its password generator. '%' is forbidden in our logic then it's replaced by '!' (extra random logic seems overkilled). Change-Id: Ie1d1b78401999efbbb5aec4500c14595bde87987 Signed-off-by: Cédric Ollivier --- functest/core/tenantnetwork.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/functest/core/tenantnetwork.py b/functest/core/tenantnetwork.py index 3b9c7eba9..056e91c35 100644 --- a/functest/core/tenantnetwork.py +++ b/functest/core/tenantnetwork.py @@ -20,13 +20,12 @@ This classes could be reused by more complexed scenarios (Single VM) import logging import os -import random -import string import time import uuid import os_client_config import shade +from tempest.lib.common.utils import data_utils from xtesting.core import testcase from functest.utils import config @@ -56,9 +55,7 @@ class NewProject(): """Create projects/users""" assert self.orig_cloud assert self.case_name - self.password = ''.join(random.choice( - string.ascii_letters + string.digits + - '!()*+,-.<=>?@[]^_{|}~') for _ in range(30)) + self.password = data_utils.rand_password().replace('%', '!') self.__logger.debug("password: %s", self.password) self.domain = self.orig_cloud.get_domain( name_or_id=self.orig_cloud.auth.get( -- cgit 1.2.3-korg