[PATCH 13/14] selftests/mm: Skip pkey_sighandler_tests if support is missing

Kevin Brodsky kevin.brodsky at arm.com
Mon Dec 9 01:50:18 PST 2024


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.

Signed-off-by: Kevin Brodsky <kevin.brodsky at arm.com>
---
 tools/testing/selftests/mm/pkey_sighandler_tests.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/mm/pkey_sighandler_tests.c b/tools/testing/selftests/mm/pkey_sighandler_tests.c
index c73cee192b88..449ec5acec75 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])();
 
-- 
2.47.0




More information about the linux-arm-kernel mailing list