]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-17-UDEV: rotate journal before checking
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 13 Aug 2025 03:03:03 +0000 (12:03 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 13 Aug 2025 08:36:35 +0000 (09:36 +0100)
Otherwise, journal files may be rotated during checking journal entries
and the main system journal file may not be loaded:
```
[  350.372652] TEST-17-UDEV.sh[5841]: + test b253:2 = b253:2
[  350.373288] TEST-17-UDEV.sh[5841]: + [[ 1 == \1 ]]
[  350.373722] TEST-17-UDEV.sh[5841]: + journalctl -n 1 -q -u systemd-udevd.service --invocation=0 --grep 'Found inotify watch .*457'
[  350.374534] TEST-17-UDEV.sh[5970]: Journal file /run/log/journal/edc1fb58daff00ad89d6c8d9689bf172/system.journal is truncated, ignoring file.
[  350.375415] TEST-17-UDEV.sh[415]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/TEST-17-UDEV.watch.sh failed'
```

Fixes #38559.

test/units/TEST-17-UDEV.watch.sh

index 96a67f4c5652b509307c9ac2f84f7965e4cd04f9..cc7f78bbbea6db0023abd1204014cb009f2e058f 100755 (executable)
@@ -24,6 +24,9 @@ function check_validity() {
 
 function check() {
     for _ in {1..2}; do
+        # To make journal not rotated during checking journals below.
+        journalctl --rotate
+
         systemctl reset-failed systemd-udevd.service
         systemctl restart systemd-udevd.service
         udevadm settle --timeout=30