public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] memcg_lib.sh: fix the shmmax value comparison
@ 2017-11-22  7:38 Li Wang
  2017-11-22  7:38 ` [LTP] [PATCH 2/2] cgroup: fix mount errors in cgroup subsys Li Wang
  2017-11-30 14:07 ` [LTP] [PATCH 1/2] memcg_lib.sh: fix the shmmax value comparison Cyril Hrubis
  0 siblings, 2 replies; 4+ messages in thread
From: Li Wang @ 2017-11-22  7:38 UTC (permalink / raw)
  To: ltp

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


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

end of thread, other threads:[~2018-12-13 16:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-22  7:38 [LTP] [PATCH 1/2] memcg_lib.sh: fix the shmmax value comparison Li Wang
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

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