test: fail if we find units/tests in failed state

Instead of relying on the post-test /failed file check.
This commit is contained in:
Frantisek Sumsal 2023-07-12 15:27:26 +02:00
parent 438fcfdf6c
commit 74711e7a09
2 changed files with 3 additions and 2 deletions

View file

@ -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.

View file

@ -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