diff --git a/scripts/setup-rootfs.sh b/scripts/setup-rootfs.sh index cbf94bc9..6aee25c8 100755 --- a/scripts/setup-rootfs.sh +++ b/scripts/setup-rootfs.sh @@ -97,6 +97,7 @@ map=( ["test-modprobe/external/lib/modules/external/"]="mod-simple.ko" ["test-modprobe/module-from-abspath/home/foo/"]="mod-simple.ko" ["test-modprobe/module-from-relpath/home/foo/"]="mod-simple.ko" + ["test-modprobe/show-modversions/mod-simple.ko"]="mod-simple.ko" ["test-depmod/modules-order-compressed$MODULE_DIRECTORY/4.4.4/kernel/drivers/block/cciss.ko"]="mod-fake-cciss.ko" ["test-depmod/modules-order-compressed$MODULE_DIRECTORY/4.4.4/kernel/drivers/scsi/hpsa.ko"]="mod-fake-hpsa.ko" ["test-depmod/modules-order-compressed$MODULE_DIRECTORY/4.4.4/kernel/drivers/scsi/scsi_mod.ko"]="mod-fake-scsi-mod.ko" diff --git a/testsuite/rootfs-pristine/test-modprobe/show-modversions/versions-mod-simple.txt b/testsuite/rootfs-pristine/test-modprobe/show-modversions/versions-mod-simple.txt new file mode 100644 index 00000000..b4e1cb64 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modprobe/show-modversions/versions-mod-simple.txt @@ -0,0 +1,11 @@ +0x........ single_open +0x........ seq_write +0x........ debugfs_remove +0x........ seq_lseek +0x........ seq_read +0x........ single_release +0x........ __fentry__ +0x........ debugfs_create_dir +0x........ debugfs_create_file +0x........ __x86_return_thunk +0x........ module_layout diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c index 7a9aaedd..fb7d0bab 100644 --- a/testsuite/test-modprobe.c +++ b/testsuite/test-modprobe.c @@ -361,4 +361,20 @@ DEFINE_TEST(modprobe_module_from_relpath, .modules_loaded = "mod-simple", ); +static noreturn int modprobe_show_modversions(const struct test *t) +{ + EXEC_MODPROBE("--show-modversions", "/mod-simple.ko"); + exit(EXIT_FAILURE); +} +DEFINE_TEST(modprobe_show_modversions, + .description = "check if output for modprobe --show-modversions is correct", + .config = { + [TC_UNAME_R] = "4.4.4", + [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/show-modversions", + }, + .output = { + .out = TESTSUITE_ROOTFS "test-modprobe/show-modversions/versions-mod-simple.txt", + .regex = true, + }); + TESTSUITE_MAIN();