diff --git a/testing/deb-install/test.sh b/testing/deb-install/test.sh index 92997b2..6a78827 100755 --- a/testing/deb-install/test.sh +++ b/testing/deb-install/test.sh @@ -490,4 +490,15 @@ echo "════════════════════════ echo "Results: $PASS passed, $FAIL failed, $SKIP skipped" echo "═══════════════════════════════════════" -[ "$FAIL" -eq 0 ] +# A skip must not read as a pass. Nothing calls skip() today, so SKIP is +# always 0 and this changes no current outcome -- which is exactly why it is +# worth adding now: the helper and the counter already existed and were +# reported, so a later skip path would have printed "N skipped" next to a +# zero exit and looked like coverage. Gate on it before that happens. +if [ "$SKIP" -ne 0 ]; then + echo "FAIL: $SKIP check(s) skipped; a skipped check is not a passed one." >&2 + echo " Either make the check run here, or remove it and record the" >&2 + echo " gap deliberately rather than skipping it at runtime." >&2 +fi + +[ "$FAIL" -eq 0 ] && [ "$SKIP" -eq 0 ] diff --git a/testing/nat/scripts/stun-faults-test.sh b/testing/nat/scripts/stun-faults-test.sh index ca51407..a9d5d22 100755 --- a/testing/nat/scripts/stun-faults-test.sh +++ b/testing/nat/scripts/stun-faults-test.sh @@ -212,6 +212,11 @@ preflight_assert_stun_active() { return 1 } +# Phases that did not run, with the reason. Surfaced in the final verdict: +# the suite reports a pass per phase-level assertion, so a phase that never +# ran otherwise leaves a clean "passed" standing for work not done. +SKIPPED_PHASES=() + run_test() { echo "=== stun-faults-test: setup ===" cleanup @@ -293,6 +298,7 @@ run_test() { sleep 10 else echo " Phase 2 skipped (no tc netem available); proceeding to Phase 3" + SKIPPED_PHASES+=("2 (delay): tc netem unavailable") fi assert_process_alive || { dump_diagnostics; return 1; } @@ -321,7 +327,23 @@ run_test() { } cleanup - echo "stun-faults-test passed" + if [ ${#SKIPPED_PHASES[@]} -eq 0 ]; then + echo "stun-faults-test passed (3/3 phases ran)" + return 0 + fi + # A phase that did not run is not a phase that passed. Say so in the line + # a reader takes the verdict from, rather than leaving it in scrollback + # several hundred lines up where the skip was announced. + local ran=$(( 3 - ${#SKIPPED_PHASES[@]} )) + echo "stun-faults-test passed ($ran/3 phases ran, ${#SKIPPED_PHASES[@]} skipped)" + local phase + for phase in "${SKIPPED_PHASES[@]}"; do + echo " SKIPPED phase $phase" + done + if [ "$ran" -eq 0 ]; then + echo "stun-faults-test: every phase was skipped, so nothing was tested" >&2 + return 1 + fi } main() {