]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: fail if we find units/tests in failed state
authorFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 12 Jul 2023 13:27:26 +0000 (15:27 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 12 Jul 2023 14:01:05 +0000 (16:01 +0200)
Instead of relying on the post-test /failed file check.

test/units/testsuite-01.sh
test/units/testsuite-02.sh

index 91dd47ca145717d2612746507b62376a7aab7a0f..20744ac9163070b5ce262c472103ce47ee6ac9e1 100755 (executable)
@@ -36,6 +36,7 @@ fi
 
 # Collect failed units & do one daemon-reload to a basic sanity check
 systemctl --state=failed --no-legend --no-pager | tee /failed
+test ! -s /failed
 systemctl daemon-reload
 
 # Check that the early setup is actually skipped on reexec.
index 97700e4439a0e49f403a0f59eb420721432a951e..88e9d72ad1c60b81674797acc08a63938849a518 100755 (executable)
@@ -23,7 +23,7 @@ MAX_QUEUE_SIZE=${NPROC:-2}
 mapfile -t TEST_LIST < <(find /usr/lib/systemd/tests/unit-tests/ -maxdepth 1 -type f -name "${TESTS_GLOB}")
 
 # Reset state
-rm -fv /failed-tests /skipped-tests /skipped
+rm -fv /failed /skipped /testok
 
 if ! systemd-detect-virt -qc; then
     # Make sure ping works for unprivileged users (for test-bpf-firewall)
@@ -112,4 +112,4 @@ set -x
 # Test logs are sometimes lost, as the system shuts down immediately after
 journalctl --sync
 
-exit 0
+test ! -s /failed