Skip to contentSkip to conversation

fixing memcg_control

LTP Yuki Yao 2 participants 2 messages Mar 11, 2010

lore
Share & tools
lore

Yuki Yao

author
#0 lore raw

Hi,

I found following problem about "memcg_control" test.
---------
/opt/ltp/testcases/bin/memcg_control_test.sh: line 30: [: : integer expression expected
----------

This happens because of following process.
[ memcg_control_test.sh: line 30 ]
---------
if [ "$(grep -w memory /proc/cgroups | cut -f4)" -ne "1" ]; then
echo "WARNING:"
echo "Either kernel does not support memory resource controller or
feature not ena bled"
echo "Skipping all memcg_control testcases...."
exit 0
fi
---------

"$(grep -w memory /proc/cgroups | cut -f4)" can't comparable with "1" if "$(grep -w memory /proc/cgroups | cut -f4)" = nothing.

How about fixing like the other "memcg" tests?

Index: ./testcases/kernel/controllers/memcg/control/memcg_control_test.sh
==============================
---
/home/LTP/ltp-dev-20100311/testcases/kernel/controllers/memcg/control/memcg_
control_test.sh.org 2010-03-11 11:31:07.000000000 +0900
+++
/home/LTP/ltp-dev-20100311/testcases/kernel/controllers/memcg/control/memcg_
control_test.sh 2010-03-11 11:32:21.000000000 +0900
@@ -27,7 +27,7 @@
##
##

############################################################################
####

-if [ "$(grep -w memory /proc/cgroups | cut -f4)" -ne "1" ]; then +if [ "x$(grep -w memory /proc/cgroups | cut -f4)" != "x1" ]; then
echo "WARNING:"
echo "Either kernel does not support memory resource controller or
feature not enabled"
echo "Skipping all memcg_control testcases...."

Thanks,
-Yuki Yao

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 44 lines · Yuki Yao

Hi,

I found following problem about "memcg_control" test.
---------
/opt/ltp/testcases/bin/memcg_control_test.sh: line 30: [: : integer expression expected
----------

This happens because of following process.
[ memcg_control_test.sh: line 30 ]
---------
if [ "$(grep -w memory /proc/cgroups | cut -f4)" -ne "1" ]; then echo "WARNING:"
       echo "Either kernel does not support memory resource controller or feature not ena bled"
       echo "Skipping all memcg_control testcases...."
       exit 0
fi
---------

"$(grep -w memory /proc/cgroups | cut -f4)" can't comparable with "1" if "$(grep -w memory /proc/cgroups | cut -f4)" = nothing.

How about fixing like the other "memcg" tests?

Index: ./testcases/kernel/controllers/memcg/control/memcg_control_test.sh
==============================
---
/home/LTP/ltp-dev-20100311/testcases/kernel/controllers/memcg/control/memcg_ control_test.sh.org     2010-03-11 11:31:07.000000000 +0900
+++
/home/LTP/ltp-dev-20100311/testcases/kernel/controllers/memcg/control/memcg_ control_test.sh 2010-03-11 11:32:21.000000000 +0900

(quoted diff) +1 -1
@@ -27,7 +27,7 @@
  ##
 ##
 
 ############################################################################
 ####
 
-if [ "$(grep -w memory /proc/cgroups | cut -f4)" -ne "1" ]; then
+if [ "x$(grep -w memory /proc/cgroups | cut -f4)" != "x1" ]; then
Quoted 4 lines

       echo "WARNING:"
       echo "Either kernel does not support memory resource controller or feature not enabled"
       echo "Skipping all memcg_control testcases...."

Ack, I knew I missed a spot. Committed...
Thanks,
-Garrett

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list