Skip to content

Commit

Permalink
Tests: Fix test_008_wildcardsearch for RHEL10
Browse files Browse the repository at this point in the history
tshark -r /tmp/automount.pcap -R ldap.filter  ---> Provides empty result for RHEL10 making this test absolute.
  • Loading branch information
aborah-sudo committed Feb 5, 2025
1 parent 36b1d97 commit d8a03a6
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/tests/multihost/alltests/test_automount.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import subprocess
import time
import pytest
from constants import ds_instance_name
from sssd.testlib.common.utils import sssdTools, LdapOperations

JOURNALCTL_CMD = "journalctl -x -n 50 --no-pager"
Expand Down Expand Up @@ -433,6 +434,12 @@ def test_008_wildcardsearch(self, multihost, indirect_nismaps,
multihost.client[0].run_command(tcpdump_cmd, bg=True)
# pid_cmd = 'pidof tcpdump'
# pid = multihost.client[0].run_command(pid_cmd, raiseonerr=False)
tools = sssdTools(multihost.client[0])
# 'sssd_be' talks to LDAP server via network, to make it human read able
# SSSD needs to set ldap_id_use_start_tls
ldap_params = {'ldap_id_use_start_tls': False}
tools.sssd_conf('domain/%s' % (ds_instance_name), ldap_params)

for service in ['sssd', 'autofs']:
restart = 'systemctl restart %s' % service
cmd = multihost.client[0].run_command(restart, raiseonerr=False)
Expand All @@ -448,16 +455,12 @@ def test_008_wildcardsearch(self, multihost, indirect_nismaps,
count += 1
assert count == 0
kill_cmd = 'pkill tcpdump'
multihost.client[0].run_command(kill_cmd)
multihost.client[0].run_command(kill_cmd, raiseonerr=False)
# get the pcap file in text format
conv_text = 'tshark -r %s -R ldap.filter'\
' -V -2 > /tmp/automount.txt' % (auto_pcapfile)
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'/tmp/automount.txt').decode('utf-8')
for i in range(1, 10):
key = 'foo%d' % i
ldap_filter = r'\(\&\(cn=%s\)\(objectclass=nisObject\)\)' % key
Expand Down

0 comments on commit d8a03a6

Please sign in to comment.