]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
kselftest: make callers of ksft_exit_skip() output the reason for skipping
authorPaul Elder <paul.elder@pitt.edu>
Thu, 15 Jun 2017 15:54:22 +0000 (00:54 +0900)
committerShuah Khan <shuahkh@osg.samsung.com>
Fri, 16 Jun 2017 00:10:29 +0000 (18:10 -0600)
Make the three tests that did use the old ksft_ext_skip()
(breakpoints/breakpoint_test_arm64, breakpoints/step_after_suspend_test,
and membarrier_test) use the new one, with an output for the
reason for skipping all the tests.

Signed-off-by: Paul Elder <paul.elder@pitt.edu>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
tools/testing/selftests/breakpoints/step_after_suspend_test.c
tools/testing/selftests/membarrier/membarrier_test.c

index 3897e996541e5d061c07e4b292e7368544fbc1ee..fa6d57af5217a46c447b56ce1638d735eec5d966 100644 (file)
@@ -101,9 +101,8 @@ static bool set_watchpoint(pid_t pid, int size, int wp)
                return true;
 
        if (errno == EIO) {
-               printf("ptrace(PTRACE_SETREGSET, NT_ARM_HW_WATCH) "
+               ksft_exit_skip("ptrace(PTRACE_SETREGSET, NT_ARM_HW_WATCH) "
                        "not supported on this hardware\n");
-               ksft_exit_skip();
        }
        perror("ptrace(PTRACE_SETREGSET, NT_ARM_HW_WATCH) failed");
        return false;
index bf37c1087f25f9cfb109d8b048654635ead7bcdb..c60c2effb6bc99cafb808a523628d16f0917c060 100644 (file)
@@ -83,8 +83,8 @@ bool run_test(int cpu)
 
        if (ptrace(PTRACE_SINGLESTEP, pid, NULL, NULL) < 0) {
                if (errno == EIO) {
-                       printf("ptrace(PTRACE_SINGLESTEP) not supported on this architecture\n");
-                       ksft_exit_skip();
+                       ksft_exit_skip("ptrace(PTRACE_SINGLESTEP) "
+                               "not supported on this architecture");
                }
                perror("ptrace(PTRACE_SINGLESTEP) failed");
                return false;
index cae8c984dfb065c5a0c589fc7740c9b018c8afb9..18cb9d1da4e441e1647202ccbac3f14015410276 100644 (file)
@@ -87,8 +87,7 @@ static enum test_membarrier_status test_membarrier_query(void)
                         * It is valid to build a kernel with
                         * CONFIG_MEMBARRIER=n. However, this skips the tests.
                         */
-                       ksft_test_result_skip("CONFIG_MEMBARRIER is not enabled\n");
-                       return ksft_exit_skip();
+                       ksft_exit_skip("CONFIG_MEMBARRIER is not enabled\n");
                }
                ksft_test_result_fail("sys_membarrier() failed\n");
                return TEST_MEMBARRIER_FAIL;
@@ -108,13 +107,13 @@ int main(int argc, char **argv)
        case TEST_MEMBARRIER_FAIL:
                return ksft_exit_fail();
        case TEST_MEMBARRIER_SKIP:
-               return ksft_exit_skip();
+               return ksft_exit_skip(NULL);
        }
        switch (test_membarrier()) {
        case TEST_MEMBARRIER_FAIL:
                return ksft_exit_fail();
        case TEST_MEMBARRIER_SKIP:
-               return ksft_exit_skip();
+               return ksft_exit_skip(NULL);
        }
 
        return ksft_exit_pass();