From 254fb1e4c54b3b073212ea0d9a4768953d759e8d Mon Sep 17 00:00:00 2001 From: Satellite QE <115476073+Satellite-QE@users.noreply.github.com> Date: Fri, 29 Sep 2023 17:00:27 -0400 Subject: [PATCH] [6.14.z] Workaround nonexistent auth source in upgrade template (#12749) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Workaround nonexistent auth source in upgrade template (#12722) (cherry picked from commit 23d49f5634cfa7d1af2c131383d5fff5f4fb6d43) Co-authored-by: Lukáš Hellebrandt --- tests/foreman/api/test_user.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/foreman/api/test_user.py b/tests/foreman/api/test_user.py index 59e8ba515fc..cab7b49d653 100644 --- a/tests/foreman/api/test_user.py +++ b/tests/foreman/api/test_user.py @@ -733,7 +733,7 @@ def test_positive_ad_basic_no_roles(self, create_ldap): @pytest.mark.tier3 @pytest.mark.upgrade - def test_positive_access_entities_from_ldap_org_admin(self, create_ldap): + def test_positive_access_entities_from_ldap_org_admin(self, create_ldap, module_target_sat): """LDAP User can access resources within its taxonomies if assigned role has permission for same taxonomies @@ -751,6 +751,16 @@ def test_positive_access_entities_from_ldap_org_admin(self, create_ldap): :CaseLevel: System """ + # Workaround issue where, in an upgrade template, there is already + # some auth source present with this user. That auth source instance + # doesn't really run and attempting to login as that user + # leads to ISE 500 (which is itself a bug, the error should be handled, it is + # reported as BZ2240205). + for user in module_target_sat.api.User().search( + query={'search': f'login={create_ldap["ldap_user_name"]}'} + ): + user.delete() + role_name = gen_string('alpha') default_org_admin = entities.Role().search(query={'search': 'name="Organization admin"'}) org_admin = entities.Role(id=default_org_admin[0].id).clone(