diff options
author | Brant Knudson <bknudson@us.ibm.com> | 2013-10-30 15:10:48 -0500 |
---|---|---|
committer | Brant Knudson <bknudson@us.ibm.com> | 2013-10-31 10:12:02 -0500 |
commit | 065bd571fe6a3b0baf12631140648a059f48bea2 (patch) | |
tree | 8ab2d8aaec14daf4de042ad11e23e7a9e4eab07b /keystone/tests/test_backend.py | |
parent | edcfe99c66d5e7234c008526b1a0ff411f01f546 (diff) | |
download | keystone-065bd571fe6a3b0baf12631140648a059f48bea2.tar.gz |
Enhance tests for assignment create_grant when no user or group
There were no tests that show the behavior of create_grant when
the user or group doesn't exist. Turns out the behavior is
different depending on the backend (sql vs kvs vs ldap).
Change-Id: I71c3e2b94aaa44e40c8a891b49cc2a9961cee16f
Related-Bug: #1239476
Diffstat (limited to 'keystone/tests/test_backend.py')
-rw-r--r-- | keystone/tests/test_backend.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/keystone/tests/test_backend.py b/keystone/tests/test_backend.py index c98879fda..f01e92870 100644 --- a/keystone/tests/test_backend.py +++ b/keystone/tests/test_backend.py @@ -2705,6 +2705,22 @@ class IdentityTests(object): self.assertEqual(updated_user['arbitrary_attr'], new_attr_value) + def test_create_grant_no_user(self): + # If call create_grant with a user that doesn't exist, doesn't fail. + # The behavior is different depending on the backend, see bug #1239476. + self.assignment_api.create_grant( + self.role_other['id'], + user_id=uuid.uuid4().hex, + project_id=self.tenant_bar['id']) + + def test_create_grant_no_group(self): + # If call create_grant with a group that doesn't exist, doesn't fail. + # The behavior is different depending on the backend, see bug #1239476. + self.assignment_api.create_grant( + self.role_other['id'], + group_id=uuid.uuid4().hex, + project_id=self.tenant_bar['id']) + class TokenTests(object): def _create_token_id(self): |