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

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