TEST-04-JOURNAL: sync journal in test script, and find journal with invocation ID

Hopefully improve the stability of the test.
This commit is contained in:
Yu Watanabe
2025-04-08 06:56:52 +09:00
parent 86d59686b7
commit 9e372b643b
3 changed files with 12 additions and 7 deletions
@@ -3,9 +3,8 @@ Description=Log filtering unit
[Service]
Type=oneshot
ExecStart=sh -c 'echo "Logging from the service, and ~more~ foo bar"'
# If the service finishes extremely fast, journald cannot find the source of the
# stream. Hence, we need to call 'journalctl --sync' before service finishes.
ExecStart=journalctl --sync
ExecStart=sh -c 'echo "Logging from the service, and ~more~ foo bar"; journalctl --sync'
SyslogLevel=notice
LogLevelMax=info