]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
selftests/breakpoints: change test to use ksft framework
authorShuah Khan <shuahkh@osg.samsung.com>
Fri, 3 Oct 2014 15:06:22 +0000 (09:06 -0600)
committerShuah Khan <shuahkh@osg.samsung.com>
Mon, 17 Nov 2014 17:39:08 +0000 (10:39 -0700)
Change breakpoints test to use kselftest framework to report
test results.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/breakpoints/breakpoint_test.c

index a0743f3b2b57f885bd692e58b1c6e40723dc4837..120895ab5505b415dac85026ebf2c6d5d8a89761 100644 (file)
@@ -17,6 +17,8 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
+#include "../kselftest.h"
+
 
 /* Breakpoint access modes */
 enum {
@@ -42,7 +44,7 @@ static void set_breakpoint_addr(void *addr, int n)
                     offsetof(struct user, u_debugreg[n]), addr);
        if (ret) {
                perror("Can't set breakpoint addr\n");
-               exit(-1);
+               ksft_exit_fail();
        }
 }
 
@@ -105,7 +107,7 @@ static void toggle_breakpoint(int n, int type, int len,
                     offsetof(struct user, u_debugreg[7]), dr7);
        if (ret) {
                perror("Can't set dr7");
-               exit(-1);
+               ksft_exit_fail();
        }
 }
 
@@ -275,7 +277,7 @@ static void check_success(const char *msg)
                        msg2 = "Ok";
                if (ptrace(PTRACE_POKEDATA, child_pid, &trapped, 1)) {
                        perror("Can't poke\n");
-                       exit(-1);
+                       ksft_exit_fail();
                }
        }
 
@@ -390,5 +392,5 @@ int main(int argc, char **argv)
 
        wait(NULL);
 
-       return 0;
+       return ksft_exit_pass();
 }