public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] print reason for failure in kcmp_test
@ 2012-10-18 19:41 Dave Jones
  2012-10-18 19:59 ` Cyrill Gorcunov
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2012-10-18 19:41 UTC (permalink / raw)
  To: gorcunov; +Cc: Linux Kernel

I was curious why sys_kcmp wasn't working, which led me to the testcase.
It turned out I hadn't enabled CHECKPOINT_RESTORE in the kernel I was testing.
Add a decoding of errno to the testcase to make that obvious.

Signed-off-by: Dave Jones <davej@redhat.com>

diff --git a/tools/testing/selftests/kcmp/kcmp_test.c b/tools/testing/selftests/kcmp/kcmp_test.c
index 358cc6b..fa4f1b3 100644
--- a/tools/testing/selftests/kcmp/kcmp_test.c
+++ b/tools/testing/selftests/kcmp/kcmp_test.c
@@ -72,7 +72,8 @@ int main(int argc, char **argv)
 		/* This one should return same fd */
 		ret = sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd1);
 		if (ret) {
-			printf("FAIL: 0 expected but %d returned\n", ret);
+			printf("FAIL: 0 expected but %d returned (%s)\n",
+				ret, strerror(errno));
 			ret = -1;
 		} else
 			printf("PASS: 0 returned as expected\n");
@@ -80,7 +81,8 @@ int main(int argc, char **argv)
 		/* Compare with self */
 		ret = sys_kcmp(pid1, pid1, KCMP_VM, 0, 0);
 		if (ret) {
-			printf("FAIL: 0 expected but %li returned\n", ret);
+			printf("FAIL: 0 expected but %li returned (%s)\n",
+				ret, strerror(errno));
 			ret = -1;
 		} else
 			printf("PASS: 0 returned as expected\n");

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] print reason for failure in kcmp_test
  2012-10-18 19:41 [PATCH] print reason for failure in kcmp_test Dave Jones
@ 2012-10-18 19:59 ` Cyrill Gorcunov
  0 siblings, 0 replies; 2+ messages in thread
From: Cyrill Gorcunov @ 2012-10-18 19:59 UTC (permalink / raw)
  To: Dave Jones, Linux Kernel; +Cc: Andrew Morton

On Thu, Oct 18, 2012 at 03:41:04PM -0400, Dave Jones wrote:
> I was curious why sys_kcmp wasn't working, which led me to the testcase.
> It turned out I hadn't enabled CHECKPOINT_RESTORE in the kernel I was testing.
> Add a decoding of errno to the testcase to make that obvious.
> 
> Signed-off-by: Dave Jones <davej@redhat.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>

Thanks Dave!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-18 19:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-18 19:41 [PATCH] print reason for failure in kcmp_test Dave Jones
2012-10-18 19:59 ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox