URL: https://github.com/SSSD/sssd/pull/5786 Author: jakub-vavra-cz Title: #5786: Tests: [SSSD-3579]: Skip test test_0018_bz1734040. Action: synchronized
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/5786/head:pr5786 git checkout pr5786
From 4d7189316ea7318deb4d1b1202264594afcdd89d Mon Sep 17 00:00:00 2001 From: Jakub Vavra <jva...@redhat.com> Date: Wed, 15 Sep 2021 12:05:28 +0200 Subject: [PATCH] Tests: [SSSD-3579]: Skip log check in test test_0018_bz1734040. The logging changed significantly in RHEL-9, skipping log message check as it no longer works. The test still tests that sssd does not crash on the flow. --- src/tests/multihost/ad/test_adparameters.py | 35 +++++++++++---------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/tests/multihost/ad/test_adparameters.py b/src/tests/multihost/ad/test_adparameters.py index 2967709229..bda7fe338d 100644 --- a/src/tests/multihost/ad/test_adparameters.py +++ b/src/tests/multihost/ad/test_adparameters.py @@ -692,38 +692,41 @@ def test_0017_gssspnego_adjoin(self, multihost): multihost.client[0].run_command(remove_pcap) assert status == 'PASS' + @staticmethod @pytest.mark.tier1 - def test_0018_bz1734040(self, multihost, adjoin): + def test_0018_bz1734040(multihost, adjoin): """ :title: ad_parameters: sssd crash in ad_get_account_domain_search :id: dcca509e-b316-4010-a173-20f541dafd52 :customerscenario: True :bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1734040 """ + distro = multihost.client[0].distro adjoin(membersw='adcli') client = sssdTools(multihost.client[0]) - domain_name = client.get_domain_section_name() client.backup_sssd_conf() client.remove_sss_cache('/var/log/sssd') - sssdcfg = multihost.client[0].get_file_contents(SSSD_DEFAULT_CONF) - sssdcfg = re.sub(b'ad_domain = %s' % domain_name.encode('utf-8'), - b'ad_domain = example.com \ndebug_level = 9', sssdcfg) - multihost.client[0].put_file_contents(SSSD_DEFAULT_CONF, sssdcfg) + domain_name = client.get_domain_section_name() + dom_section = 'domain/%s' % domain_name + sssd_params = {'ad_domain': 'example.com', 'debug_level': '9'} + client.sssd_conf(dom_section, sssd_params) + sssd_params = {'enable_files_domain': 'True', + 'debug_level': '9'} + client.sssd_conf('sssd', sssd_params) client.clear_sssd_cache() cmd = multihost.client[0].run_command('getent passwd 0', raiseonerr=True) - if cmd.returncode != 0: - status = 'FAIL' - else: - status = 'PASS' time.sleep(10) domain_log = '/var/log/sssd/sssd_%s.log' % domain_name log = multihost.client[0].get_file_contents(domain_log).decode('utf-8') - msg = 'Flags\s.0x0001.' + msg = r'AccountDomain.*Flags\s.0x0001.' find = re.compile(r'%s' % msg) - if not find.search(log): - status = 'FAIL' - else: - status = 'PASS' + client.restore_sssd_conf() - assert status == 'PASS' + assert cmd.returncode == 0, "'getent passwd 0' failed!" + if "Red Hat Enterprise Linux" in distro and " 9." in distro: + print("Skipping this part of test as logging changed on RHEL 9.") + # The test is still valid as sssd was crashing on the + # "getent passwd 0" part before. + else: + assert find.search(log), "Expected log record is missing."
_______________________________________________ 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