linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] testsuite: use skip for modules-order-compressed
@ 2021-01-28 14:47 Lucas De Marchi
  2021-01-28 14:47 ` [PATCH 2/2] testsuite: move zstd-compressed module to a separate test Lucas De Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas De Marchi @ 2021-01-28 14:47 UTC (permalink / raw)
  To: linux-modules; +Cc: Michal Suchánek, Petr Vorel

Instead of removing the test completely, use the new skip infra to skip
that test.
---
 testsuite/test-depmod.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testsuite/test-depmod.c b/testsuite/test-depmod.c
index 261559c..d52602d 100644
--- a/testsuite/test-depmod.c
+++ b/testsuite/test-depmod.c
@@ -25,7 +25,6 @@
 
 #include "testsuite.h"
 
-#ifdef ENABLE_ZLIB
 #define MODULES_ORDER_UNAME "4.4.4"
 #define MODULES_ORDER_ROOTFS TESTSUITE_ROOTFS "test-depmod/modules-order-compressed"
 #define MODULES_ORDER_LIB_MODULES MODULES_ORDER_ROOTFS "/lib/modules/" MODULES_ORDER_UNAME
@@ -42,7 +41,8 @@ static noreturn int depmod_modules_order_for_compressed(const struct test *t)
 }
 
 DEFINE_TEST(depmod_modules_order_for_compressed,
-#if defined(KMOD_SYSCONFDIR_NOT_ETC)
+#if defined(KMOD_SYSCONFDIR_NOT_ETC) || \
+    !defined(ENABLE_ZLIB)
         .skip = true,
 #endif
 	.description = "check if depmod let aliases in right order when using compressed modules",
-- 
2.30.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] testsuite: move zstd-compressed module to a separate test
  2021-01-28 14:47 [PATCH 1/2] testsuite: use skip for modules-order-compressed Lucas De Marchi
@ 2021-01-28 14:47 ` Lucas De Marchi
       [not found]   ` <20210128191000.GI6564@kitsune.suse.cz>
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas De Marchi @ 2021-01-28 14:47 UTC (permalink / raw)
  To: linux-modules; +Cc: Michal Suchánek, Petr Vorel

Move it to a separate test so we can skip it if zstd is not enabled at
build time.
---
 testsuite/populate-modules.sh                 |  4 +--
 .../lib/modules/4.4.4/correct-modules.alias   | 17 +++++++++++
 .../lib/modules/4.4.4/modules.builtin         |  0
 .../lib/modules/4.4.4/modules.order           |  2 ++
 .../lib/modules/4.4.4/correct-modules.alias   | 16 ----------
 .../lib/modules/4.4.4/modules.order           |  3 --
 testsuite/test-depmod.c                       | 30 +++++++++++++++++++
 7 files changed, 51 insertions(+), 21 deletions(-)
 create mode 100644 testsuite/rootfs-pristine/test-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/correct-modules.alias
 create mode 100644 testsuite/rootfs-pristine/test-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/modules.builtin
 create mode 100644 testsuite/rootfs-pristine/test-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/modules.order

diff --git a/testsuite/populate-modules.sh b/testsuite/populate-modules.sh
index b0cc932..22d207c 100755
--- a/testsuite/populate-modules.sh
+++ b/testsuite/populate-modules.sh
@@ -51,8 +51,8 @@ map=(
     ["test-modprobe/module-param-kcmdline/lib/modules/4.4.4/kernel/"]="mod-simple.ko"
     ["test-modprobe/external/lib/modules/external/"]="mod-simple.ko"
     ["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-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/kernel/drivers/scsi/hpsa.ko"]="mod-fake-hpsa.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"
@@ -70,7 +70,7 @@ gzip_array=(
     )
 
 zstd_array=(
-    "test-depmod/modules-order-compressed/lib/modules/4.4.4/kernel/drivers/scsi/hpsa.ko"
+    "test-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/kernel/drivers/scsi/hpsa.ko"
     )
 
 attach_sha256_array=(
diff --git a/testsuite/rootfs-pristine/test-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/correct-modules.alias b/testsuite/rootfs-pristine/test-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/correct-modules.alias
new file mode 100644
index 0000000..8542d25
--- /dev/null
+++ b/testsuite/rootfs-pristine/test-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/correct-modules.alias
@@ -0,0 +1,17 @@
+# Aliases extracted from modules themselves.
+alias pci:v0000103Cd*sv*sd*bc01sc04i* hpsa
+alias pci:v0000103Cd0000323Bsv0000103Csd00003356bc*sc*i* hpsa
+alias pci:v0000103Cd0000323Bsv0000103Csd00003355bc*sc*i* hpsa
+alias pci:v0000103Cd0000323Bsv0000103Csd00003354bc*sc*i* hpsa
+alias pci:v0000103Cd0000323Bsv0000103Csd00003353bc*sc*i* hpsa
+alias pci:v0000103Cd0000323Bsv0000103Csd00003352bc*sc*i* hpsa
+alias pci:v0000103Cd0000323Bsv0000103Csd00003351bc*sc*i* hpsa
+alias pci:v0000103Cd0000323Bsv0000103Csd00003350bc*sc*i* hpsa
+alias pci:v0000103Cd0000323Asv0000103Csd00003233bc*sc*i* hpsa
+alias pci:v0000103Cd0000323Asv0000103Csd0000324Bbc*sc*i* hpsa
+alias pci:v0000103Cd0000323Asv0000103Csd0000324Abc*sc*i* hpsa
+alias pci:v0000103Cd0000323Asv0000103Csd00003249bc*sc*i* hpsa
+alias pci:v0000103Cd0000323Asv0000103Csd00003247bc*sc*i* hpsa
+alias pci:v0000103Cd0000323Asv0000103Csd00003245bc*sc*i* hpsa
+alias pci:v0000103Cd0000323Asv0000103Csd00003243bc*sc*i* hpsa
+alias pci:v0000103Cd0000323Asv0000103Csd00003241bc*sc*i* hpsa
diff --git a/testsuite/rootfs-pristine/test-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/modules.builtin b/testsuite/rootfs-pristine/test-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/modules.builtin
new file mode 100644
index 0000000..e69de29
diff --git a/testsuite/rootfs-pristine/test-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/modules.order b/testsuite/rootfs-pristine/test-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/modules.order
new file mode 100644
index 0000000..c8b8102
--- /dev/null
+++ b/testsuite/rootfs-pristine/test-depmod/modules-order-compressed-zstd/lib/modules/4.4.4/modules.order
@@ -0,0 +1,2 @@
+#2137
+kernel/drivers/scsi/hpsa.ko
diff --git a/testsuite/rootfs-pristine/test-depmod/modules-order-compressed/lib/modules/4.4.4/correct-modules.alias b/testsuite/rootfs-pristine/test-depmod/modules-order-compressed/lib/modules/4.4.4/correct-modules.alias
index 5675329..0ac4ea2 100644
--- a/testsuite/rootfs-pristine/test-depmod/modules-order-compressed/lib/modules/4.4.4/correct-modules.alias
+++ b/testsuite/rootfs-pristine/test-depmod/modules-order-compressed/lib/modules/4.4.4/correct-modules.alias
@@ -19,19 +19,3 @@ alias pci:v00000E11d0000B178sv00000E11sd00004083bc*sc*i* cciss
 alias pci:v00000E11d0000B178sv00000E11sd00004082bc*sc*i* cciss
 alias pci:v00000E11d0000B178sv00000E11sd00004080bc*sc*i* cciss
 alias pci:v00000E11d0000B060sv00000E11sd00004070bc*sc*i* cciss
-alias pci:v0000103Cd*sv*sd*bc01sc04i* hpsa
-alias pci:v0000103Cd0000323Bsv0000103Csd00003356bc*sc*i* hpsa
-alias pci:v0000103Cd0000323Bsv0000103Csd00003355bc*sc*i* hpsa
-alias pci:v0000103Cd0000323Bsv0000103Csd00003354bc*sc*i* hpsa
-alias pci:v0000103Cd0000323Bsv0000103Csd00003353bc*sc*i* hpsa
-alias pci:v0000103Cd0000323Bsv0000103Csd00003352bc*sc*i* hpsa
-alias pci:v0000103Cd0000323Bsv0000103Csd00003351bc*sc*i* hpsa
-alias pci:v0000103Cd0000323Bsv0000103Csd00003350bc*sc*i* hpsa
-alias pci:v0000103Cd0000323Asv0000103Csd00003233bc*sc*i* hpsa
-alias pci:v0000103Cd0000323Asv0000103Csd0000324Bbc*sc*i* hpsa
-alias pci:v0000103Cd0000323Asv0000103Csd0000324Abc*sc*i* hpsa
-alias pci:v0000103Cd0000323Asv0000103Csd00003249bc*sc*i* hpsa
-alias pci:v0000103Cd0000323Asv0000103Csd00003247bc*sc*i* hpsa
-alias pci:v0000103Cd0000323Asv0000103Csd00003245bc*sc*i* hpsa
-alias pci:v0000103Cd0000323Asv0000103Csd00003243bc*sc*i* hpsa
-alias pci:v0000103Cd0000323Asv0000103Csd00003241bc*sc*i* hpsa
diff --git a/testsuite/rootfs-pristine/test-depmod/modules-order-compressed/lib/modules/4.4.4/modules.order b/testsuite/rootfs-pristine/test-depmod/modules-order-compressed/lib/modules/4.4.4/modules.order
index 4b64309..47a10c4 100644
--- a/testsuite/rootfs-pristine/test-depmod/modules-order-compressed/lib/modules/4.4.4/modules.order
+++ b/testsuite/rootfs-pristine/test-depmod/modules-order-compressed/lib/modules/4.4.4/modules.order
@@ -2,6 +2,3 @@
 kernel/drivers/block/cciss.ko
 #2094
 kernel/drivers/scsi/scsi_mod.ko
-#2137
-kernel/drivers/scsi/hpsa.ko
-
diff --git a/testsuite/test-depmod.c b/testsuite/test-depmod.c
index d52602d..299162c 100644
--- a/testsuite/test-depmod.c
+++ b/testsuite/test-depmod.c
@@ -28,6 +28,8 @@
 #define MODULES_ORDER_UNAME "4.4.4"
 #define MODULES_ORDER_ROOTFS TESTSUITE_ROOTFS "test-depmod/modules-order-compressed"
 #define MODULES_ORDER_LIB_MODULES MODULES_ORDER_ROOTFS "/lib/modules/" MODULES_ORDER_UNAME
+#define MODULES_ORDER_ROOTFS_ZSTD TESTSUITE_ROOTFS "test-depmod/modules-order-compressed-zstd"
+#define MODULES_ORDER_LIB_MODULES_ZSTD MODULES_ORDER_ROOTFS_ZSTD "/lib/modules/" MODULES_ORDER_UNAME
 static noreturn int depmod_modules_order_for_compressed(const struct test *t)
 {
 	const char *progname = ABS_TOP_BUILDDIR "/tools/depmod";
@@ -57,7 +59,35 @@ DEFINE_TEST(depmod_modules_order_for_compressed,
 			{ }
 		},
 	});
+
+static noreturn int depmod_modules_order_for_compressed_zstd(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_modules_order_for_compressed_zstd,
+#if defined(KMOD_SYSCONFDIR_NOT_ETC) || \
+    !defined(ENABLE_ZSTD)
+        .skip = true,
 #endif
+	.description = "check if depmod let aliases in right order when using compressed modules (ZSTD)",
+	.config = {
+		[TC_UNAME_R] = MODULES_ORDER_UNAME,
+		[TC_ROOTFS] = MODULES_ORDER_ROOTFS_ZSTD,
+	},
+	.output = {
+		.files = (const struct keyval[]) {
+			{ MODULES_ORDER_LIB_MODULES_ZSTD "/correct-modules.alias",
+			  MODULES_ORDER_LIB_MODULES_ZSTD "/modules.alias" },
+			{ }
+		},
+	});
 
 #define SEARCH_ORDER_SIMPLE_ROOTFS TESTSUITE_ROOTFS "test-depmod/search-order-simple"
 static noreturn int depmod_search_order_simple(const struct test *t)
-- 
2.30.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] testsuite: move zstd-compressed module to a separate test
       [not found]   ` <20210128191000.GI6564@kitsune.suse.cz>
@ 2021-01-28 20:54     ` Petr Vorel
  0 siblings, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2021-01-28 20:54 UTC (permalink / raw)
  To: Michal Suchánek; +Cc: Lucas De Marchi, linux-modules

Hi Lucas, Michal,

> Hello,

> I think a simpler approach would be to not compress the module list for
> which the decompressor is not configured in populate-modules.sh Then the
> depmod test can run unchanged, and the modules will only be compressed
> when support for the compression is enabled.
+1

> The issue with this is that populate-modules.sh does not have any input
> for these configure settings - they are in config.h but that's not very
> useble for a shell script.
How about grep for them in '#define KMOD_FEATURES ...' line. Everything is
there:
#define KMOD_FEATURES "-ZSTD +XZ -ZLIB -LIBCRYPTO -EXPERIMENTAL"

Kind regards,
Petr

> Thanks

> Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-28 20:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 14:47 [PATCH 1/2] testsuite: use skip for modules-order-compressed Lucas De Marchi
2021-01-28 14:47 ` [PATCH 2/2] testsuite: move zstd-compressed module to a separate test Lucas De Marchi
     [not found]   ` <20210128191000.GI6564@kitsune.suse.cz>
2021-01-28 20:54     ` Petr Vorel

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox