diff --git a/src/tests/multihost/alltests/test_automount.py b/src/tests/multihost/alltests/test_automount.py index 95721f2c15..27699c03df 100644 --- a/src/tests/multihost/alltests/test_automount.py +++ b/src/tests/multihost/alltests/test_automount.py @@ -427,12 +427,8 @@ def test_008_wildcardsearch(self, multihost, indirect_nismaps, :expectedresults: 1. Verify sssd doesn't use (cn=*)(objectclass=nisObject) """ - auto_pcapfile = '/tmp/automount.pcap' - ldap_host = multihost.master[0].sys_hostname - tcpdump_cmd = 'tcpdump -s0 host %s -w %s' % (ldap_host, auto_pcapfile) - multihost.client[0].run_command(tcpdump_cmd, bg=True) - # pid_cmd = 'pidof tcpdump' - # pid = multihost.client[0].run_command(pid_cmd, raiseonerr=False) + client = sssdTools(multihost.client[0]) + domain_name = client.get_domain_section_name() for service in ['sssd', 'autofs']: restart = 'systemctl restart %s' % service cmd = multihost.client[0].run_command(restart, raiseonerr=False) @@ -447,27 +443,14 @@ def test_008_wildcardsearch(self, multihost, indirect_nismaps, if cmd.returncode != 0: count += 1 assert count == 0 - kill_cmd = 'pkill tcpdump' - multihost.client[0].run_command(kill_cmd) - # get the pcap file in text format - conv_text = 'tshark -r %s -R ldap.filter'\ - ' -V -2 > /tmp/automount.txt' % (auto_pcapfile) - multihost.client[0].run_command(conv_text, raiseonerr=False) # get the file - multihost.client[0].transport.get_file('/tmp/automount.txt', - '/tmp/automount.txt') - with open('/tmp/automount.txt', 'r') as outfile: - tcpdump_ascii = outfile.read() + tcpdump_ascii = multihost.client[0].get_file_contents(f'/var/log/sssd/sssd_{domain_name}.log').decode('utf-8') for i in range(1, 10): key = 'foo%d' % i ldap_filter = r'\(\&\(cn=%s\)\(objectclass=nisObject\)\)' % key log_1 = re.compile(r'%s' % (ldap_filter)) assert log_1.search(tcpdump_ascii) - # delete the pcap file - del_pcap = 'rm -f %s' % auto_pcapfile - multihost.client[0].run_command(del_pcap) - @pytest.mark.parametrize('add_nisobject', ['/export'], indirect=True) @pytest.mark.tier2 def test_009_maps_after_coming_online(self, multihost, add_nisobject):