Skip to content

Commit

Permalink
testsuite: Test that modprobe --show-depends doesn't load module
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Link: #254
  • Loading branch information
lucasdemarchi committed Nov 29, 2024
1 parent 58d6728 commit 9badf04
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
btusb 11911 0 - Live 0xffffffffa00ec000
bluetooth 173424 1 btusb, Live 0xffffffffa0040000

This file was deleted.

This file was deleted.

8 changes: 8 additions & 0 deletions testsuite/test-modprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 9badf04

Please sign in to comment.