Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: have analyzer request child parse child log #7750

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 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,10 +1079,11 @@ 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
danlavu marked this conversation as resolved.
Show resolved Hide resolved
:description: analyzer request --child argument must search child process logs
:setup:
1. Add user
2. Enable debug_level to 9 in the 'nss', 'pam' and domain section
Expand All @@ -1091,16 +1093,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
3. Succesfully
2. Logs contain login related child logs
3. Successful
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 @@ -1121,9 +1123,7 @@ def test_sssctl__analyze_child_logs(client: Client, ldap: LDAP):
with pytest.raises(SSHAuthenticationError):
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"
assert "Preauthentication failed" in result.stdout, "'Preauthentication failed' was not found!"


@pytest.mark.tools
Expand Down
Loading