public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] memcg_lib.sh: fix the shmmax value comparison
Date: Wed, 22 Nov 2017 15:38:47 +0800	[thread overview]
Message-ID: <20171122073848.6172-1-liwang@redhat.com> (raw)

The value of /proc/sys/kernel/shmmax is 18446744073692774399 which Dash/Bash
fails to compare to the $HUGEPAGESIZE value and report error:

  memcg_lib.sh: line 81: [: 18446744073692774399: integer expression expected

Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/controllers/memcg/functional/memcg_lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
index d4724c3..6a6af85 100755
--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
@@ -78,7 +78,7 @@ TST_CLEANUP=cleanup
 shmmax_setup()
 {
 	shmmax=`cat /proc/sys/kernel/shmmax`
-	if [ $shmmax -lt $HUGEPAGESIZE ]; then
+	if [ $(echo "$shmmax < $HUGEPAGESIZE" |bc) -eq 1 ]; then
 		ROD echo "$HUGEPAGESIZE" \> /proc/sys/kernel/shmmax
 	fi
 }
-- 
2.9.3


             reply	other threads:[~2017-11-22  7:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22  7:38 Li Wang [this message]
2017-11-22  7:38 ` [LTP] [PATCH 2/2] cgroup: fix mount errors in cgroup subsys Li Wang
2018-12-13 16:24   ` Petr Vorel
2017-11-30 14:07 ` [LTP] [PATCH 1/2] memcg_lib.sh: fix the shmmax value comparison Cyril Hrubis

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=20171122073848.6172-1-liwang@redhat.com \
    --to=liwang@redhat.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