Linux-Modules Archive on lore.kernel.org
 help / Atom feed
* [PATCH] testsuite: add simple test for --show-exports
@ 2018-11-13 18:46 Lucas De Marchi
  2018-11-13 19:34 ` Yauheni Kaliuta
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas De Marchi @ 2018-11-13 18:46 UTC (permalink / raw)
  To: linux-modules; +Cc: ykaliuta

---
 testsuite/populate-modules.sh                 |  1 +
 .../test-modprobe/show-exports/correct.txt    |  1 +
 testsuite/test-modprobe.c                     | 22 +++++++++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 testsuite/rootfs-pristine/test-modprobe/show-exports/correct.txt

diff --git a/testsuite/populate-modules.sh b/testsuite/populate-modules.sh
index b77e71e..ba68a69 100755
--- a/testsuite/populate-modules.sh
+++ b/testsuite/populate-modules.sh
@@ -39,6 +39,7 @@ map=(
     ["test-modprobe/show-depends/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko"
     ["test-modprobe/show-depends/lib/modules/4.4.4/kernel/mod-loop-b.ko"]="mod-loop-b.ko"
     ["test-modprobe/show-depends/lib/modules/4.4.4/kernel/mod-simple.ko"]="mod-simple.ko"
+    ["test-modprobe/show-exports/mod-loop-a.ko"]="mod-loop-a.ko"
     ["test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko"
     ["test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/mod-loop-b.ko"]="mod-loop-b.ko"
     ["test-modprobe/install-cmd-loop/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko"
diff --git a/testsuite/rootfs-pristine/test-modprobe/show-exports/correct.txt b/testsuite/rootfs-pristine/test-modprobe/show-exports/correct.txt
new file mode 100644
index 0000000..bc2d045
--- /dev/null
+++ b/testsuite/rootfs-pristine/test-modprobe/show-exports/correct.txt
@@ -0,0 +1 @@
+0x00000000	printA
diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c
index ee9d82d..52a6621 100644
--- a/testsuite/test-modprobe.c
+++ b/testsuite/test-modprobe.c
@@ -95,6 +95,28 @@ DEFINE_TEST(modprobe_show_alias_to_none,
 	);
 
 
+static noreturn int modprobe_show_exports(const struct test *t)
+{
+	const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
+	const char *const args[] = {
+		progname,
+		"--show-exports", "--quiet", "/mod-loop-a.ko",
+		NULL,
+	};
+
+	test_spawn_prog(progname, args);
+	exit(EXIT_FAILURE);
+}
+DEFINE_TEST(modprobe_show_exports,
+	.description = "check if modprobe --show-depends doesn't explode with an alias to nothing",
+	.config = {
+		[TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/show-exports",
+	},
+	.output = {
+		.out = TESTSUITE_ROOTFS "test-modprobe/show-exports/correct.txt",
+	});
+
+
 static noreturn int modprobe_builtin(const struct test *t)
 {
 	const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
-- 
2.19.1.1.g56c4683e68


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

* Re: [PATCH] testsuite: add simple test for --show-exports
  2018-11-13 18:46 [PATCH] testsuite: add simple test for --show-exports Lucas De Marchi
@ 2018-11-13 19:34 ` Yauheni Kaliuta
  0 siblings, 0 replies; 2+ messages in thread
From: Yauheni Kaliuta @ 2018-11-13 19:34 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-modules

Hi, Lucas!

>>>>> On Tue, 13 Nov 2018 10:46:40 -0800, Lucas De Marchi  wrote:

 > ---
 >  testsuite/populate-modules.sh                 |  1 +
 >  .../test-modprobe/show-exports/correct.txt    |  1 +
 >  testsuite/test-modprobe.c                     | 22 +++++++++++++++++++
 >  3 files changed, 24 insertions(+)
 >  create mode 100644 testsuite/rootfs-pristine/test-modprobe/show-exports/correct.txt

 > diff --git a/testsuite/populate-modules.sh b/testsuite/populate-modules.sh
 > index b77e71e..ba68a69 100755
 > --- a/testsuite/populate-modules.sh
 > +++ b/testsuite/populate-modules.sh
 > @@ -39,6 +39,7 @@ map=(
 >      ["test-modprobe/show-depends/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko"
 >      ["test-modprobe/show-depends/lib/modules/4.4.4/kernel/mod-loop-b.ko"]="mod-loop-b.ko"
 >      ["test-modprobe/show-depends/lib/modules/4.4.4/kernel/mod-simple.ko"]="mod-simple.ko"
 > +    ["test-modprobe/show-exports/mod-loop-a.ko"]="mod-loop-a.ko"
 >      ["test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko"
 >      ["test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/mod-loop-b.ko"]="mod-loop-b.ko"
 >      ["test-modprobe/install-cmd-loop/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko"
 > diff --git a/testsuite/rootfs-pristine/test-modprobe/show-exports/correct.txt b/testsuite/rootfs-pristine/test-modprobe/show-exports/correct.txt
 > new file mode 100644
 > index 0000000..bc2d045
 > --- /dev/null
 > +++ b/testsuite/rootfs-pristine/test-modprobe/show-exports/correct.txt
 > @@ -0,0 +1 @@
 > +0x00000000	printA

I'm afraid, it won't work if your kernel is built with
MODVERSIONS enabled.

 > diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c
 > index ee9d82d..52a6621 100644
 > --- a/testsuite/test-modprobe.c
 > +++ b/testsuite/test-modprobe.c
 > @@ -95,6 +95,28 @@ DEFINE_TEST(modprobe_show_alias_to_none,
 >  	);
 
 
 > +static noreturn int modprobe_show_exports(const struct test *t)
 > +{
 > +	const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
 > +	const char *const args[] = {
 > +		progname,
 > +		"--show-exports", "--quiet", "/mod-loop-a.ko",
 > +		NULL,
 > +	};
 > +
 > +	test_spawn_prog(progname, args);
 > +	exit(EXIT_FAILURE);
 > +}
 > +DEFINE_TEST(modprobe_show_exports,
 > +	.description = "check if modprobe --show-depends doesn't explode with an alias to nothing",
 > +	.config = {
 > +		[TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/show-exports",
 > +	},
 > +	.output = {
 > +		.out = TESTSUITE_ROOTFS "test-modprobe/show-exports/correct.txt",
 > +	});
 > +
 > +
 >  static noreturn int modprobe_builtin(const struct test *t)
 >  {
 >  	const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
 > -- 
 > 2.19.1.1.g56c4683e68


-- 
WBR,
Yauheni Kaliuta

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13 18:46 [PATCH] testsuite: add simple test for --show-exports Lucas De Marchi
2018-11-13 19:34 ` Yauheni Kaliuta

Linux-Modules Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-modules/0 linux-modules/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-modules linux-modules/ https://lore.kernel.org/linux-modules \
		linux-modules@vger.kernel.org linux-modules@archiver.kernel.org
	public-inbox-index linux-modules


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-modules


AGPL code for this site: git clone https://public-inbox.org/ public-inbox