]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: port arch-specific tests to module-playground
authorLucas De Marchi <lucas.demarchi@intel.com>
Sat, 21 Feb 2015 17:09:12 +0000 (15:09 -0200)
committerLucas De Marchi <lucas.demarchi@intel.com>
Sat, 21 Feb 2015 17:09:12 +0000 (15:09 -0200)
Rename modinfo_jonsmodules() to test_modinfo_signature(): now this test
is responsible only for the signed modules.

The other tests use specific flags to modinfo in order to print only
one field, so we can filter out those fields that are expect to change
if the module is recompiled.

13 files changed:
testsuite/populate-modules.sh
testsuite/rootfs-pristine/test-modinfo/correct-author.txt [new file with mode: 0644]
testsuite/rootfs-pristine/test-modinfo/correct-depends.txt [new file with mode: 0644]
testsuite/rootfs-pristine/test-modinfo/correct-description.txt [new file with mode: 0644]
testsuite/rootfs-pristine/test-modinfo/correct-filename.txt [new file with mode: 0644]
testsuite/rootfs-pristine/test-modinfo/correct-license.txt [new file with mode: 0644]
testsuite/rootfs-pristine/test-modinfo/correct-parm.txt [new file with mode: 0644]
testsuite/rootfs-pristine/test-modinfo/correct.txt
testsuite/rootfs-pristine/test-modinfo/ext4-i686.ko [deleted file]
testsuite/rootfs-pristine/test-modinfo/ext4-ppc64.ko [deleted file]
testsuite/rootfs-pristine/test-modinfo/ext4-s390x.ko [deleted file]
testsuite/rootfs-pristine/test-modinfo/ext4-x86_64.ko [deleted file]
testsuite/test-modinfo.c

index b61cbfa0d576e2f628fb0166a33e5c569b581a1b..938433d59fe99c9a0817be198d67a319fa538270 100755 (executable)
@@ -37,6 +37,9 @@ map=(
     ["test-depmod/modules-order-compressed/lib/modules/4.4.4/kernel/drivers/block/cciss.ko"]="mod-fake-cciss.ko"
     ["test-depmod/modules-order-compressed/lib/modules/4.4.4/kernel/drivers/scsi/hpsa.ko"]="mod-fake-hpsa.ko"
     ["test-depmod/modules-order-compressed/lib/modules/4.4.4/kernel/drivers/scsi/scsi_mod.ko"]="mod-fake-scsi-mod.ko"
+    ["test-modinfo/mod-simple-i386.ko"]="mod-simple-i386.ko"
+    ["test-modinfo/mod-simple-x86_64.ko"]="mod-simple-x86_64.ko"
+    ["test-modinfo/mod-simple-sparc64.ko"]="mod-simple-sparc64.ko"
 )
 
 gzip_array=(
diff --git a/testsuite/rootfs-pristine/test-modinfo/correct-author.txt b/testsuite/rootfs-pristine/test-modinfo/correct-author.txt
new file mode 100644 (file)
index 0000000..b74c9bf
--- /dev/null
@@ -0,0 +1,3 @@
+Lucas De Marchi <lucas.demarchi@intel.com>
+Lucas De Marchi <lucas.demarchi@intel.com>
+Lucas De Marchi <lucas.demarchi@intel.com>
diff --git a/testsuite/rootfs-pristine/test-modinfo/correct-depends.txt b/testsuite/rootfs-pristine/test-modinfo/correct-depends.txt
new file mode 100644 (file)
index 0000000..b28b04f
--- /dev/null
@@ -0,0 +1,3 @@
+
+
+
diff --git a/testsuite/rootfs-pristine/test-modinfo/correct-description.txt b/testsuite/rootfs-pristine/test-modinfo/correct-description.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/testsuite/rootfs-pristine/test-modinfo/correct-filename.txt b/testsuite/rootfs-pristine/test-modinfo/correct-filename.txt
new file mode 100644 (file)
index 0000000..bcd47c0
--- /dev/null
@@ -0,0 +1,3 @@
+/mod-simple-i386.ko
+/mod-simple-x86_64.ko
+/mod-simple-sparc64.ko
diff --git a/testsuite/rootfs-pristine/test-modinfo/correct-license.txt b/testsuite/rootfs-pristine/test-modinfo/correct-license.txt
new file mode 100644 (file)
index 0000000..f79931d
--- /dev/null
@@ -0,0 +1,4 @@
+LGPL
+LGPL
+LGPL
+
diff --git a/testsuite/rootfs-pristine/test-modinfo/correct-parm.txt b/testsuite/rootfs-pristine/test-modinfo/correct-parm.txt
new file mode 100644 (file)
index 0000000..e69de29
index 4a7a4ac1bcd0e6f0369b471cf30af00f3b822103..92ff247bd3987188604e80121cef91f759ffee1f 100644 (file)
@@ -1,31 +1,3 @@
-filename:       /ext4-i686.ko
-license:        GPL
-description:    Fourth Extended Filesystem
-author:         Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others
-srcversion:     A80608676B83D55514B450E
-depends:        mbcache,jbd2
-vermagic:       2.6.32-220.el6.i686 SMP mod_unload modversions 686 
-filename:       /ext4-ppc64.ko
-license:        GPL
-description:    Fourth Extended Filesystem
-author:         Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others
-srcversion:     670806A855D5836BE150B41
-depends:        jbd2,mbcache
-vermagic:       2.6.32-220.el6.ppc64 SMP mod_unload modversions 
-filename:       /ext4-s390x.ko
-license:        GPL
-description:    Fourth Extended Filesystem
-author:         Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others
-srcversion:     670806A855D5836BE150B41
-depends:        mbcache,jbd2
-vermagic:       2.6.32-220.el6.s390x SMP mod_unload modversions 
-filename:       /ext4-x86_64.ko
-license:        GPL
-description:    Fourth Extended Filesystem
-author:         Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others
-srcversion:     A80608676B83D55514B450E
-depends:        mbcache,jbd2
-vermagic:       2.6.32-220.el6.x86_64 SMP mod_unload modversions 
 filename:       /ext4-x86_64-sha1.ko
 license:        GPL
 description:    Fourth Extended Filesystem
diff --git a/testsuite/rootfs-pristine/test-modinfo/ext4-i686.ko b/testsuite/rootfs-pristine/test-modinfo/ext4-i686.ko
deleted file mode 100644 (file)
index e5d2fb7..0000000
Binary files a/testsuite/rootfs-pristine/test-modinfo/ext4-i686.ko and /dev/null differ
diff --git a/testsuite/rootfs-pristine/test-modinfo/ext4-ppc64.ko b/testsuite/rootfs-pristine/test-modinfo/ext4-ppc64.ko
deleted file mode 100644 (file)
index cb02ed4..0000000
Binary files a/testsuite/rootfs-pristine/test-modinfo/ext4-ppc64.ko and /dev/null differ
diff --git a/testsuite/rootfs-pristine/test-modinfo/ext4-s390x.ko b/testsuite/rootfs-pristine/test-modinfo/ext4-s390x.ko
deleted file mode 100644 (file)
index 74c3799..0000000
Binary files a/testsuite/rootfs-pristine/test-modinfo/ext4-s390x.ko and /dev/null differ
diff --git a/testsuite/rootfs-pristine/test-modinfo/ext4-x86_64.ko b/testsuite/rootfs-pristine/test-modinfo/ext4-x86_64.ko
deleted file mode 100644 (file)
index ae96eef..0000000
Binary files a/testsuite/rootfs-pristine/test-modinfo/ext4-x86_64.ko and /dev/null differ
index 317629c376202c7cb4f62c270b0a2b5192f471d8..9a57ea4d2e65d3a6082c173e046e5e77bdfa6d60 100644 (file)
 
 #include "testsuite.h"
 
-static noreturn int modinfo_jonsmodules(const struct test *t)
+static const char *progname = ABS_TOP_BUILDDIR "/tools/modinfo";
+
+#define DEFINE_MODINFO_TEST(_field) \
+static noreturn int test_modinfo_##_field(const struct test *t) \
+{ \
+       const char *const args[] = { \
+               progname, "-F", #_field ,\
+               "/mod-simple-i386.ko", "/mod-simple-x86_64.ko", "/mod-simple-sparc64.ko", \
+               NULL, \
+       }; \
+       test_spawn_prog(progname, args); \
+       exit(EXIT_FAILURE); \
+} \
+DEFINE_TEST(test_modinfo_##_field, \
+       .description = "check " #_field " output of modinfo for different architectures", \
+       .config = { \
+               [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modinfo/", \
+       }, \
+       .output = { \
+               .out = TESTSUITE_ROOTFS "test-modinfo/correct-" #_field ".txt", \
+       })
+
+DEFINE_MODINFO_TEST(filename);
+DEFINE_MODINFO_TEST(author);
+DEFINE_MODINFO_TEST(license);
+DEFINE_MODINFO_TEST(description);
+DEFINE_MODINFO_TEST(parm);
+DEFINE_MODINFO_TEST(depends);
+
+static noreturn int test_modinfo_signature(const struct test *t)
 {
-       const char *progname = ABS_TOP_BUILDDIR "/tools/modinfo";
        const char *const args[] = {
                progname,
-               "/ext4-i686.ko", "/ext4-ppc64.ko", "/ext4-s390x.ko",
-               "/ext4-x86_64.ko", "/ext4-x86_64-sha1.ko",
-               "/ext4-x86_64-sha256.ko",
+               "/ext4-x86_64-sha1.ko", "/ext4-x86_64-sha256.ko",
                NULL,
        };
 
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-DEFINE_TEST(modinfo_jonsmodules,
+DEFINE_TEST(test_modinfo_signature,
        .description = "check if output for modinfo is correct for i686, ppc64, s390x and x86_64",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modinfo/",