Skip to content

Commit

Permalink
tests: have analyzer request child parse child log
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-stephenson committed Dec 5, 2024
1 parent a406c1b commit a7c7d51
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/tests/system/tests/test_sssctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from pytest_mh.conn import ProcessError
from pytest_mh.conn.ssh import SSHAuthenticationError
from sssd_test_framework.roles.client import Client
from sssd_test_framework.roles.ipa import IPA
from sssd_test_framework.roles.ldap import LDAP
from sssd_test_framework.topology import KnownTopology

Expand Down Expand Up @@ -1078,8 +1079,8 @@ def test_sssctl__analyze_tevent_id(client: Client, ldap: LDAP):

@pytest.mark.tools
@pytest.mark.ticket(bz=2013260)
@pytest.mark.topology(KnownTopology.LDAP)
def test_sssctl__analyze_child_logs(client: Client, ldap: LDAP):
@pytest.mark.topology(KnownTopology.IPA)
def test_sssctl__analyze_child_logs(client: Client, ipa: IPA):
"""
:title: "sssctl analyze" to parse child logs
:setup:
Expand All @@ -1091,16 +1092,16 @@ def test_sssctl__analyze_child_logs(client: Client, ldap: LDAP):
2. Call sssctl analyze to check logs
3. Clear cache and restart SSSD
4. Log in as user via ssh with wrong password
5. Call sssctl analyze to check logs
5. Call sssctl analyze to check child logs
:expectedresults:
1. Logged in successfully
2. Logs contain login related logs
2. Logs contain login related child logs
3. Succesfully
4. Failed to login
5. Logs contain info about failed login
5. Child (krb5) Logs contain info about failed login
:customerscenario: True
"""
ldap.user("user1").add()
ipa.user("user1").add()
client.sssd.nss["debug_level"] = "9"
client.sssd.pam["debug_level"] = "9"
client.sssd.domain["debug_level"] = "9"
Expand All @@ -1122,8 +1123,8 @@ def test_sssctl__analyze_child_logs(client: Client, ldap: LDAP):
client.ssh("user1", "Wrong").connect()
result = client.sssctl.analyze_request("show --pam --child 1")
assert (
"Authentication failure to the client" in result.stdout
), "'Authentication failure to the client' was not found"
"Preauthentication failed" in result.stdout
), "'Preauthentication failed' was not found"


@pytest.mark.tools
Expand Down

0 comments on commit a7c7d51

Please sign in to comment.