Added check for memory controller ( functional, regression & stress )
PATCH 2/2 Added check for memory controller ( functional, regression & stress )
commit fe4599d210be37a7d1bb2d6a5523b9e29bbd87e1
Author: Rishikesh K Rajak <[email protected]> Date: Mon Dec 28 15:11:54 2009 +0530
Added check for regression and funcitonal memcg test
testcases/kernel/controllers/memcg/functional/memcg_function_test.sh +2 -2
@@ -28,8 +28,8 @@ export TCID="memcg_function_test" export TST_TOTAL=38 export TST_COUNT=0 -grep -w memory /proc/cgroups 2>&1 > /dev/null -if [ $? -ne 0 ]; then +if [ `grep -w memory /proc/cgroups | cut -f4` == 0 ] +then echo "WARNING:"; echo "Kernel does not support for memory resource controller"; echo "Skipping all memcgroup testcases....";
testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh +9 -0
@@ -33,6 +33,15 @@ if [ "$USER" != root ]; then exit 0 fi +if [ `grep -w memory /proc/cgroups | cut -f4` == 0 ] +then + echo "WARNING:"; + echo "Kernel does not support for memory resource controller"; + echo "Skipping all memcgroup testcases...."; + exit 0 +fi + + tst_kvercmp 2 6 30 if [ $? -eq 0 ]; then tst_brkm TBROK ignored "Test should be run with kernel 2.6.30 or newer"
testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +7 -6
@@ -28,14 +28,15 @@ export TCID="memcg_stress_test" export TST_TOTAL=2 export TST_COUNT=0 -grep -w memory /proc/cgroups 2>&1 > /dev/null -if [ $? -ne 0 ]; then - echo "WARNING:"; - echo "Kernel does not support for memory resource controller"; - echo "Skipping all memcgroup testcases...."; - exit 0 +if [ `grep -w memory /proc/cgroups | cut -f4` == 0 ] +then + echo "WARNING:"; + echo "Kernel does not support for memory resource controller"; + echo "Skipping all memcgroup testcases...."; + exit 0 fi + RUN_TIME=$(( 60 * 60 )) cleanup()
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 6 lines
commit
fe4599d210be37a7d1bb2d6a5523b9e29bbd87e1Author: Rishikesh K Rajak <[email protected]> Date: Mon Dec 28 15:11:54 2009 +0530Added check for regression and funcitonal memcg test
You should add your Signed-off-by.
testcases/kernel/controllers/memcg/functional/memcg_function_test.sh export TCID="memcg_function_test" · line 31
Quoted 11 lines
testcases/kernel/controllers/memcg/functional/memcg_function_test.sh +1
-2@@ -28,8 +28,8 @@ export TCID="memcg_function_test" export TST_TOTAL=38 export TST_COUNT=0 -grep -w memory /proc/cgroups 2>&1 > /dev/null -if [ $? -ne 0 ]; then +if [ `grep -w memory /proc/cgroups | cut -f4` == 0 ]
What if memory cgroup is not compiled? So the correct check should be:
if [ ! "grep -w memory /proc/cgroups | cut -f4" == "1" ] then
...
fi
Quoted 9 lines
testcases/kernel/controllers/memcg/functional/memcg_function_test.sh +1
-0+then echo "WARNING:"; echo "Kernel does not support for memory resource controller"; echo "Skipping all memcgroup testcases....";testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh +0
-0
testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh if [ "$USER" != root ]; then · line 42
Quoted 10 lines
testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh +7
-0@@ -33,6 +33,15 @@ if [ "$USER" != root ]; then exit 0 fi +if [ `grep -w memory /proc/cgroups | cut -f4` == 0 ] +then + echo "WARNING:"; + echo "Kernel does not support for memory resource controller"; + echo "Skipping all memcgroup testcases...."; + exit 0 +fi
ditto
Quoted 16 lines
testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh +2
-0+ + tst_kvercmp 2 6 30 if [ $? -eq 0 ]; then tst_brkm TBROK ignored "Test should be run with kernel 2.6.30 or newer"testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +0
-3@@ -28,14 +28,15 @@ export TCID="memcg_stress_test" export TST_TOTAL=2 export TST_COUNT=0 -grep -w memory /proc/cgroups 2>&1 > /dev/null -if [ $? -ne 0 ]; then - echo "WARNING:";
testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh export TCID="memcg_stress_test" · line 37
Quoted 10 lines
testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +6
-3- echo "Kernel does not support for memory resource controller"; - echo "Skipping all memcgroup testcases...."; - exit 0 +if [ `grep -w memory /proc/cgroups | cut -f4` == 0 ] +then + echo "WARNING:"; + echo "Kernel does not support for memory resource controller"; + echo "Skipping all memcgroup testcases...."; + exit 0 fi
ditto
testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh export TCID="memcg_stress_test" · line 42
Quoted 5 lines
testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +1
-0+ RUN_TIME=$(( 60 * 60 )) cleanup()
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 9 lines · Li Zefan
Quoted 7 lines
commit
fe4599d210be37a7d1bb2d6a5523b9e29bbd87e1Author: Rishikesh K Rajak<[email protected]> Date: Mon Dec 28 15:11:54 2009 +0530Added check for regression and funcitonal memcg test
You should add your Signed-off-by.
Hi Li,
Thanks for your review comment. Will definitely incorporate your review comment and resend the patch again.
-Rishi
Quoted 57 lines
testcases/kernel/controllers/memcg/functional/memcg_function_test.sh export TCID="memcg_function_test" · line 32
Quoted 13 lines
testcases/kernel/controllers/memcg/functional/memcg_function_test.sh +1
-2@@ -28,8 +28,8 @@ export TCID="memcg_function_test" export TST_TOTAL=38 export TST_COUNT=0 -grep -w memory /proc/cgroups 2>&1> /dev/null -if [ $? -ne 0 ]; then +if [ `grep -w memory /proc/cgroups | cut -f4` == 0 ]What if memory cgroup is not compiled? So the correct check should be:
if [ ! "grep -w memory
/proc/cgroups| cut -f4" == "1" ] then...fi
Quoted 10 lines
testcases/kernel/controllers/memcg/functional/memcg_function_test.sh +1
-0+then echo "WARNING:"; echo "Kernel does not support for memory resource controller";echo "Skipping all memcgroup testcases....";
testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh +0
-0@@ -33,6 +33,15 @@ if [ "$USER" != root ]; then exit 0testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh if [ "$USER" != root ]; then · line 43
Quoted 10 lines
testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh +7
-0fi +if [ `grep -w memory /proc/cgroups | cut -f4` == 0 ] +then + echo "WARNING:"; + echo "Kernel does not support for memory resource controller"; + echo "Skipping all memcgroup testcases...."; + exit 0 +fiditto
Quoted 13 lines
testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh +2
-0+ + tst_kvercmp 2 6 30 if [ $? -eq 0 ]; then
tst_brkmTBROK ignored "Test should be run with kernel 2.6.30 or newer"testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +0
-0@@ -28,14 +28,15 @@ export TCID="memcg_stress_test" export TST_TOTAL=2 export TST_COUNT=0
Quoted 24 lines
Quoted 4 lines
testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +0
-4-grep -w memory /proc/cgroups 2>&1> /dev/null -if [ $? -ne 0 ]; then - echo "WARNING:"; - echo "Kernel does not support for memory resource controller";testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh export TCID="memcg_stress_test" · line 38
Quoted 10 lines
testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +6
-2- echo "Skipping all memcgroup testcases...."; - exit 0 +if [ `grep -w memory /proc/cgroups | cut -f4` == 0 ] +then + echo "WARNING:"; + echo "Kernel does not support for memory resource controller"; + echo "Skipping all memcgroup testcases...."; + exit 0 fiditto
Quoted 6 lines
testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +1
-0+ RUN_TIME=$(( 60 * 60 )) cleanup()
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 9 lines · Li Zefan
Quoted 7 lines
commit
fe4599d210be37a7d1bb2d6a5523b9e29bbd87e1Author: Rishikesh K Rajak<[email protected]> Date: Mon Dec 28 15:11:54 2009 +0530Added check for regression and funcitonal memcg test
You should add your Signed-off-by.
Sending a fresh patch with signed-off added. Also combined both the patches in one & ported to latest intermediate ltp release.
Description:
The current implementation of memory controller in ltp checks only
for kernel support, this patch check for memcg functionality enable or disable through /proc/cgroups.
Signed-off By : Rishikesh K Rajak <[email protected]>
---
testcases/kernel/controllers/memcg/functional/memcg_function_test.sh +9 -6
@@ -20,6 +20,8 @@ ## ## ## Author: Li Zefan <[email protected]> ## ## Restructure for LTP: Shi Weihua <[email protected]> ## +## Added memcg enable/disable functinality: Rishikesh K Rajak ## +## <[email protected] ## ## ## ################################################################################
@@ -28,14 +30,15 @@ export TST_TOTAL=38 export TST_COUNT=0 -grep -w memory /proc/cgroups 2>&1 > /dev/null -if [ $? -ne 0 ]; then - echo "WARNING:"; - echo "Kernel does not support for memory resource controller"; - echo "Skipping all memcgroup testcases...."; - exit 0 +if [ ! "grep -w memory /proc/cgroups | cut -f4" == "1" ] +then + echo "WARNING:"; + echo "Either Kernel does not support for memory resource controller or feature not enabled"; + echo "Skipping all memcgroup testcases...."; + exit 0 fi + TEST_PATH=$PWD PASS=0
testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh +10 -0
@@ -19,6 +19,8 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## ## ## ## Author: Li Zefan <[email protected]> ## +## Added memcg enable/disable functinality: Rishikesh K Rajak ## +## <[email protected] ## ## ## ################################################################################
@@ -33,6 +35,14 @@ exit 0 fi +if [ ! "grep -w memory /proc/cgroups | cut -f4" == "1" ] +then + echo "WARNING:"; + echo "Either Kernel does not support for memory resource controller or feature not enabled"; + echo "Skipping all memcgroup testcases...."; + exit 0 +fi + tst_kvercmp 2 6 30 if [ $? -eq 0 ]; then tst_brkm TBROK ignored "Test should be run with kernel 2.6.30 or newer"
testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +8 -6
@@ -20,6 +20,8 @@ ## ## ## Author: Li Zefan <[email protected]> ## ## Restructure for LTP: Shi Weihua <[email protected]> ## +## Added memcg enable/disable functinality: Rishikesh K Rajak ## +## <[email protected] ## ## ## ################################################################################
@@ -28,12 +30,12 @@ export TST_TOTAL=2 export TST_COUNT=0 -grep -w memory /proc/cgroups 2>&1 > /dev/null -if [ $? -ne 0 ]; then - echo "WARNING:"; - echo "Kernel does not support for memory resource controller"; - echo "Skipping all memcgroup testcases...."; - exit 0 +if [ ! "grep -w memory /proc/cgroups | cut -f4" == "1" ] +then + echo "WARNING:"; + echo "Either Kernel does not support for memory resource controller or feature not enabled"; + echo "Skipping all memcgroup testcases...."; + exit 0 fi RUN_TIME=$(( 60 * 60 ))
testcases/kernel/controllers/test_controllers.sh +20 -11
@@ -33,19 +33,26 @@ # 20/12/07 Sudhir Kumar <[email protected]> Created this test # # 02/03/09 Miao Xie <[email protected]> Add cpuset testset # # 07/07/09 Shi Weihua <[email protected]> Add cpu testset of Fujitsu # +# 30/12/09 Rishikesh <[email protected]> Added enable/disable # # # ################################################################################## if [ -f /proc/cgroups ] then CPU_CONTROLLER=`grep -w cpu /proc/cgroups | cut -f1`; + CPU_CONTROLLER_VALUE=`grep -w cpu /proc/cgroups | cut -f4`; MEM_CONTROLLER=`grep -w memory /proc/cgroups | cut -f1`; + MEM_CONTROLLER_VALUE=`grep -w memory /proc/cgroups | cut -f4`; IOTHROTTLE_CONTROLLER=`grep -w blockio /proc/cgroups | cut -f1`; + IOTHROTTLE_CONTROLLER_VALUE=`grep -w blockio /proc/cgroups | cut -f4`; FREEZER=`grep -w freezer /proc/cgroups | cut -f1`; + FREEZER_VALUE=`grep -w freezer /proc/cgroups | cut -f4`; CPUSET_CONTROLLER=`grep -w cpuset /proc/cgroups | cut -f1` + CPUSET_CONTROLLER_VALUE=`grep -w cpuset /proc/cgroups | cut -f4` CPUACCOUNT_CONTROLLER=`grep -w cpuacct /proc/cgroups | cut -f1` + CPUACCOUNT_CONTROLLER_VALUE=`grep -w cpuacct /proc/cgroups | cut -f4` - if [ "$CPU_CONTROLLER" = "cpu" ] + if [ "$CPU_CONTROLLER" = "cpu" ] && [ "$CPU_CONTROLLER_VALUE" = "1" ] then $LTPROOT/testcases/bin/run_cpuctl_test.sh 1; $LTPROOT/testcases/bin/run_cpuctl_test.sh 3;
@@ -63,11 +70,11 @@ $LTPROOT/testcases/bin/run_cpuctl_test_fj.sh else echo "CONTROLLERS TESTCASES: WARNING"; - echo "Kernel does not support for cpu controller"; + echo "Either Kernel does not support for cpu controller or functionality is not enabled"; echo "Skipping all cpu controller testcases...."; fi; - if [ "$MEM_CONTROLLER" = "memory" ] + if [ "$MEM_CONTROLLER" = "memory" ] && [ "$MEM_CONTROLLER_VALUE" = "1" ] then $LTPROOT/testcases/bin/run_memctl_test.sh 1; $LTPROOT/testcases/bin/run_memctl_test.sh 2;
@@ -75,28 +82,29 @@ $LTPROOT/testcases/bin/run_memctl_test.sh 4; else echo "CONTROLLERS TESTCASES: WARNING"; - echo "Kernel does not support for memory controller"; + echo "Either Kernel does not support for memory controller or functionality is not enabled"; echo "Skipping all memory controller testcases...."; fi - if [ "$IOTHROTTLE_CONTROLLER" = "blockio" ] + if [ "$IOTHROTTLE_CONTROLLER" = "blockio" ] && [ "$IOTHROTTLE_CONTROLLER_VALUE" = "1" ] then $LTPROOT/testcases/bin/run_io_throttle_test.sh; else echo "CONTROLLERS TESTCASES: WARNING"; - echo "Kernel does not support blockio controller"; + echo "Either Kernel does not support for io controller or functionality is not enabled"; echo "Skipping all block device I/O throttling testcases...."; fi - if [ "$FREEZER" = "freezer" ] + if [ "$FREEZER" = "freezer" ] && [ "$FREEZER_VALUE" = "1" ] then "$LTPROOT/testcases/bin/run_freezer.sh" else echo "CONTROLLERS TESTCASES: WARNING"; + echo "Either Kernel does not support for freezer or functionality is not enabled"; echo "Kernel does not support freezer controller"; echo "Skipping all freezer testcases...."; fi - if [ "$CPUSET_CONTROLLER" = "cpuset" ] + if [ "$CPUSET_CONTROLLER" = "cpuset" ] && [ "$CPUSET_CONTROLLER_VALUE" = "1" ] then $LTPROOT/testcases/bin/run_cpuset_test.sh 1; $LTPROOT/testcases/bin/run_cpuset_test.sh 2;
@@ -111,21 +119,22 @@ $LTPROOT/testcases/bin/run_cpuset_test.sh 11; else echo "CONTROLLERS TESTCASES: WARNING"; - echo "Kernel does not support cpuset controller"; + echo "Either Kernel does not support for cpuset controller or functionality is not enabled"; echo "Skipping all cpuset controller testcases...."; fi - if [ "$CPUACCOUNT_CONTROLLER" = "cpuacct" ] + if [ "$CPUACCOUNT_CONTROLLER" = "cpuacct" ] && [ "$CPUACCOUNT_CONTROLLER_VALUE" = "1" ] then $LTPROOT/testcases/bin/run_cpuacct_test.sh 1; $LTPROOT/testcases/bin/run_cpuacct_test.sh 2; else echo "Could not start cpu accounting controller test"; + echo "Either Kernel does not support for cpu accounting controller or functionality is not enabled"; echo "usage: run_cpuacct_test.sh $TEST_NUM "; echo "Skipping the cpu accounting controller test..."; fi else echo "CONTROLLERS TESTCASES: WARNING" - echo "Kernel does not support for control groups"; + echo "Kernel does not support any controller"; echo "Skipping all controllers testcases...."; fi
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Li Zefan
Acked-byQuoted 5 lines · Rishikesh
Quoted 4 lines · Li Zefan
Quoted 4 lines
commit
fe4599d210be37a7d1bb2d6a5523b9e29bbd87e1Author: Rishikesh K Rajak<[email protected]> Date: Mon Dec 28 15:11:54 2009 +0530
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
Added check for regression and funcitonal memcg test
You should add your Signed-off-by.
Sending a fresh patch with signed-off added. Also combined both the patches in one & ported to latest intermediate ltp release.
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 9 lines · Li Zefan
Quoted 8 lines · Rishikesh
Quoted 7 lines · Li Zefan
Quoted 7 lines
commit
fe4599d210be37a7d1bb2d6a5523b9e29bbd87e1
Author: Rishikesh K Rajak<[email protected]>
Date: Mon Dec 28 15:11:54 2009 +0530Added check for regression and funcitonal memcg test
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
You should add your Signed-off-by.
Sending a fresh patch with signed-off added. Also combined both the patches in one & ported to latest intermediate ltp release.
Acked-by Li Zefan <[email protected]>
These checks are wrong for positive cases. Please do something
like the following (I committed it to the regression script as an example):
! if [ ! "grep -w memory /proc/cgroups | cut -f4" == "1" ]
then
! echo "WARNING:";
! echo "Either Kernel does not support for memory resource
controller or feature not enabled";
! echo "Skipping all memcgroup testcases....";
exit 0
fi
--- 31,43 ----
export TST_COUNT=1
! if [ "$(id -ru)" != 0 ]; then
tst_brkm TBROK ignored "Test must be run as root" exit 0
fi
! if [ "$(grep -w memory /proc/cgroups | cut -f4)" != "1" ]
then
! tst_resm TCONF "Either memory resource controller kernel support absent"
! tst_resm TCONF "or feature is not enabled; skipping all
memcgroup testcases."
exit 0
fi
Please ignore the id -ru noise.
Thanks,
-Garrett
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 9 lines · Li Zefan
Quoted 8 lines · Rishikesh
Quoted 7 lines · Li Zefan
Quoted 7 lines
commit
fe4599d210be37a7d1bb2d6a5523b9e29bbd87e1Author: Rishikesh K Rajak<[email protected]> Date: Mon Dec 28 15:11:54 2009 +0530Added check for regression and funcitonal memcg test
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
You should add your Signed-off-by.
Sending a fresh patch with signed-off added. Also combined both the patches in one & ported to latest intermediate ltp release.
Acked-by Li Zefan <[email protected]>
Thanks to both of you.
Regards--
Subrata
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list