From 5edb35ef7ac765a62653af3f7583e2523c6821a6 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 26 Nov 2023 09:25:22 +0900 Subject: [PATCH] test: check journal files are not corrupted after soft-reboot --- test/units/testsuite-82.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/units/testsuite-82.sh b/test/units/testsuite-82.sh index e0f9573f541..b5e6dedfed5 100755 --- a/test/units/testsuite-82.sh +++ b/test/units/testsuite-82.sh @@ -3,6 +3,9 @@ set -ex set -o pipefail +# shellcheck source=test/units/util.sh +. "$(dirname "$0")"/util.sh + at_exit() { # Since the soft-reboot drops the enqueued end.service, we won't shutdown # the test VM if the test fails and have to wait for the watchdog to kill @@ -39,6 +42,10 @@ if [ -f /run/testsuite82.touch3 ]; then test "$(systemctl show -P ActiveState testsuite-82-nosurvive-sigterm.service)" != "active" test "$(systemctl show -P ActiveState testsuite-82-nosurvive.service)" != "active" + # Check journals + journalctl -o short-monotonic --no-hostname --grep '(will soft-reboot|KILL|corrupt)' + assert_eq "$(journalctl -q -o short-monotonic -u systemd-journald.service --grep 'corrupt')" "" + # All succeeded, exit cleanly now elif [ -f /run/testsuite82.touch2 ]; then -- 2.47.3