]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: add simple test for --show-exports
authorLucas De Marchi <lucas.demarchi@intel.com>
Tue, 13 Nov 2018 18:45:00 +0000 (10:45 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 13 Nov 2018 18:45:00 +0000 (10:45 -0800)
testsuite/populate-modules.sh
testsuite/rootfs-pristine/test-modprobe/show-exports/correct.txt [new file with mode: 0644]
testsuite/test-modprobe.c

index b77e71edf0a446ba1f7e28cf13d18a23973dec07..ba68a697ce61654e942c4683846a504fd38d1570 100755 (executable)
@@ -39,6 +39,7 @@ map=(
     ["test-modprobe/show-depends/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko"
     ["test-modprobe/show-depends/lib/modules/4.4.4/kernel/mod-loop-b.ko"]="mod-loop-b.ko"
     ["test-modprobe/show-depends/lib/modules/4.4.4/kernel/mod-simple.ko"]="mod-simple.ko"
+    ["test-modprobe/show-exports/mod-loop-a.ko"]="mod-loop-a.ko"
     ["test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko"
     ["test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/mod-loop-b.ko"]="mod-loop-b.ko"
     ["test-modprobe/install-cmd-loop/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko"
diff --git a/testsuite/rootfs-pristine/test-modprobe/show-exports/correct.txt b/testsuite/rootfs-pristine/test-modprobe/show-exports/correct.txt
new file mode 100644 (file)
index 0000000..bc2d045
--- /dev/null
@@ -0,0 +1 @@
+0x00000000     printA
index ee9d82d487c7ce17ab7d2bcbf8f25780f0f5b88a..52a662138d6565bf1a9d6a5045872dc4569d84c6 100644 (file)
@@ -95,6 +95,28 @@ DEFINE_TEST(modprobe_show_alias_to_none,
        );
 
 
+static noreturn int modprobe_show_exports(const struct test *t)
+{
+       const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
+       const char *const args[] = {
+               progname,
+               "--show-exports", "--quiet", "/mod-loop-a.ko",
+               NULL,
+       };
+
+       test_spawn_prog(progname, args);
+       exit(EXIT_FAILURE);
+}
+DEFINE_TEST(modprobe_show_exports,
+       .description = "check if modprobe --show-depends doesn't explode with an alias to nothing",
+       .config = {
+               [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/show-exports",
+       },
+       .output = {
+               .out = TESTSUITE_ROOTFS "test-modprobe/show-exports/correct.txt",
+       });
+
+
 static noreturn int modprobe_builtin(const struct test *t)
 {
        const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";