public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] device-drivers/zram: Fix false-judgement on zram's presence
@ 2021-01-14  7:46 Leo Liang
  2021-01-14 15:15 ` Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Liang @ 2021-01-14  7:46 UTC (permalink / raw)
  To: ltp

Date: Thu, 14 Jan 2021 15:27:34 +0800
From: Leo Yu-Chi Liang <ycliang@andestech.com>
Subject: [LTP][PATCH 1/1] device-drivers/zram: Fix false-judgement on zram's presence

zram_lib.sh uses the return value of modinfo to check if zram module exists,
but the behavior of modinfo implemented by busybox is different.

The busybox-implemented modinfo would also return true (code: 0)
even if zram module is not present,
so grep the info that only shows when the module exists.

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..04d4a4da6 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 | grep "filename" > /dev/null 2>&1 ||
 	tst_brk TCONF "zram not configured in kernel"
-- 
2.17.0

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

end of thread, other threads:[~2021-01-15  9:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-14  7:46 [LTP] [PATCH 1/1] device-drivers/zram: Fix false-judgement on zram's presence Leo Liang
2021-01-14 15:15 ` Petr Vorel
2021-01-15  8:54   ` Leo Liang
2021-01-15  9:38     ` Petr Vorel

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