linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] testsuite: add test for kcmdline params with no value
@ 2014-03-06 14:06 Lucas De Marchi
  2014-03-06 14:06 ` [PATCH 2/8] testsuite: give a more suitable description to test Lucas De Marchi
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Lucas De Marchi @ 2014-03-06 14:06 UTC (permalink / raw)
  To: linux-modules; +Cc: Michal Marek

Use "modprobe -c" to dump the configuration. Since we configure our
rootfs to have only a /proc/cmdline file, this should dump the knowledge
we have from its parsed content.

Test if <module>.option, without any value is correctly parsed, as fixed
in commit 493dc65 ("libkmod: Fix getting param with no value from kcmdline")
---
 .../module-param-kcmdline2/correct.txt             |  5 +++++
 .../module-param-kcmdline2/proc/cmdline            |  1 +
 testsuite/test-modprobe.c                          | 25 ++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 100644 testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline2/correct.txt
 create mode 100644 testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline2/proc/cmdline

diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline2/correct.txt b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline2/correct.txt
new file mode 100644
index 0000000..b73a680
--- /dev/null
+++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline2/correct.txt
@@ -0,0 +1,5 @@
+options psmouse foo
+options psmouse bar=1
+
+# End of configuration files. Dumping indexes now:
+
diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline2/proc/cmdline b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline2/proc/cmdline
new file mode 100644
index 0000000..f048fdd
--- /dev/null
+++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline2/proc/cmdline
@@ -0,0 +1 @@
+psmouse.foo psmouse.bar=1 quiet rw
diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c
index b675f48..492b4d8 100644
--- a/testsuite/test-modprobe.c
+++ b/testsuite/test-modprobe.c
@@ -187,6 +187,30 @@ static DEFINE_TEST(modprobe_param_kcmdline,
 	.modules_loaded = "",
 	);
 
+static noreturn int modprobe_param_kcmdline2(const struct test *t)
+{
+	const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
+	const char *const args[] = {
+		progname,
+		"-c",
+		NULL,
+	};
+
+	test_spawn_prog(progname, args);
+	exit(EXIT_FAILURE);
+}
+static DEFINE_TEST(modprobe_param_kcmdline2,
+	.description = "check if params with no value are parsed correctly from kcmdline",
+	.config = {
+		[TC_UNAME_R] = "4.4.4",
+		[TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/module-param-kcmdline2",
+	},
+	.output = {
+		.out = TESTSUITE_ROOTFS "test-modprobe/module-param-kcmdline2/correct.txt",
+	},
+	.modules_loaded = "",
+	);
+
 static noreturn int modprobe_force(const struct test *t)
 {
 	const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
@@ -262,6 +286,7 @@ static const struct test *tests[] = {
 	&smodprobe_softdep_loop,
 	&smodprobe_install_cmd_loop,
 	&smodprobe_param_kcmdline,
+	&smodprobe_param_kcmdline2,
 	&smodprobe_force,
 	&smodprobe_oldkernel,
 	&smodprobe_oldkernel_force,
-- 
1.9.0


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

end of thread, other threads:[~2014-03-07  9:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-06 14:06 [PATCH 1/8] testsuite: add test for kcmdline params with no value Lucas De Marchi
2014-03-06 14:06 ` [PATCH 2/8] testsuite: give a more suitable description to test Lucas De Marchi
2014-03-06 14:06 ` [PATCH 3/8] testsuite: add test to ignore unrelated strings in kcmdline Lucas De Marchi
2014-03-06 14:06 ` [PATCH 4/8] testsuite: add test for '.' correctly parsed in param's value Lucas De Marchi
2014-03-06 17:18   ` Michal Marek
2014-03-06 14:06 ` [PATCH 5/8] build-sys: add small redirecting Makefiles Lucas De Marchi
2014-03-06 14:06 ` [PATCH 6/8] build-sys: Do not require xsltproc for installation of man pages Lucas De Marchi
2014-03-06 17:19   ` Michal Marek
2014-03-06 14:06 ` [PATCH 7/8] man: clarify the support to modules.dep file Lucas De Marchi
2014-03-06 14:06 ` [PATCH 8/8] man: use systemd as example instead of udev Lucas De Marchi
2014-03-06 17:22   ` Michal Marek
2014-03-06 21:47     ` Lucas De Marchi
2014-03-07  2:07       ` Lucas De Marchi
2014-03-07  9:17       ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).