Skip to content

Commit 06d5773

Browse files
mrc0mmandbluca
authored andcommitted
test: forward journal messages to console during sd-bsod tests
Since we nuke the journal multiple times during that, which makes potential fails undebugable. (cherry picked from commit 8f7c876)
1 parent 08b18ee commit 06d5773

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/units/testsuite-04.bsod.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ at_exit() {
2222
journalctl --flush
2323
fi
2424

25+
rm -f /run/systemd/journald.conf.d/99-forward-to-console.conf
26+
systemctl restart systemd-journald
27+
2528
return 0
2629
}
2730

@@ -49,7 +52,12 @@ vcs_dump_and_check() {
4952
# current boot, let's temporarily overmount /var/log/journal with a tmpfs,
5053
# as we're going to wipe it multiple times, but we need to keep the original
5154
# journal intact for the other tests to work correctly.
55+
#
56+
# Also, since we'll eventually lose the journal from this test, let's temporarily
57+
# forward everything to console, to make potential fails debug-able.
5258
trap at_exit EXIT
59+
mkdir -p /run/systemd/journald.conf.d/
60+
echo -ne '[Journal]\nForwardToConsole=yes' >/run/systemd/journald.conf.d/99-forward-to-console.conf
5361
mount -t tmpfs tmpfs /var/log/journal
5462
systemctl restart systemd-journald
5563

0 commit comments

Comments
 (0)