Skip to content

Commit

Permalink
Kerberos/test_login_kerberos.py: removed test_krb_user_ldap_mapping
Browse files Browse the repository at this point in the history
The test was removed for several reasons:
1) The test was never really working. The only reason it was passing was
   because of sssd caching.
2) The test in order to work needs a lot of extra parameters in sssd
   configuration and there is neither the knowledge nor the time to
   invest in learning it.
3) The LDAP mapping is not really used in our days and we believe that
   the case the test is testing is very rare.
  • Loading branch information
GeorgePantelakis committed Feb 5, 2024
1 parent c89754e commit 4e383a9
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions Kerberos/test_login_kerberos.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,31 +182,3 @@ def test_krb_user_su_correct_password(ipa_user, user_shell):
user_shell.sendline("whoami")
user_shell.expect_exact(ipa_user.username)
user_shell.close()


def test_krb_user_ldap_mapping(ipa_user, ipa_server, user_shell, sssd):
"""Test for LDAP mapping of Kerberos user provided by IPA server"""
changes = ({"section": f"domain/{ipa_server.domain}",
"key": "id_provider",
"val": "ldap"},
{"section": f"certmap/{ipa_server.domain}/{ipa_user.username}",
"key": "matchrule",
"val": f"<SUBJECT>.*CN={ipa_user.username}.*"},
{"section": f"certmap/{ipa_server.domain}/{ipa_user.username}",
"key": "maprule",
"val": "(userCertificate;binary={cert!bin})"})
with sssd as conf:
for item in changes:
conf.set(key=item["key"],
value=item["val"],
section=item["section"])
conf.save()

run(["systemctl", "restart", "sssd"], sleep=5)

with Authselect(), ipa_user.card(insert=True):
cmd = f"su {ipa_user.username} -c 'whoami'"
user_shell.sendline(cmd)
user_shell.expect_exact(f"PIN for {ipa_user.username}:")
user_shell.sendline(ipa_user.pin)
user_shell.expect_exact(ipa_user.username)

0 comments on commit 4e383a9

Please sign in to comment.