Adjust domain tests for changed list_domains scoping behavior
Domain admins, members and readers are now allowed to use the
list_domains endpoint by default but the returned list will contain
their own domain only. This patch adjusts some RBAC tests to account
for this new behavior.
Depends-On: https://review.opendev.org/c/openstack/keystone/+/900028
Change-Id: I3d89dd26400d06fcf4653035267a84ca1c775afa
diff --git a/keystone_tempest_plugin/tests/rbac/v3/test_domain.py b/keystone_tempest_plugin/tests/rbac/v3/test_domain.py
index 341e011..b09b4bd 100644
--- a/keystone_tempest_plugin/tests/rbac/v3/test_domain.py
+++ b/keystone_tempest_plugin/tests/rbac/v3/test_domain.py
@@ -178,8 +178,15 @@
def test_identity_list_domains(self):
domain_id = self.persona.credentials.domain_id
+ other_domain_id = self.admin_domains_client.create_domain(
+ name=data_utils.rand_name())['domain']['id']
+ self.addCleanup(self.admin_domains_client.delete_domain,
+ other_domain_id)
+ self.addCleanup(self.admin_domains_client.update_domain,
+ domain_id=other_domain_id, enabled=False)
resp = self.do_request('list_domains')
self.assertIn(domain_id, [d['id'] for d in resp['domains']])
+ self.assertNotIn(other_domain_id, [d['id'] for d in resp['domains']])
class DomainMemberTests(DomainAdminTests, base.BaseIdentityTest):