Skip to content

Commit c7c2ab5

Browse files
committed
testsuite/test-modprobe: Test --show-modversions
We can't test actual CRC values, because they may vary depending on kernel configuration. We can ensure the correct symbol names show up though. Signed-off-by: Matthew Maurer <[email protected]>
1 parent fb37541 commit c7c2ab5

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

scripts/setup-rootfs.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ map=(
9797
["test-modprobe/external/lib/modules/external/"]="mod-simple.ko"
9898
["test-modprobe/module-from-abspath/home/foo/"]="mod-simple.ko"
9999
["test-modprobe/module-from-relpath/home/foo/"]="mod-simple.ko"
100+
["test-modprobe/show-modversions/mod-simple.ko"]="mod-simple.ko"
100101
["test-depmod/modules-order-compressed$MODULE_DIRECTORY/4.4.4/kernel/drivers/block/cciss.ko"]="mod-fake-cciss.ko"
101102
["test-depmod/modules-order-compressed$MODULE_DIRECTORY/4.4.4/kernel/drivers/scsi/hpsa.ko"]="mod-fake-hpsa.ko"
102103
["test-depmod/modules-order-compressed$MODULE_DIRECTORY/4.4.4/kernel/drivers/scsi/scsi_mod.ko"]="mod-fake-scsi-mod.ko"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
0x........ single_open
2+
0x........ seq_write
3+
0x........ debugfs_remove
4+
0x........ seq_lseek
5+
0x........ seq_read
6+
0x........ single_release
7+
0x........ __fentry__
8+
0x........ debugfs_create_dir
9+
0x........ debugfs_create_file
10+
0x........ __x86_return_thunk
11+
0x........ module_layout

testsuite/test-modprobe.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,4 +361,20 @@ DEFINE_TEST(modprobe_module_from_relpath,
361361
.modules_loaded = "mod-simple",
362362
);
363363

364+
static noreturn int modprobe_show_modversions(const struct test *t)
365+
{
366+
EXEC_MODPROBE("--show-modversions", "/mod-simple.ko");
367+
exit(EXIT_FAILURE);
368+
}
369+
DEFINE_TEST(modprobe_show_modversions,
370+
.description = "check if output for modprobe --show-modversions is correct",
371+
.config = {
372+
[TC_UNAME_R] = "4.4.4",
373+
[TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/show-modversions",
374+
},
375+
.output = {
376+
.out = TESTSUITE_ROOTFS "test-modprobe/show-modversions/versions-mod-simple.txt",
377+
.regex = true,
378+
});
379+
364380
TESTSUITE_MAIN();

0 commit comments

Comments
 (0)