Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Fix test_008_wildcardsearch for RHEL10 #7821

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 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,11 @@ 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 +454,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
Loading