aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2019-10-02 05:26:45 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2019-10-08 20:11:27 +0200
commit2965fd64df9c85b7a4c384b6f33aeea96ccbbece (patch)
treecf8e4fb5d7c4207ed6baafae46e425ebac6efe6c
parent574243656df6acae28094c62f33410ef1fc3e7b5 (diff)
Switch to Tempest password generator
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 <cedric.ollivier@orange.com>
-rw-r--r--functest/core/tenantnetwork.py7
1 files 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(