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

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