diff --git a/keystone/federation/core.py b/keystone/federation/core.py index 27223f9b59..8d7490d62f 100644 --- a/keystone/federation/core.py +++ b/keystone/federation/core.py @@ -226,12 +226,14 @@ class FederationDriverBase(object): raise exception.NotImplemented() # pragma: no cover @abc.abstractmethod - def create_mapping(self, mapping_ref): + def create_mapping(self, mapping_id, mapping): """Create a mapping. - :param mapping_ref: mapping ref with mapping name - :type mapping_ref: dict - :returns: mapping_ref + :param mapping_id: id of mapping ref + :type mapping_id: string + :param mapping: mapping ref with mapping name + :type mapping: dict + :returns: mapping ref """ raise exception.NotImplemented() # pragma: no cover @@ -473,8 +475,8 @@ class V9FederationWrapperForV8Driver(FederationDriverV9): def delete_protocol(self, idp_id, protocol_id): self.driver.delete_protocol(idp_id, protocol_id) - def create_mapping(self, mapping_ref): - return self.driver.create_mapping(mapping_ref) + def create_mapping(self, mapping_id, mapping): + return self.driver.create_mapping(mapping_id, mapping) def delete_mapping(self, mapping_id): self.driver.delete_mapping(mapping_id) diff --git a/keystone/tests/unit/backend/legacy_drivers/federation/V8/api_v3.py b/keystone/tests/unit/backend/legacy_drivers/federation/V8/api_v3.py index 48e5a71658..711ccc0e54 100644 --- a/keystone/tests/unit/backend/legacy_drivers/federation/V8/api_v3.py +++ b/keystone/tests/unit/backend/legacy_drivers/federation/V8/api_v3.py @@ -13,19 +13,42 @@ from keystone.tests.unit import test_v3_federation -class FederatedIdentityProviderTestsV8( - test_v3_federation.FederatedIdentityProviderTests): - """Test that a V8 driver still passes the same tests. - - We use the SQL driver as an example of a V8 legacy driver. - - """ - - def config_overrides(self): - super(FederatedIdentityProviderTestsV8, self).config_overrides() - # V8 SQL specific driver overrides +class FederatedSetupMixinV8(object): + def useV8driver(self): + # We use the SQL driver as an example V8 driver, so override + # the current driver with that version. self.config_fixture.config( group='federation', driver='keystone.federation.V8_backends.sql.Federation') self.use_specific_sql_driver_version( 'keystone.federation', 'backends', 'V8_') + + +class FederatedIdentityProviderTestsV8( + test_v3_federation.FederatedIdentityProviderTests, + FederatedSetupMixinV8): + """Test that a V8 driver still passes the same tests.""" + + def config_overrides(self): + super(FederatedIdentityProviderTestsV8, self).config_overrides() + self.useV8driver() + + +class MappingCRUDTestsV8( + test_v3_federation.MappingCRUDTests, + FederatedSetupMixinV8): + """Test that a V8 driver still passes the same tests.""" + + def config_overrides(self): + super(MappingCRUDTestsV8, self).config_overrides() + self.useV8driver() + + +class ServiceProviderTestsV8( + test_v3_federation.ServiceProviderTests, + FederatedSetupMixinV8): + """Test that a V8 driver still passes the same tests.""" + + def config_overrides(self): + super(ServiceProviderTestsV8, self).config_overrides() + self.useV8driver()