URL: https://github.com/SSSD/sssd/pull/5730
Author: aborah-sudo
 Title: #5730: Tests: SSSD logs improvements: clarify which config option 
applies to…
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/5730/head:pr5730
git checkout pr5730
From 7449129404e980b00b95ea0a96a6fb18d600891e Mon Sep 17 00:00:00 2001
From: Anuj Borah <abo...@redhat.com>
Date: Fri, 30 Jul 2021 10:12:00 +0530
Subject: [PATCH] Tests: SSSD logs improvements: clarify which config option
 applies to each timeout in the logs

issue: https://github.com/SSSD/sssd/issues/5514

bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1928648
---
 src/tests/multihost/alltests/test_offline.py | 62 ++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/src/tests/multihost/alltests/test_offline.py b/src/tests/multihost/alltests/test_offline.py
index a61b6d9600..92b124c6d9 100644
--- a/src/tests/multihost/alltests/test_offline.py
+++ b/src/tests/multihost/alltests/test_offline.py
@@ -9,6 +9,7 @@
 import time
 import pytest
 from sssd.testlib.common.utils import sssdTools
+from sssd.testlib.common.expect import pexpect_ssh
 from constants import ds_instance_name
 
 
@@ -54,3 +55,64 @@ def test_0001_bz1416150(self, multihost, backupsssdconf):
             assert 'Backend is offline' in result
         else:
             pytest.fail("Failed to start sssd")
+
+    @pytest.mark.tier1_2
+    def test_0002_bz1928648(self, multihost, backupsssdconf):
+        """
+        :title: clarify which config option applies to each timeout in the logs
+        :bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1928648
+        :customerscenario: true
+        :id: b6c3a1e4-f0ee-11eb-9718-845cf3eff344
+        :steps:
+          1. Login into server running sssd service.
+          2. Configure SSSD with only 1  id_provider.
+          3. Block "id_provider" using "iptables" command.
+          4. Step 6 should fail and similar messages
+            should be observed in log file (/var/log/sssd/sssd_<domainname>.log).
+          5. The log snip should contain following timeout parameters.
+            - ldap_opt_timeout
+            - ldap_search_timeout
+            - ldap_network_timeout
+            - dns_resolver_timeout
+        :expectedresults:
+          1. Should succeed
+          2. Should succeed
+          3. Should succeed
+          4. Should succeed
+          5. Should succeed
+        """
+        multihost.client[0].run_command("> /var/log/sssd/sssd_example1.log")
+        multihost.client[0].service_sssd('restart')
+        time.sleep(30)
+        it_cat = "cat /var/log/sssd/sssd_example1.log"
+        cat_read = multihost.client[0].run_command(it_cat)
+        for i in ['Setting 6 seconds timeout', "ldap_network_timeout"]:
+            assert i in cat_read.stdout_text
+        find_id = multihost.client[0].run_command("id foo1@example1")
+        assert find_id.returncode == 0
+        hostname = multihost.master[0].external_hostname
+        block_ip = multihost.client[0].run_command(f'iptables'
+                                                   f' -I OUTPUT '
+                                                   f'-d {hostname}'
+                                                   f' -j DROP')
+        assert block_ip.returncode == 0
+        user = 'foo1@example1'
+        client_hostname = multihost.client[0].sys_hostname
+        client = pexpect_ssh(client_hostname, user, 'Secret123',
+                             debug=False)
+        with pytest.raises(Exception):
+            client.login(login_timeout=5,
+                         sync_multiplier=1,
+                         auto_prompt_reset=False)
+        allow_ip = multihost.client[0].run_command(f'iptables '
+                                                   f'-I OUTPUT '
+                                                   f'-d {hostname} '
+                                                   f'-j ACCEPT')
+        assert allow_ip.returncode == 0
+        it_cat = "cat /var/log/sssd/sssd_example1.log"
+        cat_read = multihost.client[0].run_command(it_cat)
+        for i in ['ldap_opt_timeout',
+                  'ldap_search_timeout',
+                  'ldap_network_timeout',
+                  'dns_resolver_timeout']:
+            assert i in cat_read.stdout_text
_______________________________________________
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