userfaultfd: selftest: explicit failure if the SIGBUS test failed
PATCH 94/119 userfaultfd: selftest: explicit failure if the SIGBUS test failed
From: Andrea Arcangeli <[email protected]>
Subject: userfaultfd: selftest: explicit failure if the SIGBUS test failed
Showing zero in the output isn't very self explanatory as a successful result. Show a more explicit error output if the test fails.
Signed-off-by Andrea Arcangeli <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>
Cc Alexey Perevalov <[email protected]>
Cc Maxime Coquelin <[email protected]>
Cc Mike Kravetz <[email protected]>
Cc Mike Rapoport <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
tools/testing/selftests/vm/userfaultfd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/vm/userfaultfd.c renamed from tools/testing/selftests/vm/userfaultfd.c~userfaultfd-selftest-explicit-failure-if-the-sigbus-test-failed +3 -1
@@ -987,7 +987,9 @@ static int userfaultfd_sig_test(void)return 1 ;printf ("done.\n" ); -printf (" Signal test userfaults: %ld\n" , userfaults); +if (userfaults) +fprintf (stderr,"Signal test failed, userfaults: %ld\n" , + userfaults);close (uffd);return userfaults !=0 ; }
_