summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-05-21 04:45:28 +0000
committerGerrit Code Review <review@openstack.org>2018-05-21 04:45:28 +0000
commit37ce5417418f8acbd27f3dacb70c605b0fe48301 (patch)
tree07a06b3528b020e75428be3af48a860a8d6e1ae0
parent400263ed2b2af7f1169b104489eca3a033bf2db6 (diff)
parenta7437cae731c0914c4df78590b155f8a272f4139 (diff)
Merge "Fix the test for unique IdP"HEADmaster
-rw-r--r--api-ref/source/v3-ext/federation.inc3
-rw-r--r--keystone/tests/unit/test_v3_federation.py23
2 files changed, 13 insertions, 13 deletions
diff --git a/api-ref/source/v3-ext/federation.inc b/api-ref/source/v3-ext/federation.inc
index ba7340e..5fa86bb 100644
--- a/api-ref/source/v3-ext/federation.inc
+++ b/api-ref/source/v3-ext/federation.inc
@@ -77,7 +77,8 @@ Optional attributes:
77 The ID of the domain that is associated with the IdP. 77 The ID of the domain that is associated with the IdP.
78 78
79 If a value is not specified by the client, the service will automatically 79 If a value is not specified by the client, the service will automatically
80 create a domain and associate it to the IdP. 80 create a domain and associate it to the IdP. The ``domain_id`` is not unique
81 so that users can link multiple IdPs to one domain.
81 82
82- ``description`` (string) 83- ``description`` (string)
83 84
diff --git a/keystone/tests/unit/test_v3_federation.py b/keystone/tests/unit/test_v3_federation.py
index beb7cfc..d68f9ef 100644
--- a/keystone/tests/unit/test_v3_federation.py
+++ b/keystone/tests/unit/test_v3_federation.py
@@ -45,7 +45,6 @@ from keystone.tests.unit import federation_fixtures
45from keystone.tests.unit import ksfixtures 45from keystone.tests.unit import ksfixtures
46from keystone.tests.unit import mapping_fixtures 46from keystone.tests.unit import mapping_fixtures
47from keystone.tests.unit import test_v3 47from keystone.tests.unit import test_v3
48from keystone.tests.unit import utils as test_utils
49from keystone.token.providers import common as token_common 48from keystone.token.providers import common as token_common
50 49
51 50
@@ -994,10 +993,7 @@ class FederatedIdentityProviderTests(test_v3.RestfulTestCase):
994 # since it wasn't auto-generated 993 # since it wasn't auto-generated
995 self.assertIsNotNone(PROVIDERS.resource_api.get_domain(domain['id'])) 994 self.assertIsNotNone(PROVIDERS.resource_api.get_domain(domain['id']))
996 995
997 @test_utils.wip("Keystone never supported IdP:domain = 1:1. This test " 996 def test_create_multi_idp_to_one_domain(self):
998 "should be fixed to make sure IdP:domain is n:1",
999 bug='1760843')
1000 def test_create_idp_domain_id_unique_constraint(self):
1001 # create domain and add domain_id to keys to check 997 # create domain and add domain_id to keys to check
1002 domain = unit.new_domain_ref() 998 domain = unit.new_domain_ref()
1003 PROVIDERS.resource_api.create_domain(domain['id'], domain) 999 PROVIDERS.resource_api.create_domain(domain['id'], domain)
@@ -1007,8 +1003,8 @@ class FederatedIdentityProviderTests(test_v3.RestfulTestCase):
1007 body = self.default_body.copy() 1003 body = self.default_body.copy()
1008 body['description'] = uuid.uuid4().hex 1004 body['description'] = uuid.uuid4().hex
1009 body['domain_id'] = domain['id'] 1005 body['domain_id'] = domain['id']
1010 resp = self._create_default_idp(body=body) 1006 idp1 = self._create_default_idp(body=body)
1011 self.assertValidResponse(resp, 'identity_provider', dummy_validator, 1007 self.assertValidResponse(idp1, 'identity_provider', dummy_validator,
1012 keys_to_check=keys_to_check, 1008 keys_to_check=keys_to_check,
1013 ref=body) 1009 ref=body)
1014 # create a 2nd idp with the same domain_id 1010 # create a 2nd idp with the same domain_id
@@ -1016,11 +1012,14 @@ class FederatedIdentityProviderTests(test_v3.RestfulTestCase):
1016 body = self.default_body.copy() 1012 body = self.default_body.copy()
1017 body['description'] = uuid.uuid4().hex 1013 body['description'] = uuid.uuid4().hex
1018 body['domain_id'] = domain['id'] 1014 body['domain_id'] = domain['id']
1019 resp = self.put(url, body={'identity_provider': body}, 1015 idp2 = self.put(url, body={'identity_provider': body},
1020 expected_status=http_client.CONFLICT) 1016 expected_status=http_client.CREATED)
1021 resp_data = jsonutils.loads(resp.body) 1017 self.assertValidResponse(idp2, 'identity_provider', dummy_validator,
1022 self.assertIn('Duplicate entry', 1018 keys_to_check=keys_to_check,
1023 resp_data.get('error', {}).get('message')) 1019 ref=body)
1020
1021 self.assertEqual(idp1.result['identity_provider']['domain_id'],
1022 idp2.result['identity_provider']['domain_id'])
1024 1023
1025 def test_cannot_update_idp_domain(self): 1024 def test_cannot_update_idp_domain(self):
1026 # create new idp 1025 # create new idp