]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: forward journal messages to console during sd-bsod tests
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 14 Dec 2023 10:36:52 +0000 (11:36 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 14 Dec 2023 22:08:44 +0000 (23:08 +0100)
Since we nuke the journal multiple times during that, which makes
potential fails undebugable.

test/units/testsuite-04.bsod.sh

index 8f5ff5f35c8b864fbf7375af6cddc24b3e9ce13e..1de446bc124f1e1e86d72a8ad2881fd84675af6e 100755 (executable)
@@ -22,6 +22,9 @@ at_exit() {
         journalctl --flush
     fi
 
+    rm -f /run/systemd/journald.conf.d/99-forward-to-console.conf
+    systemctl restart systemd-journald
+
     return 0
 }
 
@@ -49,7 +52,12 @@ vcs_dump_and_check() {
 # current boot, let's temporarily overmount /var/log/journal with a tmpfs,
 # as we're going to wipe it multiple times, but we need to keep the original
 # journal intact for the other tests to work correctly.
+#
+# Also, since we'll eventually lose the journal from this test, let's temporarily
+# forward everything to console, to make potential fails debug-able.
 trap at_exit EXIT
+mkdir -p /run/systemd/journald.conf.d/
+echo -ne '[Journal]\nForwardToConsole=yes' >/run/systemd/journald.conf.d/99-forward-to-console.conf
 mount -t tmpfs tmpfs /var/log/journal
 systemctl restart systemd-journald