selftests: avoid using SKIP(exit()) in harness fixure setup
authorJakub Kicinski <kuba@kernel.org>
Mon, 4 Mar 2024 23:36:20 +0000 (15:36 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 6 Mar 2024 03:25:36 +0000 (19:25 -0800)
commite3350ba4a5b7573d4e14ee1dff8c414646435a04
treead05234d59ce057a59f94105729c044efa6b24d8
parent6d0f77a0e3eec7a23a48297901cc4e4a89649cb6
selftests: avoid using SKIP(exit()) in harness fixure setup

selftest harness uses various exit codes to signal test
results. Avoid calling exit() directly, otherwise tests
may get broken by harness refactoring (like the commit
under Fixes). SKIP() will instruct the harness that the
test shouldn't run, it used to not be the case, but that
has been fixed. So just return, no need to exit.

Note that for hmm-tests this actually changes the result
from pass to skip. Which seems fair, the test is skipped,
after all.

Reported-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/all/05f7bf89-04a5-4b65-bf59-c19456aeb1f0@sirena.org.uk
Fixes: a724707976b0 ("selftests: kselftest_harness: use KSFT_* exit codes")
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Tested-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Link: https://lore.kernel.org/r/20240304233621.646054-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/alsa/test-pcmtest-driver.c
tools/testing/selftests/mm/hmm-tests.c