Merge "Fix the test for unique IdP"
This commit is contained in:
commit
37ce541741
@ -77,7 +77,8 @@ Optional attributes:
|
|||||||
The ID of the domain that is associated with the IdP.
|
The ID of the domain that is associated with the IdP.
|
||||||
|
|
||||||
If a value is not specified by the client, the service will automatically
|
If a value is not specified by the client, the service will automatically
|
||||||
create a domain and associate it to the IdP.
|
create a domain and associate it to the IdP. The ``domain_id`` is not unique
|
||||||
|
so that users can link multiple IdPs to one domain.
|
||||||
|
|
||||||
- ``description`` (string)
|
- ``description`` (string)
|
||||||
|
|
||||||
|
@ -45,7 +45,6 @@ from keystone.tests.unit import federation_fixtures
|
|||||||
from keystone.tests.unit import ksfixtures
|
from keystone.tests.unit import ksfixtures
|
||||||
from keystone.tests.unit import mapping_fixtures
|
from keystone.tests.unit import mapping_fixtures
|
||||||
from keystone.tests.unit import test_v3
|
from keystone.tests.unit import test_v3
|
||||||
from keystone.tests.unit import utils as test_utils
|
|
||||||
from keystone.token.providers import common as token_common
|
from keystone.token.providers import common as token_common
|
||||||
|
|
||||||
|
|
||||||
@ -994,10 +993,7 @@ class FederatedIdentityProviderTests(test_v3.RestfulTestCase):
|
|||||||
# since it wasn't auto-generated
|
# since it wasn't auto-generated
|
||||||
self.assertIsNotNone(PROVIDERS.resource_api.get_domain(domain['id']))
|
self.assertIsNotNone(PROVIDERS.resource_api.get_domain(domain['id']))
|
||||||
|
|
||||||
@test_utils.wip("Keystone never supported IdP:domain = 1:1. This test "
|
def test_create_multi_idp_to_one_domain(self):
|
||||||
"should be fixed to make sure IdP:domain is n:1",
|
|
||||||
bug='1760843')
|
|
||||||
def test_create_idp_domain_id_unique_constraint(self):
|
|
||||||
# create domain and add domain_id to keys to check
|
# create domain and add domain_id to keys to check
|
||||||
domain = unit.new_domain_ref()
|
domain = unit.new_domain_ref()
|
||||||
PROVIDERS.resource_api.create_domain(domain['id'], domain)
|
PROVIDERS.resource_api.create_domain(domain['id'], domain)
|
||||||
@ -1007,8 +1003,8 @@ class FederatedIdentityProviderTests(test_v3.RestfulTestCase):
|
|||||||
body = self.default_body.copy()
|
body = self.default_body.copy()
|
||||||
body['description'] = uuid.uuid4().hex
|
body['description'] = uuid.uuid4().hex
|
||||||
body['domain_id'] = domain['id']
|
body['domain_id'] = domain['id']
|
||||||
resp = self._create_default_idp(body=body)
|
idp1 = self._create_default_idp(body=body)
|
||||||
self.assertValidResponse(resp, 'identity_provider', dummy_validator,
|
self.assertValidResponse(idp1, 'identity_provider', dummy_validator,
|
||||||
keys_to_check=keys_to_check,
|
keys_to_check=keys_to_check,
|
||||||
ref=body)
|
ref=body)
|
||||||
# create a 2nd idp with the same domain_id
|
# create a 2nd idp with the same domain_id
|
||||||
@ -1016,11 +1012,14 @@ class FederatedIdentityProviderTests(test_v3.RestfulTestCase):
|
|||||||
body = self.default_body.copy()
|
body = self.default_body.copy()
|
||||||
body['description'] = uuid.uuid4().hex
|
body['description'] = uuid.uuid4().hex
|
||||||
body['domain_id'] = domain['id']
|
body['domain_id'] = domain['id']
|
||||||
resp = self.put(url, body={'identity_provider': body},
|
idp2 = self.put(url, body={'identity_provider': body},
|
||||||
expected_status=http_client.CONFLICT)
|
expected_status=http_client.CREATED)
|
||||||
resp_data = jsonutils.loads(resp.body)
|
self.assertValidResponse(idp2, 'identity_provider', dummy_validator,
|
||||||
self.assertIn('Duplicate entry',
|
keys_to_check=keys_to_check,
|
||||||
resp_data.get('error', {}).get('message'))
|
ref=body)
|
||||||
|
|
||||||
|
self.assertEqual(idp1.result['identity_provider']['domain_id'],
|
||||||
|
idp2.result['identity_provider']['domain_id'])
|
||||||
|
|
||||||
def test_cannot_update_idp_domain(self):
|
def test_cannot_update_idp_domain(self):
|
||||||
# create new idp
|
# create new idp
|
||||||
|
Loading…
Reference in New Issue
Block a user