Re: [PATCH v2 5/7] selftests/mount: change test to use ksft framework

2 messages, 2 authors, 2014-09-23 · open the first message on its own page

Re: [PATCH v2 5/7] selftests/mount: change test to use ksft framework

From: Eric W. Biederman <hidden>
Date: 2014-09-23 22:41:46

Shuah Khan [off-list ref] writes:
Change mount test to use kselftest framework to report
test results.
Nacked-by: "Eric W. Biederman" [off-list ref]

I am curious did you even run these tests?   I can't possibly see how
the tests would have passed with this change.  At the very least you
have taken this test from linear to exponential time complexity.
quoted hunk
Signed-off-by: Shuah Khan <redacted>
---
 tools/testing/selftests/mount/unprivileged-remount-test.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/mount/unprivileged-remount-test.c b/tools/testing/selftests/mount/unprivileged-remount-test.c
index 1b3ff2f..c64d442 100644
--- a/tools/testing/selftests/mount/unprivileged-remount-test.c
+++ b/tools/testing/selftests/mount/unprivileged-remount-test.c
@@ -13,6 +13,8 @@
 #include <stdbool.h>
 #include <stdarg.h>
 
+#include "../kselftest.h"
+
 #ifndef CLONE_NEWNS
 # define CLONE_NEWNS 0x00020000
 #endif
@@ -45,7 +47,7 @@ static void die(char *fmt, ...)
 	va_start(ap, fmt);
 	vfprintf(stderr, fmt, ap);
 	va_end(ap);
-	exit(EXIT_FAILURE);
+	ksft_exit_fail();
 }
 
 static void write_file(char *filename, char *fmt, ...)
@@ -176,7 +178,7 @@ bool test_unpriv_remount(int mount_flags, int remount_flags, int invalid_flags)
 		die("remount of /tmp with invalid flags "
 		    "succeeded unexpectedly\n");
 	}
-	exit(EXIT_SUCCESS);
+	return ksft_exit_pass();
This change is a deep bug. 

This exit is a forked child process (not from the test itself). That a
few lines earlier in the test I test the value of in waitpid.

Also in your change commit comment if no where else you should have
called out that you were making a semantic change to the test.
quoted hunk
 }
 
 static bool test_unpriv_remount_simple(int mount_flags)
@@ -238,5 +240,5 @@ int main(int argc, char **argv)
 	{
 		die("Default atime malfunctions\n");
 	}
-	return EXIT_SUCCESS;
+	return ksft_exit_pass();
 }

Re: [PATCH v2 5/7] selftests/mount: change test to use ksft framework

From: Shuah Khan <hidden>
Date: 2014-09-23 22:56:14

On 09/23/2014 04:41 PM, Eric W. Biederman wrote:
Shuah Khan [off-list ref] writes:
quoted
Change mount test to use kselftest framework to report
test results.
Nacked-by: "Eric W. Biederman" [off-list ref]

I am curious did you even run these tests?   I can't possibly see how
the tests would have passed with this change.  At the very least you
have taken this test from linear to exponential time complexity.
Oops. I meant to drop this commit from the series. Sorry for the noise.

-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Samsung Research America (Silicon Valley)
shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org | (970) 217-8978
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help