diff options
-rwxr-xr-x | testsuite/populate-modules.sh | 3 | ||||
-rw-r--r-- | testsuite/rootfs-pristine/test-modinfo/correct-author.txt | 3 | ||||
-rw-r--r-- | testsuite/rootfs-pristine/test-modinfo/correct-depends.txt | 3 | ||||
-rw-r--r-- | testsuite/rootfs-pristine/test-modinfo/correct-description.txt | 0 | ||||
-rw-r--r-- | testsuite/rootfs-pristine/test-modinfo/correct-filename.txt | 3 | ||||
-rw-r--r-- | testsuite/rootfs-pristine/test-modinfo/correct-license.txt | 4 | ||||
-rw-r--r-- | testsuite/rootfs-pristine/test-modinfo/correct-parm.txt | 0 | ||||
-rw-r--r-- | testsuite/rootfs-pristine/test-modinfo/correct.txt | 28 | ||||
-rw-r--r-- | testsuite/rootfs-pristine/test-modinfo/ext4-i686.ko | bin | 437788 -> 0 bytes | |||
-rw-r--r-- | testsuite/rootfs-pristine/test-modinfo/ext4-ppc64.ko | bin | 704776 -> 0 bytes | |||
-rw-r--r-- | testsuite/rootfs-pristine/test-modinfo/ext4-s390x.ko | bin | 773856 -> 0 bytes | |||
-rw-r--r-- | testsuite/rootfs-pristine/test-modinfo/ext4-x86_64.ko | bin | 627040 -> 0 bytes | |||
-rw-r--r-- | testsuite/test-modinfo.c | 38 |
13 files changed, 48 insertions, 34 deletions
diff --git a/testsuite/populate-modules.sh b/testsuite/populate-modules.sh index b61cbfa..938433d 100755 --- a/testsuite/populate-modules.sh +++ b/testsuite/populate-modules.sh @@ -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 index 0000000..b74c9bf --- /dev/null +++ b/testsuite/rootfs-pristine/test-modinfo/correct-author.txt @@ -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 index 0000000..b28b04f --- /dev/null +++ b/testsuite/rootfs-pristine/test-modinfo/correct-depends.txt @@ -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 index 0000000..e69de29 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modinfo/correct-description.txt diff --git a/testsuite/rootfs-pristine/test-modinfo/correct-filename.txt b/testsuite/rootfs-pristine/test-modinfo/correct-filename.txt new file mode 100644 index 0000000..bcd47c0 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modinfo/correct-filename.txt @@ -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 index 0000000..f79931d --- /dev/null +++ b/testsuite/rootfs-pristine/test-modinfo/correct-license.txt @@ -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 index 0000000..e69de29 --- /dev/null +++ b/testsuite/rootfs-pristine/test-modinfo/correct-parm.txt diff --git a/testsuite/rootfs-pristine/test-modinfo/correct.txt b/testsuite/rootfs-pristine/test-modinfo/correct.txt index 4a7a4ac..92ff247 100644 --- a/testsuite/rootfs-pristine/test-modinfo/correct.txt +++ b/testsuite/rootfs-pristine/test-modinfo/correct.txt @@ -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 Binary files differdeleted file mode 100644 index e5d2fb7..0000000 --- a/testsuite/rootfs-pristine/test-modinfo/ext4-i686.ko +++ /dev/null diff --git a/testsuite/rootfs-pristine/test-modinfo/ext4-ppc64.ko b/testsuite/rootfs-pristine/test-modinfo/ext4-ppc64.ko Binary files differdeleted file mode 100644 index cb02ed4..0000000 --- a/testsuite/rootfs-pristine/test-modinfo/ext4-ppc64.ko +++ /dev/null diff --git a/testsuite/rootfs-pristine/test-modinfo/ext4-s390x.ko b/testsuite/rootfs-pristine/test-modinfo/ext4-s390x.ko Binary files differdeleted file mode 100644 index 74c3799..0000000 --- a/testsuite/rootfs-pristine/test-modinfo/ext4-s390x.ko +++ /dev/null diff --git a/testsuite/rootfs-pristine/test-modinfo/ext4-x86_64.ko b/testsuite/rootfs-pristine/test-modinfo/ext4-x86_64.ko Binary files differdeleted file mode 100644 index ae96eef..0000000 --- a/testsuite/rootfs-pristine/test-modinfo/ext4-x86_64.ko +++ /dev/null diff --git a/testsuite/test-modinfo.c b/testsuite/test-modinfo.c index 317629c..9a57ea4 100644 --- a/testsuite/test-modinfo.c +++ b/testsuite/test-modinfo.c @@ -25,21 +25,47 @@ #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/", |