]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: Simplify defines for depmod -m test
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 19 Nov 2024 07:05:47 +0000 (01:05 -0600)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 21 Nov 2024 04:25:30 +0000 (22:25 -0600)
Simplify the defines so it's easier to extend the test for another
directory.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/243
scripts/setup-rootfs.sh
testsuite/rootfs-pristine/test-depmod/another-moddir/correct-modules.dep [moved from testsuite/rootfs-pristine/test-depmod/another-moddir/foobar/4.4.4/correct-modules.dep with 100% similarity]
testsuite/test-depmod.c

index 92c5d2dd8e69a77d663440330c11a94bc7900ce2..4e2194ee5e4700e10842dce8e025bc85038fd563 100755 (executable)
@@ -8,7 +8,6 @@ MODULE_PLAYGROUND=$3
 CONFIG_H=$4
 SYSCONFDIR=$5
 MODULE_DIRECTORY=$6
-ANOTHER_MODULE_DIRECTORY=/foobar
 
 # create rootfs from rootfs-pristine
 
@@ -104,7 +103,7 @@ map=(
     ["test-depmod/modules-outdir$MODULE_DIRECTORY/4.4.4/kernel/drivers/block/cciss.ko"]="mod-fake-cciss.ko"
     ["test-depmod/modules-outdir$MODULE_DIRECTORY/4.4.4/kernel/drivers/scsi/hpsa.ko"]="mod-fake-hpsa.ko"
     ["test-depmod/modules-outdir$MODULE_DIRECTORY/4.4.4/kernel/drivers/scsi/scsi_mod.ko"]="mod-fake-scsi-mod.ko"
-    ["test-depmod/another-moddir$ANOTHER_MODULE_DIRECTORY/4.4.4/kernel/"]="mod-simple.ko"
+    ["test-depmod/another-moddir/foobar/4.4.4/kernel/"]="mod-simple.ko"
     # TODO: add cross-compiled modules to the test
     ["test-modinfo/mod-simple.ko"]="mod-simple.ko"
     ["test-modinfo/mod-simple-sha1.ko"]="mod-simple.ko"
index 0b4cfd2af13f61756eddef5e52d82f1e63deb389..dd7ff9e6d00c01a4d1882e2fb75f07d199f78400 100644 (file)
@@ -90,8 +90,6 @@ DEFINE_TEST(depmod_search_order_simple,
 
 #define ANOTHER_MODDIR "/foobar"
 #define MODULES_ANOTHER_MODDIR_ROOTFS TESTSUITE_ROOTFS "test-depmod/another-moddir"
-#define MODULES_ANOTHER_MODDIR_LIB_MODULES \
-       MODULES_ANOTHER_MODDIR_ROOTFS ANOTHER_MODDIR "/" MODULES_UNAME
 static noreturn int depmod_another_moddir(const struct test *t)
 {
        EXEC_DEPMOD("-m", ANOTHER_MODDIR);
@@ -105,8 +103,8 @@ DEFINE_TEST(depmod_another_moddir,
        },
        .output = {
                .files = (const struct keyval[]) {
-                       { MODULES_ANOTHER_MODDIR_LIB_MODULES "/correct-modules.dep",
-                         MODULES_ANOTHER_MODDIR_LIB_MODULES "/modules.dep" },
+                       { MODULES_ANOTHER_MODDIR_ROOTFS "/correct-modules.dep",
+                         MODULES_ANOTHER_MODDIR_ROOTFS ANOTHER_MODDIR "/" MODULES_UNAME "/modules.dep" },
                        { },
                },
        });