@@ -28,6 +28,8 @@ map=(
["test-depmod/search-order-external-last/lib/modules/4.4.4/foo/"]="mod-simple.ko"
["test-depmod/search-order-external-last/lib/modules/4.4.4/foobar/"]="mod-simple.ko"
["test-depmod/search-order-external-last/lib/modules/external/"]="mod-simple.ko"
+ ["test-depmod/search-order-override/lib/modules/4.4.4/foo/"]="mod-simple.ko"
+ ["test-depmod/search-order-override/lib/modules/4.4.4/override/"]="mod-simple.ko"
["test-dependencies/lib/modules/4.0.20-kmod/kernel/fs/foo/"]="mod-foo-b.ko"
["test-dependencies/lib/modules/4.0.20-kmod/kernel/"]="mod-foo-c.ko"
["test-dependencies/lib/modules/4.0.20-kmod/kernel/lib/"]="mod-foo-a.ko"
new file mode 100644
@@ -0,0 +1 @@
+override mod-simple 4.4.4 override
new file mode 100644
@@ -0,0 +1 @@
+search foo built-in
new file mode 100644
@@ -0,0 +1 @@
+override/mod-simple.ko:
@@ -183,4 +183,30 @@ DEFINE_TEST(depmod_search_order_external_last,
},
});
+#define SEARCH_ORDER_OVERRIDE_ROOTFS TESTSUITE_ROOTFS "test-depmod/search-order-override"
+static noreturn int depmod_search_order_override(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);
+}
+DEFINE_TEST(depmod_search_order_override,
+ .description = "check if depmod honor override keyword",
+ .config = {
+ [TC_UNAME_R] = "4.4.4",
+ [TC_ROOTFS] = SEARCH_ORDER_OVERRIDE_ROOTFS,
+ },
+ .output = {
+ .files = (const struct keyval[]) {
+ { SEARCH_ORDER_OVERRIDE_ROOTFS "/lib/modules/4.4.4/correct-modules.dep",
+ SEARCH_ORDER_OVERRIDE_ROOTFS "/lib/modules/4.4.4/modules.dep" },
+ { }
+ },
+ });
+
TESTSUITE_MAIN();
Simple test to check if depmod honors override keyword. Uses mod-simple.ko for foo/ and override/ directories, search.conf to search in foo and built-in and simple override configuration: override mod-simple 4.4.4 override The resulting modules.dep should point to the override directory. Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com> --- testsuite/populate-modules.sh | 2 ++ .../etc/depmod.d/override.conf | 1 + .../search-order-override/etc/depmod.d/search.conf | 1 + .../lib/modules/4.4.4/correct-modules.dep | 1 + testsuite/test-depmod.c | 26 ++++++++++++++++++++++ 5 files changed, 31 insertions(+) create mode 100644 testsuite/rootfs-pristine/test-depmod/search-order-override/etc/depmod.d/override.conf create mode 100644 testsuite/rootfs-pristine/test-depmod/search-order-override/etc/depmod.d/search.conf create mode 100644 testsuite/rootfs-pristine/test-depmod/search-order-override/lib/modules/4.4.4/correct-modules.dep