[PATCH 02/18] selftests/liveupdate: Exit with KSFT_SKIP when vmtest.sh skips a test
From: David Matlack
Date: Tue Dec 01 2026 - 19:40:15 EST
Exit vmtest.sh with KSFT_SKIP when a test is skipped, so that
run-vmtests.sh reports it as skipped rather than passed.
skip() exits with KSFT_SKIP, but the EXIT trap then calls
ktap_finished(), which exits with KSFT_PASS since every planned test
either passed or was skipped.
Signed-off-by: David Matlack <dmatlack@xxxxxxxxxx>
---
tools/testing/selftests/liveupdate/vmtest.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/testing/selftests/liveupdate/vmtest.sh b/tools/testing/selftests/liveupdate/vmtest.sh
index 70a8d978077a..6cbee44cd27e 100755
--- a/tools/testing/selftests/liveupdate/vmtest.sh
+++ b/tools/testing/selftests/liveupdate/vmtest.sh
@@ -50,12 +50,20 @@ EOF
}
function cleanup() {
+ local exit_code=$?
+
if [ "$KEEP_WORKSPACE" -eq 1 ]; then
echo "# Workspace preserved at: $workspace_dir"
else
rm -fr "$workspace_dir"
fi
+ # ktap_finished() exits with KSFT_PASS for skipped tests
+ if [ "$exit_code" -eq "$KSFT_SKIP" ]; then
+ ktap_print_totals
+ exit "$KSFT_SKIP"
+ fi
+
ktap_finished
}
--
2.56.1.911.g883d8bcb20-goog