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
This commit is contained in:
Monty Taylor 2017-05-31 07:10:57 -05:00
parent 6a325df8b6
commit 014d3979cf
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594

View File

@ -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')