Merge pull request #30604 from mrc0mmand/test-journal-shenanigans

test: redirect stdout/stderr of TEST-04-JOURNAL to console as well
This commit is contained in:
Yu Watanabe
2023-12-24 03:40:50 +09:00
committed by GitHub
3 changed files with 9 additions and 11 deletions
-8
View File
@@ -22,9 +22,6 @@ at_exit() {
journalctl --flush
fi
rm -f /run/systemd/journald.conf.d/99-forward-to-console.conf
systemctl restart systemd-journald
return 0
}
@@ -52,12 +49,7 @@ 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
-3
View File
@@ -3,9 +3,6 @@
set -eux
set -o pipefail
# Limit the maximum journal size
trap "journalctl --rotate --vacuum-size=20M" EXIT
# shellcheck source=test/units/test-control.sh
. "$(dirname "$0")"/test-control.sh