From 8525de13651362800a94849e03386e40c41d9404 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 26 Sep 2023 11:44:28 +0200 Subject: [PATCH] test: extend some existing tests with varlinkctl lines, to test varlinkctl + new PCRExtend service --- test/units/testsuite-04.journal.sh | 7 ++++++- test/units/testsuite-46.sh | 8 ++++++++ test/units/testsuite-70.sh | 11 ++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/test/units/testsuite-04.journal.sh b/test/units/testsuite-04.journal.sh index 1e105a05664..3efac616e08 100755 --- a/test/units/testsuite-04.journal.sh +++ b/test/units/testsuite-04.journal.sh @@ -10,8 +10,12 @@ for ((i = 0; i < ITERATIONS; i++)); do dd if=/dev/urandom bs=1M count=1 | base64 | systemd-cat done journalctl --rotate +# Let's test varlinkctl a bit, i.e. implement the equivalent of 'journalctl --rotate' via varlinkctl +varlinkctl call /run/systemd/journal/io.systemd.journal io.systemd.Journal.Rotate '{}' journalctl --flush +varlinkctl call /run/systemd/journal/io.systemd.journal io.systemd.Journal.FlushToVar '{}' journalctl --sync +varlinkctl call /run/systemd/journal/io.systemd.journal io.systemd.Journal.Synchronize '{}' journalctl --rotate --vacuum-size=8M # Reset the ratelimit buckets for the subsequent tests below. @@ -42,7 +46,8 @@ write_and_match "<5> \t Leading spaces\n" " \t Leading spaces\n" --level-prefix # --output-fields restricts output ID="$(systemd-id128 new)" echo -ne "foo" | systemd-cat -t "$ID" --level-prefix false -journalctl --sync +# Let's test varlinkctl a bit, i.e. implement the equivalent of 'journalctl --sync' via varlinkctl +varlinkctl call /run/systemd/journal/io.systemd.journal io.systemd.Journal.Synchronize '{}' journalctl -b -o export --output-fields=MESSAGE,FOO --output-fields=PRIORITY,MESSAGE -t "$ID" >/tmp/output [[ $(wc -l /run/systemd/system/systemd-pcrextend.socket.d/50-no-condition.conf <