From 00e47772950930af585c5b92eb0c7502905f330c Mon Sep 17 00:00:00 2001 From: zhufl Date: Fri, 22 Feb 2019 11:18:46 +0800 Subject: [PATCH] Use rand_password() for password when creating user Some systems require strong passwords, so we'd better use data_utils.rand_password() to create password when creating user, to avoid password strength validation error. Change-Id: I503ba6e068b6f7c8487b7077637ee21a9c104595 --- tempest/api/identity/admin/v3/test_default_project_id.py | 7 ++++--- tempest/api/identity/admin/v3/test_inherits.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tempest/api/identity/admin/v3/test_default_project_id.py b/tempest/api/identity/admin/v3/test_default_project_id.py index a79cbc3936..73fddb7c73 100644 --- a/tempest/api/identity/admin/v3/test_default_project_id.py +++ b/tempest/api/identity/admin/v3/test_default_project_id.py @@ -21,7 +21,7 @@ from tempest.lib import decorators CONF = config.CONF -class TestDefaultProjectId (base.BaseIdentityV3AdminTest): +class TestDefaultProjectId(base.BaseIdentityV3AdminTest): @classmethod def setup_credentials(cls): @@ -57,9 +57,10 @@ class TestDefaultProjectId (base.BaseIdentityV3AdminTest): # create a user in the domain, with the previous project as his # default project user_name = data_utils.rand_name('user') + user_pass = data_utils.rand_password() user_body = self.users_client.create_user( name=user_name, - password=user_name, + password=user_pass, domain_id=dom_id, default_project_id=proj_id)['user'] user_id = user_body['id'] @@ -78,7 +79,7 @@ class TestDefaultProjectId (base.BaseIdentityV3AdminTest): # create a new client with user's credentials (NOTE: unscoped token!) creds = auth.KeystoneV3Credentials(username=user_name, - password=user_name, + password=user_pass, user_domain_name=dom_name) auth_provider = clients.get_auth_provider(creds) creds = auth_provider.fill_credentials() diff --git a/tempest/api/identity/admin/v3/test_inherits.py b/tempest/api/identity/admin/v3/test_inherits.py index 68c022583a..acc5a8cf6c 100644 --- a/tempest/api/identity/admin/v3/test_inherits.py +++ b/tempest/api/identity/admin/v3/test_inherits.py @@ -30,7 +30,7 @@ class InheritsV3TestJSON(base.BaseIdentityV3AdminTest): u_name = data_utils.rand_name('user-') u_desc = '%s description' % u_name u_email = '%s@testmail.tm' % u_name - u_password = data_utils.rand_name('pass-') + u_password = data_utils.rand_password() cls.domain = cls.create_domain() cls.project = cls.projects_client.create_project( data_utils.rand_name('project-'),