selftests/liveupdate: return KSFT_SKIP when all VM tests are skipped
Subsystems (3)
PATCH 1/1 selftests/liveupdate: return KSFT_SKIP when all VM tests are skipped
When all Live Update VM tests are skipped, run-vmtests.sh reports zero passes and zero failures but exits with status 0. Callers that rely on the exit status can mistake a skipped run for a successful one.
Return KSFT_SKIP (4) when all tests are skipped. Keep returning 1 if any test fails and 0 if at least one test passes and none fail.
--- tools/testing/selftests/liveupdate/run-vmtests.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
tools/testing/selftests/liveupdate/run-vmtests.sh +8 -1
@@ -91,7 +91,14 @@ function main() { echo "Logs: $output_dir" fi - exit $((failed != 0)) + if (( failed > 0 )); then + exit 1 + fi + + if (( passed == 0 && skipped > 0 )); then + exit 4 + fi + } main "$@"
Signature · 1 line
2.53.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 10 lines
When all Live Update VM tests are skipped,
run-vmtests.shreports zero passes and zero failures but exits with status 0. Callers that rely on the exit status can mistake a skipped run for a successful one.Return
KSFT_SKIP(4) when all tests are skipped. Keep returning 1 if any test fails and 0 if at least one test passes and none fail.Fixes 89dd1421c554 ("selftests/liveupdate: add end to end test infrastructure and scripts")Signed-off-by Nevzat Kutay Aydoğdu <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Mike Rapoport
maintainerHi,
Quoted 3 lines · Nevzat Kutay Aydoğdu
When all Live Update VM tests are skipped,
run-vmtests.shreports zero passes and zero failures but exits with status 0. Callers that rely on the exit status can mistake a skipped run for a successful one.
Normally kselftests return 0 even when the skipped all the tests.
Quoted 33 lines
Return
KSFT_SKIP(4) when all tests are skipped. Keep returning 1 if any test fails and 0 if at least one test passes and none fail.Fixes 89dd1421c554 ("selftests/liveupdate: add end to end test infrastructure and scripts")Signed-off-by Nevzat Kutay Aydoğdu <[email protected]>--- tools/testing/selftests/liveupdate/run-vmtests.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)tools/testing/selftests/liveupdate/run-vmtests.sh +8
-1@@ -91,7 +91,14 @@ function main() { echo "Logs: $output_dir" fi - exit $((failed != 0)) + if (( failed > 0 )); then + exit 1 + fi + + if (( passed == 0 && skipped > 0 )); then + exit 4 + fi + } main "$@"Signature · 1 line
2.53.0
Signature · 2 lines
Sincerely yours, Mike.