From 2eb4cdb64141c9c4001693f672e108beff8d621f Mon Sep 17 00:00:00 2001 From: Mohammad Rizwan Date: Wed, 17 May 2023 11:15:19 +0530 Subject: [PATCH] ipatests: wait for sssd-kcm to settle after date change In order to expire the ACME cert, system is moved and while issuing the kinit command, results into failure. Hence run kinit command repeatedly untill things get settle. This patch removes the sleep and adds tasks.run_repeatedly() method instead. Signed-off-by: Mohammad Rizwan Reviewed-By: Rob Crittenden Reviewed-By: Florence Blanc-Renaud --- ipatests/test_integration/test_acme.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ipatests/test_integration/test_acme.py b/ipatests/test_integration/test_acme.py index 49b173060..6fe98cc7d 100644 --- a/ipatests/test_integration/test_acme.py +++ b/ipatests/test_integration/test_acme.py @@ -602,21 +602,20 @@ def issue_and_expire_acme_cert(): tasks.kdestroy_all(host) tasks.move_date(host, 'stop', '+90days+60minutes') - time.sleep(10) tasks.get_kdcinfo(host) # Note raiseonerr=False: # the assert is located after kdcinfo retrieval. - result = master.run_command( - "KRB5_TRACE=/dev/stdout kinit admin", + # run kinit command repeatedly until sssd gets settle + # after date change + tasks.run_repeatedly( + host, "KRB5_TRACE=/dev/stdout kinit admin", stdin_text='{0}\n{0}\n{0}\n'.format( - master.config.admin_password - ), - raiseonerr=False + host.config.admin_password + ) ) # Retrieve kdc.$REALM after the password change, just in case SSSD # domain status flipped to online during the password change. tasks.get_kdcinfo(host) - assert result.returncode == 0 yield _issue_and_expire_acme_cert