test: check journal files are not corrupted after soft-reboot
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 26 Nov 2023 00:25:22 +0000 (09:25 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 28 Nov 2023 09:28:18 +0000 (18:28 +0900)
test/units/testsuite-82.sh

index e0f9573..b5e6ded 100755 (executable)
@@ -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