]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: Test that modprobe --show-depends doesn't load module
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 21 Nov 2024 14:19:08 +0000 (08:19 -0600)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 29 Nov 2024 13:59:06 +0000 (07:59 -0600)
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 <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/254
testsuite/rootfs-pristine/test-modprobe/show-depends/proc/modules
testsuite/rootfs-pristine/test-modprobe/show-depends/sys/module/mod_loop_a/initstate [deleted file]
testsuite/rootfs-pristine/test-modprobe/show-depends/sys/module/mod_loop_b/initstate [deleted file]
testsuite/test-modprobe.c

index aab95dde58d351e551e4201d42e4a48857e8b8b3..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -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 (file)
index e23fe64..0000000
+++ /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 (file)
index e23fe64..0000000
+++ /dev/null
@@ -1 +0,0 @@
-live
index cf824bdff4735b27d3baf318b11b1bfd99bf6baa..7a9aaedd299056aced8abab922d76ed30038b996 100644 (file)
@@ -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)
 {