From: Lucas De Marchi Date: Tue, 19 Nov 2024 07:05:47 +0000 (-0600) Subject: testsuite: Simplify defines for depmod -m test X-Git-Tag: v34~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8b2455f40f43cda436ca4ce764beb6932bd47a5;p=thirdparty%2Fkmod.git testsuite: Simplify defines for depmod -m test Simplify the defines so it's easier to extend the test for another directory. Signed-off-by: Lucas De Marchi Reviewed-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/243 --- diff --git a/scripts/setup-rootfs.sh b/scripts/setup-rootfs.sh index 92c5d2dd..4e2194ee 100755 --- a/scripts/setup-rootfs.sh +++ b/scripts/setup-rootfs.sh @@ -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" diff --git a/testsuite/rootfs-pristine/test-depmod/another-moddir/foobar/4.4.4/correct-modules.dep b/testsuite/rootfs-pristine/test-depmod/another-moddir/correct-modules.dep similarity index 100% rename from testsuite/rootfs-pristine/test-depmod/another-moddir/foobar/4.4.4/correct-modules.dep rename to testsuite/rootfs-pristine/test-depmod/another-moddir/correct-modules.dep diff --git a/testsuite/test-depmod.c b/testsuite/test-depmod.c index 0b4cfd2a..dd7ff9e6 100644 --- a/testsuite/test-depmod.c +++ b/testsuite/test-depmod.c @@ -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" }, { }, }, });