代码拉取完成,页面将自动刷新
[PATCH] fix output dir for cpuctl_* tests
The output directory for logs is never created in cpuctl_test and
cpuctl_stress_test, causing those tests to fail (see the messages below).
As there is already a LTPROOT/results directory used by the fs_bind test,
unify the tests a bit and use the same directory. And, of course, create it
if it doesn't exist.
> TEST 1: CPU CONTROLLER TESTING
> RUNNING SETUP.....
> TEST STARTED: Please avoid using system while this test executes
> /usr/lib64/ltp/testcases/bin/run_cpuctl_test.sh: line 104: /usr/lib64/ltp/output/cpuctl_results_12.txt: No such file or directory
> /usr/lib64/ltp/testcases/bin/run_cpuctl_test.sh: line 105: /usr/lib64/ltp/output/cpuctl_results_12.txt: No such file or directory
> /usr/lib64/ltp/testcases/bin/run_cpuctl_test.sh: line 106: /usr/lib64/ltp/output/cpuctl_results_12.txt: No such file or directory
> /usr/lib64/ltp/testcases/bin/run_cpuctl_test.sh: line 107: /usr/lib64/ltp/output/cpuctl_results_12.txt: No such file or directory
> /usr/lib64/ltp/testcases/bin/run_cpuctl_test.sh: line 112: /usr/lib64/ltp/output/cpuctl_results_12.txt: No such file or directory
> /usr/lib64/ltp/testcases/bin/run_cpuctl_test.sh: line 112: /usr/lib64/ltp/output/cpuctl_results_12.txt: No such file or directory
> /usr/lib64/ltp/testcases/bin/run_cpuctl_test.sh: line 112: /usr/lib64/ltp/output/cpuctl_results_12.txt: No such file or directory
> /usr/lib64/ltp/testcases/bin/run_cpuctl_test.sh: line 112: /usr/lib64/ltp/output/cpuctl_results_12.txt: No such file or directory
> /usr/lib64/ltp/testcases/bin/run_cpuctl_test.sh: line 112: /usr/lib64/ltp/output/cpuctl_results_12.txt: No such file or directory
> /usr/lib64/ltp/testcases/bin/run_cpuctl_test.sh: line 112: /usr/lib64/ltp/output/cpuctl_results_12.txt: No such file or directory
> TASKS FIRED
> Task 1 exited abnormaly with return value: 1
> cpuctl_test01 0 INFO : Test could not execute for the expected duration
Signed-off-by: Jiri Benc <jbenc@suse.cz>
---
Index: ltp-full-20130109/testcases/kernel/controllers/cpuctl/run_cpuctl_stress_test.sh
===================================================================
--- ltp-full-20130109.orig/testcases/kernel/controllers/cpuctl/run_cpuctl_stress_test.sh
+++ ltp-full-20130109/testcases/kernel/controllers/cpuctl/run_cpuctl_stress_test.sh
@@ -71,6 +71,13 @@ M=10; # Default total num of tasks in
PWD=`pwd`
cd $LTPROOT/testcases/bin/
+# Results directory
+resdir="${LTPROOT}/results/cpuctl"
+if ! mkdir -p "${resdir}"; then
+ tst_brkm TBROK true "$0: failed to make results directory"
+ exit 1
+fi
+
. parameters.sh
usage ()
@@ -94,7 +101,7 @@ usage ()
fi;
NUM_GROUPS=$N;
TASKS_IN_GROUP=$M;
- echo `date` >> $LTPROOT/output/cpuctl_results_$FILE.txt;
+ echo `date` >> $resdir/cpuctl_results_$FILE.txt;
;;
"7" ) # N*M X 1 (N*M groups with 1 task each)
if [ $N -eq 1 ]
@@ -117,14 +124,14 @@ usage ()
TASKS_IN_GROUP=`expr 1 \* $M`;
FILE="stress-9";
TEST_NAME="HEAVY STRESS TEST(RENICED):";
- echo `date` >> $LTPROOT/output/cpuctl_results_$FILE.txt;
+ echo `date` >> $resdir/cpuctl_results_$FILE.txt;
;;
"10" ) # Heavy stress test
NUM_GROUPS=2;
M=`expr $N \* 100`;
FILE="stress-10";
TEST_NAME="LIGHT GRP vs HEAVY GRP TEST:";
- echo `date` >> $LTPROOT/output/cpuctl_results_$FILE.txt;
+ echo `date` >> $resdir/cpuctl_results_$FILE.txt;
;;
* )
usage;
@@ -148,10 +155,10 @@ usage ()
if [ -f cpuctl_test03 ]
then
- echo TEST NAME:- $TEST_NAME: $TEST_NUM >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo Test $TEST_NUM: NUM_GROUPS=$NUM_GROUPS +1 \(DEF\)>> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo Test $TEST_NUM: TASKS PER GROUP=$TASKS_IN_GROUP >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo "==========================================" >> $LTPROOT/output/cpuctl_results_$FILE.txt;
+ echo TEST NAME:- $TEST_NAME: $TEST_NUM >> $resdir/cpuctl_results_$FILE.txt;
+ echo Test $TEST_NUM: NUM_GROUPS=$NUM_GROUPS +1 \(DEF\)>> $resdir/cpuctl_results_$FILE.txt;
+ echo Test $TEST_NUM: TASKS PER GROUP=$TASKS_IN_GROUP >> $resdir/cpuctl_results_$FILE.txt;
+ echo "==========================================" >> $resdir/cpuctl_results_$FILE.txt;
for i in $(seq 1 $NUM_GROUPS)
do
MYGROUP=/dev/cpuctl/group_$i
@@ -163,7 +170,7 @@ usage ()
GROUP_NUM=$i MYGROUP=$MYGROUP SCRIPT_PID=$SCRIPT_PID NUM_CPUS=$NUM_CPUS \
TEST_NUM=$TEST_NUM TASK_NUM=$TASK_NUM ./cpuctl_task_$TASK_NUM \
- >>$LTPROOT/output/cpuctl_results_$FILE.txt &
+ >>$resdir/cpuctl_results_$FILE.txt &
if [ $? -ne 0 ]
then
echo "Error: Could not run ./cpuctl_task_$TASK_NUM"
@@ -193,7 +200,7 @@ usage ()
MYGROUP=/dev/cpuctl/group_def ;
GROUP_NUM=0 MYGROUP=$MYGROUP SCRIPT_PID=$SCRIPT_PID \
NUM_CPUS=$NUM_CPUS TEST_NUM=$TEST_NUM TASK_NUM=0 \
- ./cpuctl_def_task03 >>$LTPROOT/output/cpuctl_results_$FILE.txt &
+ ./cpuctl_def_task03 >>$resdir/cpuctl_results_$FILE.txt &
if [ $? -ne 0 ]
then
echo "Error: Could not run ./cpuctl_def_task03"
@@ -207,10 +214,10 @@ usage ()
if [ -f cpuctl_test04 ]
then
- echo TEST NAME:- $TEST_NAME: $TEST_NUM >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo NUM_GROUPS=$NUM_GROUPS +1 \(DEF\)>> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo TASKS PER GROUP=$TASKS_IN_GROUP >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo "===============================" >> $LTPROOT/output/cpuctl_results_$FILE.txt;
+ echo TEST NAME:- $TEST_NAME: $TEST_NUM >> $resdir/cpuctl_results_$FILE.txt;
+ echo NUM_GROUPS=$NUM_GROUPS +1 \(DEF\)>> $resdir/cpuctl_results_$FILE.txt;
+ echo TASKS PER GROUP=$TASKS_IN_GROUP >> $resdir/cpuctl_results_$FILE.txt;
+ echo "===============================" >> $resdir/cpuctl_results_$FILE.txt;
# Create 4 priority windows
RANGE1=`expr $NUM_GROUPS / 4`;
@@ -241,7 +248,7 @@ usage ()
GROUP_NUM=$i MYGROUP=$MYGROUP SCRIPT_PID=$SCRIPT_PID NUM_CPUS=$NUM_CPUS \
TEST_NUM=$TEST_NUM TASK_NUM=$TASK_NUM nice -n $NICEVALUE ./cpuctl_task_$TASK_NUM \
- >>$LTPROOT/output/cpuctl_results_$FILE.txt &
+ >>$resdir/cpuctl_results_$FILE.txt &
if [ $? -ne 0 ]
then
echo "Error: Could not run ./cpuctl_task_$TASK_NUM"
@@ -272,7 +279,7 @@ usage ()
MYGROUP=/dev/cpuctl/group_def ;
GROUP_NUM=0 MYGROUP=$MYGROUP SCRIPT_PID=$SCRIPT_PID \
NUM_CPUS=$NUM_CPUS TEST_NUM=$TEST_NUM TASK_NUM=0 \
- ./cpuctl_def_task04 >>$LTPROOT/output/cpuctl_results_$FILE.txt &
+ ./cpuctl_def_task04 >>$resdir/cpuctl_results_$FILE.txt &
if [ $? -ne 0 ]
then
echo "Error: Could not run ./cpuctl_def_task04"
@@ -286,10 +293,10 @@ usage ()
if [ -f cpuctl_test04 ]
then
- echo TEST NAME:- $TEST_NAME: $TEST_NUM >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo NUM_GROUPS=$NUM_GROUPS +1 \(DEF\)>> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo TASKS PER GROUP=VARIABLE >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo "===============================" >> $LTPROOT/output/cpuctl_results_$FILE.txt;
+ echo TEST NAME:- $TEST_NAME: $TEST_NUM >> $resdir/cpuctl_results_$FILE.txt;
+ echo NUM_GROUPS=$NUM_GROUPS +1 \(DEF\)>> $resdir/cpuctl_results_$FILE.txt;
+ echo TASKS PER GROUP=VARIABLE >> $resdir/cpuctl_results_$FILE.txt;
+ echo "===============================" >> $resdir/cpuctl_results_$FILE.txt;
for i in $(seq 1 $NUM_GROUPS)
do
@@ -308,7 +315,7 @@ usage ()
GROUP_NUM=$i MYGROUP=$MYGROUP SCRIPT_PID=$SCRIPT_PID NUM_CPUS=$NUM_CPUS \
TEST_NUM=$TEST_NUM TASK_NUM=$TASK_NUM ./cpuctl_task_$TASK_NUM \
- >>$LTPROOT/output/cpuctl_results_$FILE.txt &
+ >>$resdir/cpuctl_results_$FILE.txt &
if [ $? -ne 0 ]
then
echo "Error: Could not run ./cpuctl_task_$TASK_NUM"
@@ -339,7 +346,7 @@ usage ()
MYGROUP=/dev/cpuctl/group_def ;
GROUP_NUM=0 MYGROUP=$MYGROUP SCRIPT_PID=$SCRIPT_PID \
NUM_CPUS=$NUM_CPUS TEST_NUM=$TEST_NUM TASK_NUM=0 \
- ./cpuctl_def_task04 >>$LTPROOT/output/cpuctl_results_$FILE.txt &
+ ./cpuctl_def_task04 >>$resdir/cpuctl_results_$FILE.txt &
if [ $? -ne 0 ]
then
echo "Error: Could not run ./cpuctl_def_task04"
@@ -374,7 +381,7 @@ usage ()
fi
done
echo "Cpu controller test executed successfully.Results written to file";
- echo "Please review the results in $LTPROOT/output/cpuctl_results_$FILE.txt"
+ echo "Please review the results in $resdir/cpuctl_results_$FILE.txt"
cleanup;
cd $PWD
exit 0; #to let PAN reprt success of test
Index: ltp-full-20130109/testcases/kernel/controllers/cpuctl/run_cpuctl_test.sh
===================================================================
--- ltp-full-20130109.orig/testcases/kernel/controllers/cpuctl/run_cpuctl_test.sh
+++ ltp-full-20130109/testcases/kernel/controllers/cpuctl/run_cpuctl_test.sh
@@ -61,6 +61,13 @@ PWD=`pwd`
cd $LTPROOT/testcases/bin/
NUM_CPUS=`tst_ncpus`
+# Results directory
+resdir="${LTPROOT}/results/cpuctl"
+if ! mkdir -p "${resdir}"; then
+ tst_brkm TBROK true "$0: failed to make results directory"
+ exit 1
+fi
+
. parameters.sh
########################## main #######################
@@ -101,16 +108,16 @@ NUM_CPUS=`tst_ncpus`
"1" | "3" )
if [ -f cpuctl_test01 ]
then
- echo `date` >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo `uname -a` >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo TEST:- $TEST_NAME $TEST_NUM: >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo NUM_GROUPS=$NUM_GROUPS + 1\(DEF\) >> $LTPROOT/output/cpuctl_results_$FILE.txt;
+ echo `date` >> $resdir/cpuctl_results_$FILE.txt;
+ echo `uname -a` >> $resdir/cpuctl_results_$FILE.txt;
+ echo TEST:- $TEST_NAME $TEST_NUM: >> $resdir/cpuctl_results_$FILE.txt;
+ echo NUM_GROUPS=$NUM_GROUPS + 1\(DEF\) >> $resdir/cpuctl_results_$FILE.txt;
for i in $(seq 1 $NUM_GROUPS)
do
cp cpuctl_test01 cpuctl_task_$i ;
chmod +x cpuctl_task_$i;
./cpuctl_task_$i $i /dev/cpuctl/group_$i $$ $NUM_CPUS $TEST_NUM \
- >>$LTPROOT/output/cpuctl_results_$FILE.txt &
+ >>$resdir/cpuctl_results_$FILE.txt &
if [ $? -ne 0 ]
then
echo "Error: Could not run ./cpuctl_task_$i"
@@ -137,7 +144,7 @@ NUM_CPUS=`tst_ncpus`
exit -1;
fi
./cpuctl_def_task01 $i /dev/cpuctl/group_def $$ $NUM_CPUS \
- $TEST_NUM >>$LTPROOT/output/cpuctl_results_$FILE.txt &
+ $TEST_NUM >>$resdir/cpuctl_results_$FILE.txt &
if [ $? -ne 0 ]
then
echo "Error: Could not run ./cpuctl_def_task01"
@@ -150,10 +157,10 @@ NUM_CPUS=`tst_ncpus`
"4" )
if [ -f cpuctl_test02 ]
then
- echo `date` >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo `uname -a` >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo TEST:- $TEST_NAME $TEST_NUM >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo NUM_GROUPS=$NUM_GROUPS +1 \(DEF\) >> $LTPROOT/output/cpuctl_results_$FILE.txt;
+ echo `date` >> $resdir/cpuctl_results_$FILE.txt;
+ echo `uname -a` >> $resdir/cpuctl_results_$FILE.txt;
+ echo TEST:- $TEST_NAME $TEST_NUM >> $resdir/cpuctl_results_$FILE.txt;
+ echo NUM_GROUPS=$NUM_GROUPS +1 \(DEF\) >> $resdir/cpuctl_results_$FILE.txt;
for i in $(seq 1 $NUM_GROUPS)
do
MYGROUP=/dev/cpuctl/group_$i
@@ -172,7 +179,7 @@ NUM_CPUS=`tst_ncpus`
GROUP_NUM=$i MYGROUP=$MYGROUP SCRIPT_PID=$SCRIPT_PID NUM_CPUS=$NUM_CPUS \
TEST_NUM=$TEST_NUM TASK_NUM=$TASK_NUM nice -n $NICELEVEL ./cpuctl_task_$TASK_NUM \
- >>$LTPROOT/output/cpuctl_results_$FILE.txt &
+ >>$resdir/cpuctl_results_$FILE.txt &
if [ $? -ne 0 ]
then
echo "Error: Could not run ./cpuctl_task_$TASK_NUM"
@@ -203,7 +210,7 @@ NUM_CPUS=`tst_ncpus`
MYGROUP=/dev/cpuctl/group_def ;
GROUP_NUM=0 MYGROUP=$MYGROUP SCRIPT_PID=$SCRIPT_PID \
NUM_CPUS=$NUM_CPUS TEST_NUM=$TEST_NUM TASK_NUM=0 \
- ./cpuctl_def_task02 >>$LTPROOT/output/cpuctl_results_$FILE.txt &
+ ./cpuctl_def_task02 >>$resdir/cpuctl_results_$FILE.txt &
if [ $? -ne 0 ]
then
echo "Error: Could not run ./cpuctl_def_task02"
@@ -216,10 +223,10 @@ NUM_CPUS=`tst_ncpus`
"5" )
if [ -f cpuctl_test02 ]
then
- echo `date` >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo `uname -a` >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo TEST:- $TEST_NAME $TEST_NUM >> $LTPROOT/output/cpuctl_results_$FILE.txt;
- echo NUM_GROUPS=$NUM_GROUPS +1 \(DEF\)>> $LTPROOT/output/cpuctl_results_$FILE.txt;
+ echo `date` >> $resdir/cpuctl_results_$FILE.txt;
+ echo `uname -a` >> $resdir/cpuctl_results_$FILE.txt;
+ echo TEST:- $TEST_NAME $TEST_NUM >> $resdir/cpuctl_results_$FILE.txt;
+ echo NUM_GROUPS=$NUM_GROUPS +1 \(DEF\)>> $resdir/cpuctl_results_$FILE.txt;
TASKS_IN_GROUP=3;
for i in $(seq 1 $NUM_GROUPS)
do
@@ -232,7 +239,7 @@ NUM_CPUS=`tst_ncpus`
GROUP_NUM=$i MYGROUP=$MYGROUP SCRIPT_PID=$SCRIPT_PID NUM_CPUS=$NUM_CPUS \
TEST_NUM=$TEST_NUM TASK_NUM=$TASK_NUM ./cpuctl_task_$TASK_NUM \
- >>$LTPROOT/output/cpuctl_results_$FILE.txt &
+ >>$resdir/cpuctl_results_$FILE.txt &
if [ $? -ne 0 ]
then
echo "Error: Could not run ./cpuctl_task_$TASK_NUM"
@@ -263,7 +270,7 @@ NUM_CPUS=`tst_ncpus`
MYGROUP=/dev/cpuctl/group_def ;
GROUP_NUM=0 MYGROUP=$MYGROUP SCRIPT_PID=$SCRIPT_PID \
NUM_CPUS=$NUM_CPUS TEST_NUM=$TEST_NUM TASK_NUM=0 \
- ./cpuctl_def_task02 >>$LTPROOT/output/cpuctl_results_$FILE.txt &
+ ./cpuctl_def_task02 >>$resdir/cpuctl_results_$FILE.txt &
if [ $? -ne 0 ]
then
echo "Error: Could not run ./cpuctl_def_task02"
@@ -301,7 +308,7 @@ NUM_CPUS=`tst_ncpus`
fi
done
echo "Cpu controller test executed successfully.Results written to file";
- echo "Please review the results in $LTPROOT/output/cpuctl_results_$FILE.txt"
+ echo "Please review the results in $resdir/cpuctl_results_$FILE.txt"
cleanup;
cd $PWD
exit 0; #to let PAN reprt success of test
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。