richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
8d419f
From 37b398e2a3d6cd225a3121843540a033f4415b80 Mon Sep 17 00:00:00 2001
8d419f
From: Frantisek Sumsal <frantisek@sumsal.cz>
8d419f
Date: Fri, 17 Jun 2022 17:29:22 +0200
8d419f
Subject: [PATCH] test: check journal directly instead of capturing console
8d419f
 output
8d419f
8d419f
(cherry picked from commit 8cda7b91ff267fc21325d4886980e243389a7566)
8d419f
8d419f
Related: #2087652
8d419f
---
8d419f
 test/TEST-52-HONORFIRSTSHUTDOWN/test.sh | 13 ++++---------
8d419f
 1 file changed, 4 insertions(+), 9 deletions(-)
8d419f
8d419f
diff --git a/test/TEST-52-HONORFIRSTSHUTDOWN/test.sh b/test/TEST-52-HONORFIRSTSHUTDOWN/test.sh
8d419f
index 936e801c51..6a1ec9ca29 100755
8d419f
--- a/test/TEST-52-HONORFIRSTSHUTDOWN/test.sh
8d419f
+++ b/test/TEST-52-HONORFIRSTSHUTDOWN/test.sh
8d419f
@@ -14,15 +14,10 @@ TEST_NO_QEMU=1
8d419f
 # could turn into a reboot if the test fails.
8d419f
 NSPAWN_TIMEOUT=60
8d419f
 
8d419f
-# Remove this file if it exists. This is used along with
8d419f
-# the make target "finish". Since concrete confirmation is
8d419f
-# only found from the console during the poweroff.
8d419f
-rm -f /tmp/honorfirstshutdown.log >/dev/null
8d419f
-
8d419f
 check_result_nspawn_hook() {
8d419f
-    grep -q "Shutdown is already active. Skipping emergency action request" /tmp/honorfirstshutdown.log
8d419f
+    local workspace="${1:?}"
8d419f
+
8d419f
+    "${JOURNALCTL:?}" -D "${workspace:?}/var/log/journal" --grep "Shutdown is already active. Skipping emergency action request" --no-pager
8d419f
 }
8d419f
 
8d419f
-# Note: don't use a pipe in the following expression, as it breaks the trap
8d419f
-#       handlers we have defined in test/test-functions.
8d419f
-do_test "$@" > >(tee /tmp/honorfirstshutdown.log)
8d419f
+do_test "$@"