URL: https://github.com/freeipa/freeipa/pull/5885
Author: flo-renaud
 Title: #5885: ipatests: use whole date when calling journalctl --since
Action: opened

PR body:
"""
The test TestSelfExternalSelf::test_switch_back_to_self_signed
is checking the content of the journal using journalctl --since ...
but provides only the time, not the whole date with year-month-day.
As a consequence, if the test is executed around midnight it may
find nothing in the journal because it's looking for logs after 11:50PM,
which is a date in the future.
Fixes: https://pagure.io/freeipa/issue/8918

Signed-off-by: Florence Blanc-Renaud <[email protected]>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/5885/head:pr5885
git checkout pr5885
From 1c607aea13ca91008be08feaff81def37a4a75c2 Mon Sep 17 00:00:00 2001
From: Florence Blanc-Renaud <[email protected]>
Date: Sun, 11 Jul 2021 16:29:16 +0200
Subject: [PATCH] ipatests: use whole date when calling journalctl --since

The test TestSelfExternalSelf::test_switch_back_to_self_signed
is checking the content of the journal using journalctl --since ...
but provides only the time, not the whole date with year-month-day.
As a consequence, if the test is executed around midnight it may
find nothing in the journal because it's looking for logs after 11:50PM,
which is a date in the future.
Fixes: https://pagure.io/freeipa/issue/8918

Signed-off-by: Florence Blanc-Renaud <[email protected]>
---
 ipatests/test_integration/test_external_ca.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipatests/test_integration/test_external_ca.py b/ipatests/test_integration/test_external_ca.py
index 72aa57a0b87..d48d73deb15 100644
--- a/ipatests/test_integration/test_external_ca.py
+++ b/ipatests/test_integration/test_external_ca.py
@@ -301,7 +301,7 @@ def test_issuerDN_after_renew_to_external(self):
     def test_switch_back_to_self_signed(self):
 
         # for journalctl --since
-        switch_time = time.strftime('%H:%M:%S')
+        switch_time = time.strftime('%Y-%m-%d %H:%M:%S')
         # switch back to self-signed CA
         result = self.master.run_command([paths.IPA_CACERT_MANAGE, 'renew',
                                           '--self-signed'])
_______________________________________________
FreeIPA-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/[email protected]
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to