diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2013-08-13 22:03:26 -0300 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2013-08-13 22:03:26 -0300 |
commit | ea225b982c2bfa5244d818586f337f0673fef75a (patch) | |
tree | 3d4f9d4527f70dced4e45454281419a37883230e | |
parent | c1170883b4b42eadaddf951b3334286c6dfdf6e5 (diff) | |
download | kmod-ea225b982c2bfa5244d818586f337f0673fef75a.tar.gz kmod-ea225b982c2bfa5244d818586f337f0673fef75a.tar.bz2 kmod-ea225b982c2bfa5244d818586f337f0673fef75a.zip |
testsuite: Add test for parameter with no value in kcmdline
Currently we fail to add the module option if the parameter doesn't have
a value.
14 files changed, 33 insertions, 0 deletions
diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/correct.txt b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/correct.txt new file mode 100644 index 0000000..cea9626 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/correct.txt @@ -0,0 +1 @@ +insmod /lib/modules/4.4.4/kernel/drivers/input/mouse/psmouse.ko foo bar=1 diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/kernel/drivers/input/mouse/psmouse.ko b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/kernel/drivers/input/mouse/psmouse.ko Binary files differnew file mode 100644 index 0000000..4eac2a3 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/kernel/drivers/input/mouse/psmouse.ko diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.alias b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.alias new file mode 100644 index 0000000..a4e7677 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.alias @@ -0,0 +1,3 @@ +# Aliases extracted from modules themselves. +alias serio:ty05pr*id*ex* psmouse +alias serio:ty01pr*id*ex* psmouse diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.alias.bin b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.alias.bin Binary files differnew file mode 100644 index 0000000..0b13537 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.alias.bin diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.builtin.bin b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.builtin.bin new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.builtin.bin diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.dep b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.dep new file mode 100644 index 0000000..7ba5711 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.dep @@ -0,0 +1 @@ +kernel/drivers/input/mouse/psmouse.ko: diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.dep.bin b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.dep.bin Binary files differnew file mode 100644 index 0000000..bdd0eb5 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.dep.bin diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.devname b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.devname new file mode 100644 index 0000000..58f6d6d --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.devname @@ -0,0 +1 @@ +# Device nodes to trigger on-demand module loading. diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.softdep b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.softdep new file mode 100644 index 0000000..3cc0512 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.softdep @@ -0,0 +1,2 @@ +# Soft dependencies extracted from modules themselves. +# Copy, with a .conf extension, to /etc/modprobe.d to use it with modprobe. diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.symbols b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.symbols new file mode 100644 index 0000000..618c345 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.symbols @@ -0,0 +1 @@ +# Aliases for symbols, used by symbol_request(). diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.symbols.bin b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.symbols.bin Binary files differnew file mode 100644 index 0000000..7075435 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/lib/modules/4.4.4/modules.symbols.bin diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/proc/cmdline b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/proc/cmdline new file mode 100644 index 0000000..31126a9 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/proc/cmdline @@ -0,0 +1 @@ +initrd=\initramfs-linux.img psmouse.foo psmouse.bar=1 root=/dev/sda2 rootfstype=ext4 add_efi_memmap quiet rw diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/proc/modules b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/proc/modules new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline/proc/modules diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c index cc90dae..f0131e3 100644 --- a/testsuite/test-modprobe.c +++ b/testsuite/test-modprobe.c @@ -158,6 +158,28 @@ static DEFINE_TEST(modprobe_install_cmd_loop, }, ); +static __noreturn int modprobe_param_kcmdline(const struct test *t) +{ + const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe"; + const char *const args[] = { + progname, + "--show-depends", "psmouse", + NULL, + }; + + test_spawn_prog(progname, args); + exit(EXIT_FAILURE); +} +static DEFINE_TEST(modprobe_param_kcmdline, + .description = "check if params are parsed correctly from kcmdline", + .config = { + [TC_UNAME_R] = "4.4.4", + [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/module-param-kcmdline", + }, + .output = { + .stdout = TESTSUITE_ROOTFS "test-modprobe/module-param-kcmdline/correct.txt", + }); + static const struct test *tests[] = { &smodprobe_show_depends, @@ -166,6 +188,7 @@ static const struct test *tests[] = { &smodprobe_builtin, &smodprobe_softdep_loop, &smodprobe_install_cmd_loop, + &smodprobe_param_kcmdline, NULL, }; |