From: Kevin Brodsky Date: Mon, 9 Dec 2024 09:50:18 +0000 (+0000) Subject: selftests/mm: skip pkey_sighandler_tests if support is missing X-Git-Tag: microblaze-v6.16~78^2~212 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=1c6b1d4889d72a705c9f60f9916ebabbcfe25d30;p=linux-2.6-microblaze.git selftests/mm: skip pkey_sighandler_tests if support is missing The pkey_sighandler_tests are bound to fail if either the kernel or CPU doesn't support pkeys. Skip the tests if pkeys support is missing. Link: https://lkml.kernel.org/r/20241209095019.1732120-14-kevin.brodsky@arm.com Signed-off-by: Kevin Brodsky Cc: Aruna Ramakrishna Cc: Catalin Marinas Cc: Dave Hansen Cc: Joey Gouly Cc: Keith Lucas Cc: Ryan Roberts Cc: Shuah Khan Signed-off-by: Andrew Morton --- diff --git a/tools/testing/selftests/mm/pkey_sighandler_tests.c b/tools/testing/selftests/mm/pkey_sighandler_tests.c index 63443b75f49e..4f3679d11c05 100644 --- a/tools/testing/selftests/mm/pkey_sighandler_tests.c +++ b/tools/testing/selftests/mm/pkey_sighandler_tests.c @@ -535,6 +535,9 @@ int main(int argc, char *argv[]) ksft_print_header(); ksft_set_plan(ARRAY_SIZE(pkey_tests)); + if (!is_pkeys_supported()) + ksft_exit_skip("pkeys not supported\n"); + for (i = 0; i < ARRAY_SIZE(pkey_tests); i++) (*pkey_tests[i])();