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

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