lib/test_kmod: do not hardcode/depend on any filesystem
Subsystems (3)
PATCH v2 1/1 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.
v2: also update tools/testing/selftests/kmod/config with the removed dependencies.
--- lib/Kconfig.debug | 6 --- lib/test_kmod.c | 64 +++++++++++++++-------------- tools/testing/selftests/kmod/config | 5 --- 3 files changed, 34 insertions(+), 41 deletions(-)
lib/Kconfig.debug +0 -6
@@ -2983,13 +2983,7 @@ config TEST_DYNAMIC_DEBUG config TEST_KMOD tristate "kmod stress tester" depends on m - depends on NETDEVICES && NET_CORE && INET # for TUN - depends on BLOCK - depends on PAGE_SIZE_LESS_THAN_256KB # for BTRFS select TEST_LKM - select XFS_FS - select TUN - select BTRFS_FS help Test the kernel's module loading mechanism: kmod. kmod implements support to load modules using the Linux kernel's usermode helper.
lib/test_kmod.c +34 -30
122 lines not on this page · raw message
tools/testing/selftests/kmod/config +0 -5
@@ -1,7 +1,2 @@ CONFIG_TEST_KMOD=m CONFIG_TEST_LKM=m -CONFIG_XFS_FS=m - -# For the module parameter force_init_test is used -CONFIG_TUN=m -CONFIG_BTRFS_FS=m
Signature · 1 line
2.47.1
Quoted 20 lines · Herton R. Krzesinski
Right now
test_kmodhas 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_driverandstart_test_fs), which allow to select which modules/fs to use for the testing ontest_kmodinitialization. Then it's up to the user to select which modules/fs to use for testing based on his config. However, keeptest_moduleas 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_initand should not need to do it again intest_kmod_init(), thus we can avoid to again set test_driver/test_fs.
Quoted 4 lines
v2: also update
tools/testing/selftests/kmod/configwith the removed dependencies.Signed-off-by Herton R. Krzesinski <[email protected]>
Luis