]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-87-AUX-UTILS-VM: rotate journal at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 4 Sep 2025 05:19:40 +0000 (14:19 +0900)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 4 Sep 2025 06:39:39 +0000 (08:39 +0200)
Follow-ups for ab56a96194d102cb4ec279fc4eb181d16c1251ea.

Fixes the following failure:
```
TEST-87-AUX-UTILS-VM.sh[1196]: + systemd-run --user --wait --pipe -M testuser@.host -- coredumpctl
TEST-87-AUX-UTILS-VM.sh[1840]: Running as unit: run-p1840-i1841.service; invocation ID: 325a026377aa4cffb046c5a63a8906ab
TEST-87-AUX-UTILS-VM.sh[1853]: Hint: You are currently not seeing messages from other users and the system.
TEST-87-AUX-UTILS-VM.sh[1853]:       Users in groups 'adm', 'systemd-journal', 'wheel' can see all messages.
TEST-87-AUX-UTILS-VM.sh[1853]:       Pass -q to turn off this notice.
TEST-87-AUX-UTILS-VM.sh[1853]: Journal file /var/log/journal/6835d335b6684b6197bf071ad66f2678/user-4711.journal is truncated, ignoring file.
TEST-87-AUX-UTILS-VM.sh[1853]: No coredumps found.
TEST-87-AUX-UTILS-VM.sh[1840]:           Finished with result: exit-code
TEST-87-AUX-UTILS-VM.sh[1840]: Main processes terminated with: code=exited, status=1/FAILURE
TEST-87-AUX-UTILS-VM.sh[1840]:                Service runtime: 154ms
TEST-87-AUX-UTILS-VM.sh[1840]:              CPU time consumed: 78ms
TEST-87-AUX-UTILS-VM.sh[1840]:                    Memory peak: 21.9M (swap: 0B)
```

test/units/TEST-87-AUX-UTILS-VM.coredump.sh

index 23be2c44a345f3ed28239a231b0d3c3106e1aa21..97911e70d8426fe8885031e0750915d978e8f4b2 100755 (executable)
@@ -177,6 +177,10 @@ rm -fv /run/systemd/coredump.conf.d/99-external.conf
 # Wait a bit for the coredumps to get processed
 timeout 30 bash -c "while [[ \$(coredumpctl list -q --no-legend $CORE_TEST_UNPRIV_BIN | wc -l) -lt 4 ]]; do sleep 1; done"
 
+# Sync and rotate journal again to make the coredump stored in an archived journal.
+journalctl --sync
+journalctl --rotate
+
 # root should see coredumps from both binaries
 coredumpctl info "$CORE_TEST_UNPRIV_BIN"
 coredumpctl info "${CORE_TEST_UNPRIV_BIN##*/}"