zdtm: Custom file names in binfmt_misc test

Submitted by Kirill Tkhai on April 22, 2016, 5:43 a.m.

Details

Message ID 146130380118.30145.1498397466211840065.stgit@pro
State Rejected
Series "zdtm: Custom file names in binfmt_misc test"
Headers show

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/Makefile b/test/zdtm/static/Makefile
index d4a2978..42fcf81 100644
--- a/test/zdtm/static/Makefile
+++ b/test/zdtm/static/Makefile
@@ -230,12 +230,12 @@  TST_DIR		=				\
 		mnt_ext_auto			\
 		mnt_ext_master			\
 		mntns_deleted			\
-		binfmt_misc			\
 		unlink_regular00		\
 
 TST_DIR_FILE	=				\
 		chroot				\
-		chroot-file
+		chroot-file			\
+		binfmt_misc			\
 
 TST		=				\
 		$(TST_NOFILE)			\
diff --git a/test/zdtm/static/binfmt_misc.c b/test/zdtm/static/binfmt_misc.c
index 9d7394c..62b9b51 100644
--- a/test/zdtm/static/binfmt_misc.c
+++ b/test/zdtm/static/binfmt_misc.c
@@ -19,8 +19,10 @@  const char *test_author	= "Kirill Tkhai <ktkhai@odin.com";
 
 char *dirname = "binfmt_misc.dir";
 TEST_OPTION(dirname, string, "binfmt_misc mount directory name", 1);
+char *filename;
+TEST_OPTION(filename, string, "file name prefix (prefix_magic, prefix, extention)", 1);
 
-const char *NAME[2] = { "magic_file", "extension_file" };
+char NAME[2][PATH_MAX];
 
 /* :name:type:offset:magic:mask:interpreter:flags */
 
@@ -102,6 +104,9 @@  int main(int argc, char **argv)
 
 	test_init(argc, argv);
 
+	snprintf(NAME[0], PATH_MAX, "%s_magic", filename);
+	snprintf(NAME[1], PATH_MAX, "%s_extention", filename);
+
 	if (mkdir(dirname, 0777)) {
 		fail("mkdir");
 		exit(1);

Comments

Pavel Emelianov April 22, 2016, 1:41 p.m.
Applied, thanks