Skip to content

Commit

Permalink
Workaround nonexistent auth source in upgrade template (#12722)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhellebr authored Sep 27, 2023
1 parent e07ed76 commit 23d49f5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/foreman/api/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down

0 comments on commit 23d49f5

Please sign in to comment.