URL: https://github.com/SSSD/sssd/pull/5952
Author: shridhargadekar
 Title: #5952: Tests: sssctl analyze capture tevent chain ID logic in logs
Action: opened

PR body:
"""
sssctl analyze should capture tevent chain ID in the sssd nss, pam logs,

verifies #5863
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/5952/head:pr5952
git checkout pr5952
From d4c4efbe35ae3c73c049fa6a7b2d112603a518fb Mon Sep 17 00:00:00 2001
From: Shridhar Gadekar <sgade...@sgadekar.pnq.csb>
Date: Tue, 18 Jan 2022 00:04:12 +0530
Subject: [PATCH] Tests: sssctl analyze capture tevent chain ID logic in logs

sssctl analyze should capture tevent chain ID in the logs,
verifies #5863
---
 .../alltests/test_sssctl_analyzer.py          | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/src/tests/multihost/alltests/test_sssctl_analyzer.py b/src/tests/multihost/alltests/test_sssctl_analyzer.py
index 05fdc88bd3..85b9c944be 100644
--- a/src/tests/multihost/alltests/test_sssctl_analyzer.py
+++ b/src/tests/multihost/alltests/test_sssctl_analyzer.py
@@ -181,3 +181,49 @@ def test_analyzer_pam_logs(self, multihost, backupsssdconf):
                     'SSS_PAM_ACCT_MGMT', 'SSS_PAM_SETCRED']
         for pam_auth in pam_cmds:
             assert pam_auth in stdout
+
+    def test_analyze_tevent_id(self, multihost, backupsssdconf):
+        """
+        :title: sssctl analyze to parse tevent chain IDs from logs
+        :id: f748766c-0177-4306-9e7f-816586734e14
+        :description: sssctl analyze should able to parse tevent chain
+         IDs from responder logs
+        :bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1294670
+        :steps:
+        1. Configure sssd to authenticate against directory server
+        2. Enable debug_level to 9 in the 'nss', 'pam' and domain section
+        3. Restart SSSD with cleared cache
+        4. Log in as a user using ssh
+        5. Confirm tevent chain IDs(RID) is showing in logs
+        :expectedresults:
+        1. Should succeed
+        2. Should succeed
+        3. Should succeed
+        4. Should succeed
+        5. Should succeed
+        """
+        tools = sssdTools(multihost.client[0])
+        multihost.client[0].service_sssd('stop')
+        tools.remove_sss_cache('/var/lib/sss/db/')
+        tools.remove_sss_cache('/var/log/sssd/')
+        dm_sec = ['nss', 'pam']
+        sssd_params = {'debug_level': '9'}
+        for sec_op in dm_sec:
+            tools.sssd_conf(sec_op, sssd_params, action='update')
+        multihost.client[0].service_sssd('start')
+        i_cmd = f'id foo1@{ds_instance_name}'
+        multihost.client[0].run_command(i_cmd, raiseonerr=False)
+        user = f'foo1@{ds_instance_name}'
+        client_hostname = multihost.client[0].sys_hostname
+        client = pexpect_ssh(client_hostname, user, 'Secret123',
+                             debug=False)
+        try:
+            client.login()
+        except SSHLoginException:
+            pytest.fail(f"{user} failed to login")
+        else:
+            client.logout()
+        _, stdout = analyzer(multihost, 'show 1')
+        assert 'RID #' in stdout
+        _, stdout = analyzer(multihost, 'show 1 --pam')
+        assert 'RID #' in stdout
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to