Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: pidfd: use ksft_test_result_skip() when skipping test

There's planned tests != run tests in pidfd_test when some test is
skipped:

$ ./pidfd_test
TAP version 13
1..8
[...]
# pidfd_send_signal signal recycled pid test: Skipping test
# Planned tests != run tests (8 != 7)
# Totals: pass:7 fail:0 xfail:0 xpass:0 skip:0 error:0

Fix by using ksft_test_result_skip():

$ ./pidfd_test
TAP version 13
1..8
[...]
ok 8 # SKIP pidfd_send_signal signal recycled pid test: Unsharing pid namespace not permitted
# Totals: pass:7 fail:0 xfail:0 xpass:0 skip:1 error:0

Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Tommi Rantala and committed by
Shuah Khan
0b18fed9 ef708634

+1 -1
+1 -1
tools/testing/selftests/pidfd/pidfd_test.c
··· 330 330 ksft_exit_fail_msg("%s test: Failed to recycle pid %d\n", 331 331 test_name, PID_RECYCLE); 332 332 case PIDFD_SKIP: 333 - ksft_print_msg("%s test: Skipping test\n", test_name); 333 + ksft_test_result_skip("%s test: Skipping test\n", test_name); 334 334 ret = 0; 335 335 break; 336 336 case PIDFD_XFAIL: