From: <sk...@li...> - 2008-11-21 11:59:50
|
This patch adds the code to trigger the default task for the tests 1-3. Also the code is added to clean this default task setup. Signed-off-by: Sudhir Kumar <sk...@li...> --- testcases/kernel/controllers/cpuctl/parameters.sh | 9 +++++-- testcases/kernel/controllers/cpuctl/run_cpuctl_test.sh | 21 ++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) Index: ltp-full-20081031/testcases/kernel/controllers/cpuctl/run_cpuctl_test.sh =================================================================== --- ltp-full-20081031.orig/testcases/kernel/controllers/cpuctl/run_cpuctl_test.sh +++ ltp-full-20081031/testcases/kernel/controllers/cpuctl/run_cpuctl_test.sh @@ -104,7 +104,7 @@ NUM_CPUS=`cat /proc/cpuinfo | grep -w pr 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 >> $LTPROOT/output/cpuctl_results_$FILE.txt; + echo NUM_GROUPS=$NUM_GROUPS + 1\(DEF\) >> $LTPROOT/output/cpuctl_results_$FILE.txt; for i in $(seq 1 $NUM_GROUPS) do cp cpuctl_test01 cpuctl_task_$i ; @@ -119,14 +119,33 @@ NUM_CPUS=`cat /proc/cpuinfo | grep -w pr else PID[$i]=$!; fi - i=`expr $i + 1` done else echo "Source file not compiled..Plz check Makefile...Exiting test" cleanup; exit -1; fi; + i=`expr $i + 1` + TOTAL_TASKS=$NUM_GROUPS; + # Run the default task in a default group + set_def_group; + if [ ! -f cpuctl_def_task01 ]; then + echo "Source file for default task not compiled"; + echo "Plz check Makefile...Exiting test"; + cleanup; + exit -1; + fi + ./cpuctl_def_task01 $i /dev/cpuctl/group_def $$ $NUM_CPUS \ + $TEST_NUM >>$LTPROOT/output/cpuctl_results_$FILE.txt & + if [ $? -ne 0 ] + then + echo "Error: Could not run ./cpuctl_def_task01" + cleanup; + exit -1; + else + echo "Succesfully launched def task $! too"; + fi ;; "4" ) if [ -f cpuctl_test02 ] Index: ltp-full-20081031/testcases/kernel/controllers/cpuctl/parameters.sh =================================================================== --- ltp-full-20081031.orig/testcases/kernel/controllers/cpuctl/parameters.sh +++ ltp-full-20081031/testcases/kernel/controllers/cpuctl/parameters.sh @@ -77,8 +77,12 @@ get_num_groups() # Number of task cleanup () { echo "Cleanup called"; + killall cpuctl_def_task01; rm -f cpuctl_task_* 2>/dev/null - rmdir /dev/cpuctl/group_* 2> /dev/null + for task in `cat /dev/cpuctl/group_def/tasks`; do + echo $task > /dev/cpuctl/tasks 2>/dev/null 1>&2; + done + rmdir /dev/cpuctl/group* 2> /dev/null umount /dev/cpuctl 2> /dev/null rmdir /dev/cpuctl 2> /dev/null rm -f myfifo 2>/dev/null @@ -106,7 +110,8 @@ do_setup () fi # Group created earlier may again be visible if not cleaned properly...so clean them - if [ -e /dev/cpuctl/group_1 ] + groups=/dev/cpuctl/group* + if [ -z "$groups" ] then rmdir /dev/cpuctl/group* echo "WARN: Earlier groups found and removed..."; |