All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH]  device-drivers/zram: zram_lib: Fix modinfo's usage
@ 2020-09-17  8:19 Leo Yu-Chi Liang
  2020-09-17 13:51 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Leo Yu-Chi Liang @ 2020-09-17  8:19 UTC (permalink / raw)
  To: ltp

zram_lib uses the exit code of modinfo to determine the presence of zram module,
but the exit code does not have direct relation to it.

We could be missing zram module and modinfo still exits "successfully"
because it has done its job of informing the user zram is missing.

Such behavior would give confusing zram test report.
Without this patch, some of the system run LTP without zram module
would have a FAIL instead of CONF as a result.

Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
---
 testcases/kernel/device-drivers/zram/zram_lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/device-drivers/zram/zram_lib.sh b/testcases/kernel/device-drivers/zram/zram_lib.sh
index 3f4d1d55f..372b93990 100755
--- a/testcases/kernel/device-drivers/zram/zram_lib.sh
+++ b/testcases/kernel/device-drivers/zram/zram_lib.sh
@@ -211,5 +211,5 @@ zram_mount()
 	tst_res TPASS "mount of zram device(s) succeeded"
 }
 
-modinfo zram > /dev/null 2>&1 ||
+modinfo zram 2>&1 | grep filename > /dev/null 2>&1 ||
 	tst_brk TCONF "zram not configured in kernel"
-- 
2.17.0


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

* [LTP] [PATCH] device-drivers/zram: zram_lib: Fix modinfo's usage
  2020-09-17  8:19 [LTP] [PATCH] device-drivers/zram: zram_lib: Fix modinfo's usage Leo Yu-Chi Liang
@ 2020-09-17 13:51 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2020-09-17 13:51 UTC (permalink / raw)
  To: ltp

Hi!
> zram_lib uses the exit code of modinfo to determine the presence of zram module,
> but the exit code does not have direct relation to it.

What distribution is this? Where did the modinfo binary came from?

It works fine with modinfo from the kmod packages, see:

https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/tree/tools/modinfo.c#n463

-- 
Cyril Hrubis
chrubis@suse.cz

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

end of thread, other threads:[~2020-09-17 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-17  8:19 [LTP] [PATCH] device-drivers/zram: zram_lib: Fix modinfo's usage Leo Yu-Chi Liang
2020-09-17 13:51 ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.