Blame SOURCES/0008-ipatests-use-whole-date-when-calling-journalctl-sinc_rhbz#1932289.patch

ccffd0
From caf748860860293e010e695d72f6b3b3d8509f8a Mon Sep 17 00:00:00 2001
ccffd0
From: Florence Blanc-Renaud <flo@redhat.com>
ccffd0
Date: Tue, 2 Mar 2021 08:44:35 +0100
ccffd0
Subject: [PATCH] ipatests: use whole date when calling journalctl --since
ccffd0
ccffd0
The test test_commands.py::TestIPACommand::test_ssh_key_connection
ccffd0
is checking the content of the journal using journalctl --since ...
ccffd0
but provides only the time, not the whole date with year-month-day.
ccffd0
As a consequence, if the test is executed around midnight it may
ccffd0
find nothing in the journal because it's looking for logs after 11:50PM,
ccffd0
which is a date in the future.
ccffd0
ccffd0
The fix provides a complete date with year-month-day hours:min:sec.
ccffd0
ccffd0
Fixes: https://pagure.io/freeipa/issue/8728
ccffd0
Reviewed-By: Francois Cami <fcami@redhat.com>
ccffd0
---
ccffd0
 ipatests/test_integration/test_commands.py | 3 ++-
ccffd0
 1 file changed, 2 insertions(+), 1 deletion(-)
ccffd0
ccffd0
diff --git a/ipatests/test_integration/test_commands.py b/ipatests/test_integration/test_commands.py
ccffd0
index 45f642bf2..b7ffb926f 100644
ccffd0
--- a/ipatests/test_integration/test_commands.py
ccffd0
+++ b/ipatests/test_integration/test_commands.py
ccffd0
@@ -642,7 +642,8 @@ class TestIPACommand(IntegrationTest):
ccffd0
         # start to look at logs a bit before "now"
ccffd0
         # https://pagure.io/freeipa/issue/8432
ccffd0
         since = time.strftime(
ccffd0
-            '%H:%M:%S', (datetime.now() - timedelta(seconds=10)).timetuple()
ccffd0
+            '%Y-%m-%d %H:%M:%S',
ccffd0
+            (datetime.now() - timedelta(seconds=10)).timetuple()
ccffd0
         )
ccffd0
 
ccffd0
         tasks.run_ssh_cmd(
ccffd0
-- 
ccffd0
2.29.2
ccffd0