lib/test_kmod: do not hardcode/depend on any filesystem
authorHerton R. Krzesinski <herton@redhat.com>
Fri, 18 Apr 2025 16:50:47 +0000 (13:50 -0300)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 May 2025 00:54:09 +0000 (17:54 -0700)
commit92f3c5a0051d2b56379651522b587ff7309b2606
treef52ec50b7846757bcc0308f44cae24428e89d68f
parent2a1c6158131f05c228001e1f73304535bc205444
lib/test_kmod: do not hardcode/depend on any filesystem

Right now test_kmod has hardcoded dependencies on btrfs/xfs.  That is not
optimal since you end up needing to select/build them, but it is not
really required since other fs could be selected for the testing.  Also,
we can't change the default/driver module used for testing on
initialization.

Thus make it more generic: introduce two module parameters (start_driver
and start_test_fs), which allow to select which modules/fs to use for the
testing on test_kmod initialization.  Then it's up to the user to select
which modules/fs to use for testing based on his config.  However, keep
test_module as required default.

This way, config/modules becomes selectable as when the testing is done
from selftests (userspace).

While at it, also change trigger_config_run_type, since at module
initialization we already set the defaults at __kmod_config_init and
should not need to do it again in test_kmod_init(), thus we can avoid to
again set test_driver/test_fs.

Link: https://lkml.kernel.org/r/20250418165047.702487-1-herton@redhat.com
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
Reviewed-by: Luis Chambelrain <mcgrof@kernel.org>
Cc: Daniel Gomez <da.gomez@samsung.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Petr Pavlu <petr.pavlu@suse.com>
Cc: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/Kconfig.debug
lib/test_kmod.c
tools/testing/selftests/kmod/config