]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/mm: skip pkey_sighandler_tests if support is missing
authorKevin Brodsky <kevin.brodsky@arm.com>
Mon, 9 Dec 2024 09:50:18 +0000 (09:50 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 14 Jan 2025 06:40:56 +0000 (22:40 -0800)
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 <kevin.brodsky@arm.com>
Cc: Aruna Ramakrishna <aruna.ramakrishna@oracle.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Joey Gouly <joey.gouly@arm.com>
Cc: Keith Lucas <keith.lucas@oracle.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/pkey_sighandler_tests.c

index 63443b75f49e031e3b39fc3c5cc96303b5de1fc2..4f3679d11c05e44c44397ebb23a74c1480c3849c 100644 (file)
@@ -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])();