From e60076690cc02105d4a6abd9afb6aba5dd70b6bd Mon Sep 17 00:00:00 2001 From: Sergey Orlov Date: Tue, 21 Sep 2021 16:57:59 +0200 Subject: [PATCH] ipatests: check for message in sssd log only during actual test action Get size of the log file immediately before main test action to avoid capturing messages written to log during environment preparation. Fixes https://pagure.io/freeipa/issue/8987 Reviewed-By: Florence Blanc-Renaud --- ipatests/test_integration/test_trust.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ipatests/test_integration/test_trust.py b/ipatests/test_integration/test_trust.py index 207cddb22..a58e27af0 100644 --- a/ipatests/test_integration/test_trust.py +++ b/ipatests/test_integration/test_trust.py @@ -571,9 +571,6 @@ class TestTrust(BaseTestTrust): client = self.clients[0] tasks.backup_file(self.master, paths.SSSD_CONF) - log_file = '{0}/sssd_{1}.log'.format(paths.VAR_LOG_SSSD_DIR, - client.domain.name) - logsize = len(client.get_file_contents(log_file)) res = self.master.run_command(['pidof', 'sssd_be']) pid = res.stdout_text.strip() test_id = 'id testuser@%s' % self.ad_domain @@ -595,6 +592,10 @@ class TestTrust(BaseTestTrust): self.master.run_command(remove_cache) client.run_command(remove_cache) + log_file = '{0}/sssd_{1}.log'.format(paths.VAR_LOG_SSSD_DIR, + client.domain.name) + logsize = len(client.get_file_contents(log_file)) + try: # stop sssd_be, needed to simulate a timeout in the extdom plugin. stop_sssdbe = self.master.run_command('kill -STOP %s' % pid)