Skip to content

Commit 74711e7

Browse files
committed
test: fail if we find units/tests in failed state
Instead of relying on the post-test /failed file check.
1 parent 438fcfd commit 74711e7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

test/units/testsuite-01.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ fi
3636

3737
# Collect failed units & do one daemon-reload to a basic sanity check
3838
systemctl --state=failed --no-legend --no-pager | tee /failed
39+
test ! -s /failed
3940
systemctl daemon-reload
4041

4142
# Check that the early setup is actually skipped on reexec.

test/units/testsuite-02.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ MAX_QUEUE_SIZE=${NPROC:-2}
2323
mapfile -t TEST_LIST < <(find /usr/lib/systemd/tests/unit-tests/ -maxdepth 1 -type f -name "${TESTS_GLOB}")
2424

2525
# Reset state
26-
rm -fv /failed-tests /skipped-tests /skipped
26+
rm -fv /failed /skipped /testok
2727

2828
if ! systemd-detect-virt -qc; then
2929
# Make sure ping works for unprivileged users (for test-bpf-firewall)
@@ -112,4 +112,4 @@ set -x
112112
# Test logs are sometimes lost, as the system shuts down immediately after
113113
journalctl --sync
114114

115-
exit 0
115+
test ! -s /failed

0 commit comments

Comments
 (0)