linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: linux-modules@vger.kernel.org
Cc: "Michal Suchánek" <msuchanek@suse.de>,
	"Petr Vorel" <petr.vorel@gmail.com>
Subject: [PATCH 2/2] testsuite: move zstd-compressed module to a separate test
Date: Thu, 28 Jan 2021 06:47:24 -0800	[thread overview]
Message-ID: <20210128144724.102147-2-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20210128144724.102147-1-lucas.demarchi@intel.com>

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


  reply	other threads:[~2021-01-28 14:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [not found]   ` <20210128191000.GI6564@kitsune.suse.cz>
2021-01-28 20:54     ` [PATCH 2/2] testsuite: move zstd-compressed module to a separate test Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210128144724.102147-2-lucas.demarchi@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=linux-modules@vger.kernel.org \
    --cc=msuchanek@suse.de \
    --cc=petr.vorel@gmail.com \
    --subject='Re: [PATCH 2/2] testsuite: move zstd-compressed module to a separate test' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).