test: suppress logs generated by journal tests

Note, journal_file_dump() is only used by tests.

Closes #33035.
This commit is contained in:
Yu Watanabe
2024-05-28 10:38:53 +02:00
committed by Daan De Meyer
parent 61fdb5b214
commit 36c5035f2a
2 changed files with 24 additions and 14 deletions
+11 -1
View File
@@ -42,10 +42,20 @@ run_test() {
local test="$1"
local name="${test##*/}"
local environment=
echo "Executing test $name as unit $name.service"
systemd-run --quiet --property Delegate=1 --unit="$name" --wait "$test" && ret=0 || ret=$?
case "$name" in
test-journal-flush)
environment="SYSTEMD_LOG_LEVEL=info"
;;
test-journal-verify)
environment="SYSTEMD_LOG_LEVEL=crit"
;;
esac
systemd-run --quiet --property Delegate=1 --property "Environment=$environment" --unit="$name" --wait "$test" && ret=0 || ret=$?
exec {LOCK_FD}> /lock
flock --exclusive ${LOCK_FD}