On Fri, 2008-11-21 at 17:25 +0530, [EMAIL PROTECTED] wrote:
> plain text document attachment
> (modify-script-to-run-default-task1.patch)
> 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 <[EMAIL PROTECTED]>

Thanks.

Regards--
Subrata

> 
> ---
>  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...";
> 
> 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to