]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: verify json format passed through varlink 30203/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 26 Nov 2023 21:26:07 +0000 (06:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 27 Nov 2023 19:13:44 +0000 (04:13 +0900)
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
test/units/end.sh [new file with mode: 0755]
test/units/testsuite-02.sh

index 3626741258ae4e032dec24297623ce2246635199..50a68b9dd49d8f00ef34aa4e168b3bf9203398a2 100644 (file)
@@ -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 (executable)
index 0000000..dd50654
--- /dev/null
@@ -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
index 210bfcbad2fd5021acf0d65887c7d95d3339de5b..2a3cb08c43caedc4bc95222adf7238000ebaba99 100755 (executable)
@@ -63,9 +63,6 @@ report_result() {
         echo "$name OK"
         echo "$name" >>/testok
     fi
-
-    systemd-cat echo "--- $name ---"
-    systemd-cat cat "/$name.log"
 }
 
 set +x