diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2022-10-31 12:11:59 +0100 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2022-10-31 12:11:59 +0100 |
commit | ca46781c5ffa3aaa7a8fb6f09976357d003c4aae (patch) | |
tree | 87d5f3ff5a773e9120e40e01524b90d945fd8175 /test/units | |
parent | 0e523432aa0c6531203c5d9b6fe220a19df6b99b (diff) | |
download | systemd-ca46781c5ffa3aaa7a8fb6f09976357d003c4aae.tar.gz |
test: add a couple of sanity tests for journalctl
Diffstat (limited to 'test/units')
-rwxr-xr-x | test/units/testsuite-04.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/units/testsuite-04.sh b/test/units/testsuite-04.sh index b5468cbea4..fdc3273fea 100755 --- a/test/units/testsuite-04.sh +++ b/test/units/testsuite-04.sh @@ -119,6 +119,44 @@ systemctl start silent-success journalctl --sync [[ -z "$(journalctl -b -q -u silent-success.service)" ]] +# Exercise the matching machinery +SYSTEMD_LOG_LEVEL=debug journalctl -b -n 1 /dev/null /dev/zero /dev/null /dev/null /dev/null +journalctl -b -n 1 /bin/true /bin/false +journalctl -b -n 1 /bin/true + /bin/false +journalctl -b -n 1 -r --unit "systemd*" + +systemd-run --user -M "testuser@.host" /bin/echo hello +journalctl --sync +journalctl -b -n 1 -r --user-unit "*" + +(! journalctl -b /dev/lets-hope-this-doesnt-exist) +(! journalctl -b /dev/null /dev/zero /dev/this-also-shouldnt-exist) +(! journalctl -b --unit "this-unit-should-not-exist*") + +# Facilities & priorities +journalctl --facility help +journalctl --facility kern -n 1 +journalctl --facility syslog --priority 0..3 -n 1 +journalctl --facility syslog --priority 3..0 -n 1 +journalctl --facility user --priority 0..0 -n 1 +journalctl --facility daemon --priority warning -n 1 +journalctl --facility daemon --priority warning..info -n 1 +journalctl --facility daemon --priority notice..crit -n 1 +journalctl --facility daemon --priority 5..crit -n 1 + +(! journalctl --facility hopefully-an-unknown-facility) +(! journalctl --priority hello-world) +(! journalctl --priority 0..128) +(! journalctl --priority 0..systemd) + +# Other options +journalctl --disk-usage +journalctl --dmesg -n 1 +journalctl --fields +journalctl --list-boots +journalctl --update-catalog +journalctl --list-catalog + # Add new tests before here, the journald restarts below # may make tests flappy. |