Browse Source

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
wangxiyuan 9 months ago
parent
commit
ddc5109545

+ 7
- 0
keystone_tempest_plugin/tests/api/identity/v3/test_identity_providers.py View File

@@ -43,6 +43,13 @@ class IndentityProvidersTest(base.BaseIdentityTest):
43 43
     def _create_idp(self, idp_id, idp_ref):
44 44
         idp = self.idps_client.create_identity_provider(
45 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 53
         self.addCleanup(
47 54
             self.idps_client.delete_identity_provider, idp_id)
48 55
         return idp

+ 7
- 1
keystone_tempest_plugin/tests/scenario/test_federated_authentication.py View File

@@ -50,8 +50,14 @@ class TestSaml2EcpFederatedAuthentication(base.BaseIdentityTest):
50 50
 
51 51
     def _setup_idp(self):
52 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 54
             self.idp_id, remote_ids=remote_ids, enabled=True)
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)
55 61
         self.addCleanup(
56 62
             self.idps_client.delete_identity_provider, self.idp_id)
57 63
 

Loading…
Cancel
Save