selftests: kmod: test disabling module autoloading

Test that request_module() fails with -ENOENT when
/proc/sys/kernel/modprobe contains (a) a nonexistent path, and (b) an
empty path.

Case (b) is a regression test for the patch "kmod: make request_module()
return an error when autoloading is disabled".

Tested with ' -t 0010 && -t 0011', and also simply with
'' to run all kmod tests.

Signed-off-by: Eric Biggers <>
Signed-off-by: Andrew Morton <>
Acked-by: Luis Chamberlain <>
Cc: Alexei Starovoitov <>
Cc: Greg Kroah-Hartman <>
Cc: Jeff Vander Stoep <>
Cc: Jessica Yu <>
Cc: Kees Cook <>
Cc: NeilBrown <>
Signed-off-by: Linus Torvalds <>
1 file changed