summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-03-14 02:56:17 +0000
committerGerrit Code Review <review@openstack.org>2013-03-14 02:56:17 +0000
commit5ad291857ed669dfaad77a5b3d534f5fe8589377 (patch)
tree5941940e35ed55a0314eec851dd83adf4d01cae5
parent64ca02c3593a7e73862ecf97915a836ee18ec6f5 (diff)
parentfe28ddaffeb020f32910a7c5c2c8629b85c2ef2f (diff)
downloadkeystone-5ad291857ed669dfaad77a5b3d534f5fe8589377.tar.gz
keystone-5ad291857ed669dfaad77a5b3d534f5fe8589377.tar.xz
keystone-5ad291857ed669dfaad77a5b3d534f5fe8589377.zip
Merge "Added test cases to improve LDAP project testing"
-rw-r--r--tests/test_backend_ldap.py49
1 files changed, 48 insertions, 1 deletions
diff --git a/tests/test_backend_ldap.py b/tests/test_backend_ldap.py
index 1f8d2a2b..c93749a7 100644
--- a/tests/test_backend_ldap.py
+++ b/tests/test_backend_ldap.py
@@ -417,7 +417,26 @@ class LDAPIdentity(test.TestCase, test_backend.IdentityTests):
raise nose.exc.SkipTest('Blocked by bug 1101276')
def test_project_crud(self):
- raise nose.exc.SkipTest('Blocked by bug 1101289')
+ # NOTE(topol): LDAP implementation does not currently support the
+ # updating of a project name so this method override
+ # provides a different update test
+ project = {'id': uuid.uuid4().hex, 'name': uuid.uuid4().hex,
+ 'domain_id': uuid.uuid4().hex,
+ 'description': uuid.uuid4().hex
+ }
+ self.identity_api.create_project(project['id'], project)
+ project_ref = self.identity_api.get_project(project['id'])
+ self.assertDictEqual(project_ref, project)
+
+ project['description'] = uuid.uuid4().hex
+ self.identity_api.update_project(project['id'], project)
+ project_ref = self.identity_api.get_project(project['id'])
+ self.assertDictEqual(project_ref, project)
+
+ self.identity_api.delete_project(project['id'])
+ self.assertRaises(exception.ProjectNotFound,
+ self.identity_api.get_project,
+ project['id'])
def test_get_and_remove_role_grant_by_group_and_cross_domain(self):
raise nose.exc.SkipTest('Blocked by bug 1101287')
@@ -526,6 +545,34 @@ class LDAPIdentityEnabledEmulation(LDAPIdentity):
self.assertDictEqual(user_ref, user)
self.assertDictEqual(tenant_ref, self.tenant_baz)
+ def test_project_crud(self):
+ # NOTE(topol): LDAPIdentityEnabledEmulation will create an
+ # enabled key in the project dictionary so this
+ # method override handles this side-effect
+ project = {'id': uuid.uuid4().hex, 'name': uuid.uuid4().hex,
+ 'domain_id': uuid.uuid4().hex,
+ 'description': uuid.uuid4().hex
+ }
+
+ self.identity_api.create_project(project['id'], project)
+ project_ref = self.identity_api.get_project(project['id'])
+
+ # self.identity_api.create_project adds an enabled
+ # key with a value of True when LDAPIdentityEnabledEmulation
+ # is used so we now add this expected key to the project dictionary
+ project['enabled'] = True
+ self.assertDictEqual(project_ref, project)
+
+ project['description'] = uuid.uuid4().hex
+ self.identity_api.update_project(project['id'], project)
+ project_ref = self.identity_api.get_project(project['id'])
+ self.assertDictEqual(project_ref, project)
+
+ self.identity_api.delete_project(project['id'])
+ self.assertRaises(exception.ProjectNotFound,
+ self.identity_api.get_project,
+ project['id'])
+
def test_user_crud(self):
user = {'domain_id': uuid.uuid4().hex, 'id': uuid.uuid4().hex,
'name': uuid.uuid4().hex, 'password': 'passw0rd'}