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.
This commit is contained in:
parent
c1170883b4
commit
ea225b982c
|
@ -0,0 +1 @@
|
|||
insmod /lib/modules/4.4.4/kernel/drivers/input/mouse/psmouse.ko foo bar=1
|
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
# Aliases extracted from modules themselves.
|
||||
alias serio:ty05pr*id*ex* psmouse
|
||||
alias serio:ty01pr*id*ex* psmouse
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
kernel/drivers/input/mouse/psmouse.ko:
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
# Device nodes to trigger on-demand module loading.
|
|
@ -0,0 +1,2 @@
|
|||
# Soft dependencies extracted from modules themselves.
|
||||
# Copy, with a .conf extension, to /etc/modprobe.d to use it with modprobe.
|
|
@ -0,0 +1 @@
|
|||
# Aliases for symbols, used by symbol_request().
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
initrd=\initramfs-linux.img psmouse.foo psmouse.bar=1 root=/dev/sda2 rootfstype=ext4 add_efi_memmap quiet rw
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue