selftests: ksft: Fix finished() helper exit code on skipped tests
PATCH v2 1/1 selftests: ksft: Fix finished() helper exit code on skipped tests
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).
---
This is a revised version of the patch initially submitted as "[PATCH]
selftests: ksft: Track skipped tests when finishing the test suite":
https://lore.kernel.org/all/[email protected]/
Depends on "[PATCH v2 2/3] kselftest: Move ksft helper module to common directory":
https://lore.kernel.org/all/[email protected]/
(picked through the usb tree, queued for 6.11-rc1)
Changes in v2:
- Reworded the commit title and message to more accurately describe the incorrect behavior of the finished() helper addressed by the patch.
--- tools/testing/selftests/kselftest/ksft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kselftest/ksft.py +1 -1
@@ -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
Signature · 1 line
2.30.2
Quoted 8 lines · Laura Nao
The Python
finished()helper currently exits withKSFT_FAILwhen there are only passed and skipped tests. Fix the logic to exit withKSFT_PASSinstead, making it consistent with its C and bash counterparts (ksft_finished()andktap_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]>
Quoted 22 lines
---
This is a revised version of the patch initially submitted as "[PATCH]
selftests: ksft: Track skipped tests when finishing the test suite":
https://lore.kernel.org/all/[email protected]/Depends on "[PATCH v2 2/3] kselftest: Move ksft helper module to common directory":
https://lore.kernel.org/all/[email protected]/
(picked through the usb tree, queued for 6.11-rc1)Changes in v2:
- Reworded the commit title and message to more accurately describe the incorrect behavior of thefinished()helper addressed by the patch.--- tools/testing/selftests/kselftest/ksft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/kselftest/ksft.py +0
-0
tools/testing/selftests/kselftest/ksft.py def test_result(condition, description=""): · line 73
Quoted 5 lines
tools/testing/selftests/kselftest/ksft.py +1
-1@@ -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:
LGTM
Quoted 3 lines
tools/testing/selftests/kselftest/ksft.py +0
-0exit_code = KSFT_PASS else: exit_code = KSFT_FAIL
Signature · 2 lines
BR, Muhammad Usama Anjum
Shuah Khan
maintainerQuoted 6 lines · Muhammad Usama Anjum
Quoted 5 lines · Laura Nao
The Python
finished()helper currently exits withKSFT_FAILwhen there are only passed and skipped tests. Fix the logic to exit withKSFT_PASSinstead, making it consistent with its C and bash counterparts (ksft_finished()andktap_finished()respectively).
Quoted 18 lines
Quoted 3 lines
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]>Quoted 13 lines
---
This is a revised version of the patch initially submitted as "[PATCH]
selftests: ksft: Track skipped tests when finishing the test suite":
https://lore.kernel.org/all/[email protected]/Depends on "[PATCH v2 2/3] kselftest: Move ksft helper module to common directory":
https://lore.kernel.org/all/[email protected]/
(picked through the usb tree, queued for 6.11-rc1)Changes in v2:
- Reworded the commit title and message to more accurately describe the incorrect behavior of thefinished()helper addressed by the patch.
Thank you - Applied to linux-kselftest fixes for Linux 6.11-rc2
thanks,
-- Shuah