From: Lucas De Marchi Date: Thu, 21 Nov 2024 14:19:08 +0000 (-0600) Subject: testsuite: Test that modprobe --show-depends doesn't load module X-Git-Tag: v34~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9badf04e213a8a37e8e444390f15edb6cfe0e5eb;p=thirdparty%2Fkmod.git testsuite: Test that modprobe --show-depends doesn't load module Remove /proc/modules and /sys/module/* from the show-depends rootfs since they shouldn't be there and add a test to make sure no module is loaded. Signed-off-by: Lucas De Marchi Reviewed-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/254 --- diff --git a/testsuite/rootfs-pristine/test-modprobe/show-depends/proc/modules b/testsuite/rootfs-pristine/test-modprobe/show-depends/proc/modules index aab95dde..e69de29b 100644 --- a/testsuite/rootfs-pristine/test-modprobe/show-depends/proc/modules +++ b/testsuite/rootfs-pristine/test-modprobe/show-depends/proc/modules @@ -1,2 +0,0 @@ -btusb 11911 0 - Live 0xffffffffa00ec000 -bluetooth 173424 1 btusb, Live 0xffffffffa0040000 diff --git a/testsuite/rootfs-pristine/test-modprobe/show-depends/sys/module/mod_loop_a/initstate b/testsuite/rootfs-pristine/test-modprobe/show-depends/sys/module/mod_loop_a/initstate deleted file mode 100644 index e23fe645..00000000 --- a/testsuite/rootfs-pristine/test-modprobe/show-depends/sys/module/mod_loop_a/initstate +++ /dev/null @@ -1 +0,0 @@ -live diff --git a/testsuite/rootfs-pristine/test-modprobe/show-depends/sys/module/mod_loop_b/initstate b/testsuite/rootfs-pristine/test-modprobe/show-depends/sys/module/mod_loop_b/initstate deleted file mode 100644 index e23fe645..00000000 --- a/testsuite/rootfs-pristine/test-modprobe/show-depends/sys/module/mod_loop_b/initstate +++ /dev/null @@ -1 +0,0 @@ -live diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c index cf824bdf..7a9aaedd 100644 --- a/testsuite/test-modprobe.c +++ b/testsuite/test-modprobe.c @@ -47,6 +47,14 @@ DEFINE_TEST(modprobe_show_depends2, .output = { .out = TESTSUITE_ROOTFS "test-modprobe/show-depends/correct-mod-simple.txt", }); +DEFINE_TEST_WITH_FUNC(modprobe_show_depends_no_load, modprobe_show_depends2, + .description = "check that --show-depends doesn't load any module", + .config = { + [TC_UNAME_R] = "4.4.4", + [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/show-depends", + }, + .modules_loaded = "", + ); static noreturn int modprobe_show_alias_to_none(const struct test *t) {