From 014d3979cfca4b9229faba7ef5bbbfea8b17031f Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 31 May 2017 07:10:57 -0500 Subject: [PATCH] Update test_user_update_password to overlay clouds.yaml Rather than adding a bunch of v2/v3 logic, just use the demo cloud entry in clouds.yaml but with the new user_id/password. To make sure this works, go ahead and assign the member role to the user, so that the project settings in the file will work too. Change-Id: I1adc271d60c0ded25c639962d0974242009c7c9b --- shade/tests/functional/test_users.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/shade/tests/functional/test_users.py b/shade/tests/functional/test_users.py index 8a530424c..4bc3b885c 100644 --- a/shade/tests/functional/test_users.py +++ b/shade/tests/functional/test_users.py @@ -17,6 +17,7 @@ test_users Functional tests for `shade` user methods. """ +from shade import operator_cloud from shade import OpenStackCloudException from shade.tests.functional import base @@ -126,11 +127,14 @@ class TestUsers(base.KeystoneBaseFunctionalTestCase): self.assertEqual(user_name, new_user['name']) self.assertEqual(user_email, new_user['email']) self.assertTrue(new_user['enabled']) - # TODO(mordred) Add this back when we can figure out how to do it - # with the updated gate jobs - # self.assertIsNotNone(operator_cloud( - # user_id=user['id'], password='new_secret', - # auth_url=self.operator_cloud.auth['auth_url']).keystone_client) + self.assertTrue(self.operator_cloud.grant_role( + 'Member', user=user['id'], project='demo', wait=True)) + self.addCleanup( + self.operator_cloud.revoke_role, + 'Member', user=user['id'], project='demo', wait=True) + self.assertIsNotNone(operator_cloud( + cloud=self._demo_name, + username=user_name, password='new_secret').keystone_client) def test_users_and_groups(self): i_ver = self.operator_cloud.cloud_config.get_api_version('identity')