diff options
author | Zuul <zuul@review.openstack.org> | 2018-06-15 11:50:47 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-06-15 11:50:47 +0000 |
commit | b106c701701ee91d9e44c8d3eef6e52becda9193 (patch) | |
tree | 4d947510e1f5871e8d3312bd8d22578249b7a4cc /keystone/tests/unit/test_cli.py | |
parent | f18d54fe16dcc91a0d9d144ad15c524a679e3cc5 (diff) | |
parent | d44ed7f18cac6bd7c44a0cba5ca2bf4d6ce8c4d4 (diff) | |
download | keystone-b106c701701ee91d9e44c8d3eef6e52becda9193.tar.gz |
Merge "Ensure default roles created during bootstrap"
Diffstat (limited to 'keystone/tests/unit/test_cli.py')
-rw-r--r-- | keystone/tests/unit/test_cli.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/keystone/tests/unit/test_cli.py b/keystone/tests/unit/test_cli.py index fa64e4397..bf67707f4 100644 --- a/keystone/tests/unit/test_cli.py +++ b/keystone/tests/unit/test_cli.py @@ -107,20 +107,24 @@ class CliBootStrapTestCase(unit.SQLDriverOverrides, unit.TestCase): user = PROVIDERS.identity_api.get_user_by_name( bootstrap.username, 'default') - role = PROVIDERS.role_api.get_role(bootstrap.role_id) + admin_role = PROVIDERS.role_api.get_role(bootstrap.role_id) + reader_role = PROVIDERS.role_api.get_role(bootstrap.reader_role_id) + member_role = PROVIDERS.role_api.get_role(bootstrap.member_role_id) role_list = ( PROVIDERS.assignment_api.get_roles_for_user_and_project( user['id'], project['id'])) - self.assertIs(1, len(role_list)) - self.assertEqual(role_list[0], role['id']) + self.assertIs(3, len(role_list)) + self.assertIn(admin_role['id'], role_list) + self.assertIn(reader_role['id'], role_list) + self.assertIn(member_role['id'], role_list) system_roles = ( PROVIDERS.assignment_api.list_system_grants_for_user( user['id'] ) ) self.assertIs(1, len(system_roles)) - self.assertEqual(system_roles[0]['id'], role['id']) + self.assertEqual(system_roles[0]['id'], admin_role['id']) # NOTE(morganfainberg): Pass an empty context, it isn't used by # `authenticate` method. PROVIDERS.identity_api.authenticate( |