Re: [PATCH v2 4/4] selftests: kmod: test disabling module autoloading

From: Luis Chamberlain
Date: Thu Mar 12 2020 - 21:10:05 EST


On Thu, Mar 12, 2020 at 01:25:52PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@xxxxxxxxxx>
>
> 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 'kmod.sh -t 0010 && kmod.sh -t 0011', and also simply with
> 'kmod.sh' to run all kmod tests.
>
> Note: get_test_count() and get_test_enabled() were broken for test
> numbers above 9 due to awk interpreting a field specification like
> '$0010' as octal rather than decimal. So I fixed that too.
>
> Cc: Alexei Starovoitov <ast@xxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: Jeff Vander Stoep <jeffv@xxxxxxxxxx>
> Cc: Jessica Yu <jeyu@xxxxxxxxxx>
> Cc: Kees Cook <keescook@xxxxxxxxxxxx>
> Cc: Luis Chamberlain <mcgrof@xxxxxxxxxx>
> Cc: NeilBrown <neilb@xxxxxxxx>
> Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>

Thanks!

Can you split up the get_test_count()/get_test_enabled() fix into
another patch though?

Acked-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>

Luis