From 038e4554627c610ae6799d74f9f4bce530d7c283 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 27 Nov 2023 06:26:07 +0900 Subject: [PATCH] test: verify json format passed through varlink This drops logs of failed unit tests in TEST-02-UNITTESTS from the journal, as the expected logs from test-varlink-idl makes the post script fail. Saving logs in journal is simply noisy, and we will output anyway after qemu or nspawn finished by check_result_{qemu,nspawn}_unittests(). --- test/units/end.service | 2 +- test/units/end.sh | 10 ++++++++++ test/units/testsuite-02.sh | 3 --- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100755 test/units/end.sh diff --git a/test/units/end.service b/test/units/end.service index 3626741258a..50a68b9dd49 100644 --- a/test/units/end.service +++ b/test/units/end.service @@ -7,5 +7,5 @@ OnFailureJobMode=replace-irreversibly [Service] Type=oneshot -ExecStart=/bin/sh -x -c 'systemctl poweroff --no-block' +ExecStart=/usr/lib/systemd/tests/testdata/units/end.sh TimeoutStartSec=5m diff --git a/test/units/end.sh b/test/units/end.sh new file mode 100755 index 00000000000..dd50654f8d1 --- /dev/null +++ b/test/units/end.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later + +set -eux +set -o pipefail + +(! journalctl -q -o short-monotonic --grep "didn't pass validation" >>/failed) + +systemctl poweroff --no-block +exit 0 diff --git a/test/units/testsuite-02.sh b/test/units/testsuite-02.sh index 210bfcbad2f..2a3cb08c43c 100755 --- a/test/units/testsuite-02.sh +++ b/test/units/testsuite-02.sh @@ -63,9 +63,6 @@ report_result() { echo "$name OK" echo "$name" >>/testok fi - - systemd-cat echo "--- $name ---" - systemd-cat cat "/$name.log" } set +x -- 2.47.3