diff mbox series

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

Message ID 20241209095019.1732120-14-kevin.brodsky@arm.com
State New
Headers show
Series pkeys kselftests improvements | expand

Commit Message

Kevin Brodsky Dec. 9, 2024, 9:50 a.m. UTC
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@arm.com>
---
 tools/testing/selftests/mm/pkey_sighandler_tests.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

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])();