]> Git Repo - J-linux.git/commitdiff
selftests: ksft: Fix finished() helper exit code on skipped tests
authorLaura Nao <[email protected]>
Tue, 30 Jul 2024 10:29:28 +0000 (12:29 +0200)
committerShuah Khan <[email protected]>
Wed, 31 Jul 2024 17:38:56 +0000 (11:38 -0600)
The Python finished() helper currently exits with KSFT_FAIL when there
are only passed and skipped tests. Fix the logic to exit with KSFT_PASS
instead, making it consistent with its C and bash counterparts
(ksft_finished() and ktap_finished() respectively).

Reviewed-by: NĂ­colas F. R. A. Prado <[email protected]>
Fixes: dacf1d7a78bf ("kselftest: Add test to verify probe of devices from discoverable buses")
Signed-off-by: Laura Nao <[email protected]>
Reviewed-by: Muhammad Usama Anjum <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
tools/testing/selftests/kselftest/ksft.py

index cd89fb2bc10e7f3c10a6fbe5eacd66c21bc0779a..bf215790a89d739e0df9bdc111e808d51e385af3 100644 (file)
@@ -70,7 +70,7 @@ def test_result(condition, description=""):
 
 
 def finished():
-    if ksft_cnt["pass"] == ksft_num_tests:
+    if ksft_cnt["pass"] + ksft_cnt["skip"] == ksft_num_tests:
         exit_code = KSFT_PASS
     else:
         exit_code = KSFT_FAIL
This page took 0.072236 seconds and 4 git commands to generate.