Skip to content

Commit

Permalink
test_install: restart services after date change
Browse files Browse the repository at this point in the history
The test TestKRAinstallAfterCertRenew is moving the
date in the future in order to reach the grace period where
certmonger detects some certificates need to be renewed.
Restart the services after the date change.

Fixes: https://pagure.io/freeipa/issue/9405

Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Michal Polovka <mpolovka@redhat.com>
  • Loading branch information
flo-renaud committed Dec 11, 2023
1 parent 53951ca commit 9abb50e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ipatests/test_integration/test_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,8 @@ def test_KRA_install_after_cert_renew(self):
grace_date = cert_expiry - timedelta(days=10)
grace_date = datetime.strftime(grace_date, "%Y-%m-%d %H:%M:%S")
self.master.run_command(['date', '-s', grace_date])
# restart service after date change
self.master.run_command(['ipactl', 'restart'])

# get the count of certs track by certmonger
cmd = self.master.run_command(['getcert', 'list'])
Expand All @@ -1591,6 +1593,8 @@ def test_KRA_install_after_cert_renew(self):
cert_expiry = cert_expiry + timedelta(days=3)
cert_expiry = datetime.strftime(cert_expiry, "%Y-%m-%d %H:%M:%S")
self.master.run_command(['date', '-s', cert_expiry])
# restart service after date change
self.master.run_command(['ipactl', 'restart'])

passwd = "{passwd}\n{passwd}\n{passwd}".format(passwd=admin_pass)
self.master.run_command(['kinit', 'admin'], stdin_text=passwd)
Expand Down

0 comments on commit 9abb50e

Please sign in to comment.