Skip to content

Commit

Permalink
TESTS: test_0017_filesldap is missing staticmethod
Browse files Browse the repository at this point in the history
* @staticmethod is required for this method.
* setup_sssd_krb is added since krb configuration is required for this test.
* The first sssctl can make the pipe number increase (usually +2), so run
the first sssctl before collecting /tmp/before_count.

Reviewed-by: Jakub Vávra <[email protected]>
Reviewed-by: Pavel Březina <[email protected]>
  • Loading branch information
mmatsuya authored and alexey-tikhonov committed Nov 2, 2023
1 parent fbff098 commit 8804a2c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/tests/multihost/alltests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,9 @@ def test_bz822236(multihost, backupsssdconf):
assert all(find_logs_results), "Searched string not found in the logs"
assert all(time_diff), "Test failed as the cache response time is higher."

@staticmethod
@pytest.mark.tier1_2
def test_0017_filesldap(multihost):
def test_0017_filesldap(multihost, backupsssdconf, setup_sssd_krb):
"""
:title: sssd-be tends to run out of system resources,
hitting the maximum number of open files
Expand All @@ -621,12 +622,14 @@ def test_0017_filesldap(multihost):
user = f'foo1@{ds_instance_name}'
check_login_client(multihost, user, "Secret123")
time.sleep(3)
client.run_command('ls -al /proc/$(pidof sssd_be)/fd > /tmp/before_count')
time.sleep(2)
n_log_bfr = count_pattern_logs(multihost, "/tmp/before_count", "pipe:")
client_backup_file(multihost, '/usr/libexec/sssd/krb5_child')
new_child = textwrap.dedent("""#!/bin/bash\nsleep 10 \n""")
client.put_file_contents('/usr/libexec/sssd/krb5_child', new_child)
client.run_command(f"echo 'Secret123'|sssctl user-checks -a auth foo1@{ds_instance_name}")
time.sleep(3)
client.run_command('ls -al /proc/$(pidof sssd_be)/fd > /tmp/before_count')
time.sleep(2)
n_log_bfr = count_pattern_logs(multihost, "/tmp/before_count", "pipe:")
for i in range(10):
client.run_command(f"echo 'Secret123'|sssctl user-checks -a auth foo{i}@{ds_instance_name}")
time.sleep(3)
Expand Down

0 comments on commit 8804a2c

Please sign in to comment.