Skip to contentSkip to conversation

userfaultfd: selftest: explicit failure if the SIGBUS test failed

PATCH In review [email protected] 1 participant 1 message Sep 6, 2017 Kselftest

lore
Share & tools
lore
#0 lore raw

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.

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]>

---

 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
diff -puN tools/testing/selftests/vm/userfaultfd.c~userfaultfd-selftest-explicit-failure-if-the-sigbus-test-failed tools/testing/selftests/vm/userfaultfd.c
@@ -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;
 }

_