Add test for simple search order in depmod
authorLucas De Marchi <lucas.demarchi@intel.com>
Wed, 19 Mar 2014 10:59:38 +0000 (07:59 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 19 Mar 2014 11:52:33 +0000 (08:52 -0300)
testsuite/rootfs-pristine/test-depmod/search-order-simple/etc/depmod.d/search.conf [new file with mode: 0644]
testsuite/rootfs-pristine/test-depmod/search-order-simple/lib/modules/4.4.4/correct-modules.dep [new file with mode: 0644]
testsuite/rootfs-pristine/test-depmod/search-order-simple/lib/modules/4.4.4/kernel/crypto/md5.ko.gz [new file with mode: 0644]
testsuite/rootfs-pristine/test-depmod/search-order-simple/lib/modules/4.4.4/updates/md5.ko.gz [new file with mode: 0644]
testsuite/test-depmod.c

diff --git a/testsuite/rootfs-pristine/test-depmod/search-order-simple/etc/depmod.d/search.conf b/testsuite/rootfs-pristine/test-depmod/search-order-simple/etc/depmod.d/search.conf
new file mode 100644 (file)
index 0000000..d17cafd
--- /dev/null
@@ -0,0 +1 @@
+search updates built-in
diff --git a/testsuite/rootfs-pristine/test-depmod/search-order-simple/lib/modules/4.4.4/correct-modules.dep b/testsuite/rootfs-pristine/test-depmod/search-order-simple/lib/modules/4.4.4/correct-modules.dep
new file mode 100644 (file)
index 0000000..d099dd0
--- /dev/null
@@ -0,0 +1 @@
+updates/md5.ko.gz:
diff --git a/testsuite/rootfs-pristine/test-depmod/search-order-simple/lib/modules/4.4.4/kernel/crypto/md5.ko.gz b/testsuite/rootfs-pristine/test-depmod/search-order-simple/lib/modules/4.4.4/kernel/crypto/md5.ko.gz
new file mode 100644 (file)
index 0000000..cf5ab6d
Binary files /dev/null and b/testsuite/rootfs-pristine/test-depmod/search-order-simple/lib/modules/4.4.4/kernel/crypto/md5.ko.gz differ
diff --git a/testsuite/rootfs-pristine/test-depmod/search-order-simple/lib/modules/4.4.4/updates/md5.ko.gz b/testsuite/rootfs-pristine/test-depmod/search-order-simple/lib/modules/4.4.4/updates/md5.ko.gz
new file mode 100644 (file)
index 0000000..cf5ab6d
Binary files /dev/null and b/testsuite/rootfs-pristine/test-depmod/search-order-simple/lib/modules/4.4.4/updates/md5.ko.gz differ
index e21b4f0..fe1d502 100644 (file)
@@ -54,9 +54,36 @@ static DEFINE_TEST(depmod_modules_order_for_compressed,
                },
        });
 
+#define SEARCH_ORDER_SIMPLE_ROOTFS TESTSUITE_ROOTFS "test-depmod/search-order-simple"
+static noreturn int depmod_search_order_simple(const struct test *t)
+{
+       const char *progname = ABS_TOP_BUILDDIR "/tools/depmod";
+       const char *const args[] = {
+               progname,
+               NULL,
+       };
+
+       test_spawn_prog(progname, args);
+       exit(EXIT_FAILURE);
+}
+static DEFINE_TEST(depmod_search_order_simple,
+       .description = "check if depmod honor search order in config",
+       .config = {
+               [TC_UNAME_R] = "4.4.4",
+               [TC_ROOTFS] = SEARCH_ORDER_SIMPLE_ROOTFS,
+       },
+       .output = {
+               .files = (const struct keyval[]) {
+                       { SEARCH_ORDER_SIMPLE_ROOTFS "/lib/modules/4.4.4/correct-modules.dep",
+                         SEARCH_ORDER_SIMPLE_ROOTFS "/lib/modules/4.4.4/modules.dep" },
+                       { }
+               },
+       });
+
 
 static const struct test *tests[] = {
        &sdepmod_modules_order_for_compressed,
+       &sdepmod_search_order_simple,
        NULL,
 };