public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Leo Liang <ycliang@andestech.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/1] device-drivers/zram: Fix false-judgement on zram's presence
Date: Thu, 14 Jan 2021 15:46:03 +0800	[thread overview]
Message-ID: <20210114074603.GB32318@andestech.com> (raw)

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

             reply	other threads:[~2021-01-14  7:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14  7:46 Leo Liang [this message]
2021-01-14 15:15 ` [LTP] [PATCH 1/1] device-drivers/zram: Fix false-judgement on zram's presence Petr Vorel
2021-01-15  8:54   ` Leo Liang
2021-01-15  9:38     ` 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=20210114074603.GB32318@andestech.com \
    --to=ycliang@andestech.com \
    --cc=ltp@lists.linux.it \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox