From 03fa7eceba965e77edab90ddea088d0f9b684c51 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sat, 14 Sep 2019 11:55:58 +0200 Subject: Add punctuations in password generator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It adds a subset of string.punctuation to conform with a few password rules (see ONAP Openlab). Change-Id: I7751031bcb9b908d4162d70f8acaa4bdc87e3c79 Signed-off-by: Cédric Ollivier (cherry picked from commit cf052c809b027d6167c93399715bcd330cc0782c) --- functest/core/tenantnetwork.py | 4 +++- functest/opnfv_tests/openstack/shaker/shaker.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/functest/core/tenantnetwork.py b/functest/core/tenantnetwork.py index 604e49ae5..a7b4e9ccd 100644 --- a/functest/core/tenantnetwork.py +++ b/functest/core/tenantnetwork.py @@ -56,7 +56,9 @@ class NewProject(): assert self.orig_cloud assert self.case_name self.password = ''.join(random.choice( - string.ascii_letters + string.digits) for _ in range(30)) + string.ascii_letters + string.digits + + '!()*+,-.<=>?@[]^_{|}~') for _ in range(30)) + self.__logger.debug("password: %s", self.password) self.domain = self.orig_cloud.get_domain( name_or_id=self.orig_cloud.auth.get( "project_domain_name", "Default")) diff --git a/functest/opnfv_tests/openstack/shaker/shaker.py b/functest/opnfv_tests/openstack/shaker/shaker.py index fd31ea689..03aeccafc 100644 --- a/functest/opnfv_tests/openstack/shaker/shaker.py +++ b/functest/opnfv_tests/openstack/shaker/shaker.py @@ -100,7 +100,7 @@ class Shaker(singlevm.SingleVm2): 'unset OS_TENANT_NAME && ' 'unset OS_TENANT_ID && ' 'unset OS_ENDPOINT_TYPE && ' - 'export OS_PASSWORD={} && ' + 'export OS_PASSWORD="{}" && ' '{}' 'env && ' 'timeout {} shaker --image-name {} --flavor-name {} ' -- cgit 1.2.3-korg