mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-12-18 04:27:03 +07:00
testsuite: Add test for modprobe --force
There is no check if the correct flags are passed to finit_module, but at least we cover the respective code path in kmod.
This commit is contained in:
parent
88ac40840f
commit
2ce5de0ae6
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.
@ -187,6 +187,28 @@ static DEFINE_TEST(modprobe_param_kcmdline,
|
||||
.modules_loaded = "",
|
||||
);
|
||||
|
||||
static noreturn int modprobe_force(const struct test *t)
|
||||
{
|
||||
const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
|
||||
const char *const args[] = {
|
||||
progname,
|
||||
"--force", "psmouse",
|
||||
NULL,
|
||||
};
|
||||
|
||||
test_spawn_prog(progname, args);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
static DEFINE_TEST(modprobe_force,
|
||||
.description = "check modprobe --force",
|
||||
.config = {
|
||||
[TC_UNAME_R] = "4.4.4",
|
||||
[TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/force",
|
||||
[TC_INIT_MODULE_RETCODES] = "",
|
||||
},
|
||||
.modules_loaded = "psmouse",
|
||||
);
|
||||
|
||||
|
||||
static const struct test *tests[] = {
|
||||
&smodprobe_show_depends,
|
||||
@ -196,6 +218,7 @@ static const struct test *tests[] = {
|
||||
&smodprobe_softdep_loop,
|
||||
&smodprobe_install_cmd_loop,
|
||||
&smodprobe_param_kcmdline,
|
||||
&smodprobe_force,
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user