summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangxiyuan <wangxiyuan1007@gmail.com>2018-06-29 14:20:02 +0800
committerwangxiyuan <wangxiyuan@huawei.com>2019-01-03 09:43:29 +0000
commitddc5109545a1bbf32819b57cfe9374613baa0ae9 (patch)
tree3ec0bb5fc782403fae0fbda44210bb518d9df5bb
parent958d34ee2dfa131ad5441b17ddb4480a7a72b7b2 (diff)
Clean up the auto generated domain
During the federation test, when creating an identity provider, a new domain will be created as well. This auto generated domain should be cleaned up when test exit. Depends-on: https://review.openstack.org/#/c/628132/ Change-Id: I6dcd0a0154c8658585a98ae138825881fe51d664
Notes
Notes (review): Code-Review+2: Colleen Murphy <colleen@gazlene.net> Code-Review+2: Rodrigo Duarte <rodrigodsousa@gmail.com> Workflow+1: Rodrigo Duarte <rodrigodsousa@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 18 Jan 2019 00:48:03 +0000 Reviewed-on: https://review.openstack.org/579063 Project: openstack/keystone-tempest-plugin Branch: refs/heads/master
-rw-r--r--keystone_tempest_plugin/tests/api/identity/v3/test_identity_providers.py7
-rw-r--r--keystone_tempest_plugin/tests/scenario/test_federated_authentication.py8
2 files changed, 14 insertions, 1 deletions
diff --git a/keystone_tempest_plugin/tests/api/identity/v3/test_identity_providers.py b/keystone_tempest_plugin/tests/api/identity/v3/test_identity_providers.py
index 97f651f..fef14ea 100644
--- a/keystone_tempest_plugin/tests/api/identity/v3/test_identity_providers.py
+++ b/keystone_tempest_plugin/tests/api/identity/v3/test_identity_providers.py
@@ -43,6 +43,13 @@ class IndentityProvidersTest(base.BaseIdentityTest):
43 def _create_idp(self, idp_id, idp_ref): 43 def _create_idp(self, idp_id, idp_ref):
44 idp = self.idps_client.create_identity_provider( 44 idp = self.idps_client.create_identity_provider(
45 idp_id, **idp_ref)['identity_provider'] 45 idp_id, **idp_ref)['identity_provider']
46 if not idp_ref.get('domain_id'):
47 self.addCleanup(
48 self.keystone_manager.domains_client.delete_domain,
49 idp['domain_id'])
50 self.addCleanup(
51 self.keystone_manager.domains_client.update_domain,
52 idp['domain_id'], enabled=False)
46 self.addCleanup( 53 self.addCleanup(
47 self.idps_client.delete_identity_provider, idp_id) 54 self.idps_client.delete_identity_provider, idp_id)
48 return idp 55 return idp
diff --git a/keystone_tempest_plugin/tests/scenario/test_federated_authentication.py b/keystone_tempest_plugin/tests/scenario/test_federated_authentication.py
index 24d7416..7814c0a 100644
--- a/keystone_tempest_plugin/tests/scenario/test_federated_authentication.py
+++ b/keystone_tempest_plugin/tests/scenario/test_federated_authentication.py
@@ -50,9 +50,15 @@ class TestSaml2EcpFederatedAuthentication(base.BaseIdentityTest):
50 50
51 def _setup_idp(self): 51 def _setup_idp(self):
52 remote_ids = CONF.fed_scenario.idp_remote_ids 52 remote_ids = CONF.fed_scenario.idp_remote_ids
53 self.idps_client.create_identity_provider( 53 idp = self.idps_client.create_identity_provider(
54 self.idp_id, remote_ids=remote_ids, enabled=True) 54 self.idp_id, remote_ids=remote_ids, enabled=True)
55 self.addCleanup( 55 self.addCleanup(
56 self.keystone_manager.domains_client.delete_domain,
57 idp['identity_provider']['domain_id'])
58 self.addCleanup(
59 self.keystone_manager.domains_client.update_domain,
60 idp['identity_provider']['domain_id'], enabled=False)
61 self.addCleanup(
56 self.idps_client.delete_identity_provider, self.idp_id) 62 self.idps_client.delete_identity_provider, self.idp_id)
57 63
58 def _setup_mapping(self): 64 def _setup_mapping(self):