Re: [LTP] CPU Accounting Controller test case for LTP.

Garrett Cooper
2009-08-13T22:35:29Z

n Thu, Aug 13, 2009 at 10:18 AM, Subrata
Modak<subrata@linux.vnet.ibm.com> wrote:
> Hey,
>
> Thanks for sending that update once again. But still issues remain to be
> addressed:
>
> 1) # ls -l testcases/kernel/controllers/cpuacct/
> total 72
> -rwxr-xr-x 1 root root  4903 Aug 13 23:08 cpuacct_task
> -rw-r--r-- 1 root root   121 Aug 13 23:05 cpuacct_task.c
> -rw-r--r-- 1 root root  1665 Aug 13 23:05 cpuacct_testplan.txt
> -rw-r--r-- 1 root root   377 Aug 13 23:05 Makefile
> -rw-r--r-- 1 root root  1611 Aug 13 23:05 README
> -rwxr-xr-x 2 root root 11213 Aug 13 23:08 run_cpuacct_test.sh
> -rwxr-xr-x 2 root root  5075 Aug 13 23:05 setup.sh
>
> You cannot have a generic file called "setup.sh" and then install it
> over to "$LTPROOT/testcases/bin/". There are many tests which will try
> to do the same and somebodyś "setup.sh" will be finally replaced by the
> other at "$LTPROOT/testcases/bin/". So, replace this file name with
> something more specific like "run_cpuacct_test_setup.sh", which is more
> meaningful.
>
> 2) The test results are not encouraging though. You have tried to
> directly run it from by (cd testcases/bin/) and then:
> # ./run_cpuacct_test.sh 1
> # ./run_cpuacct_test.sh 2
>
> which is not correct. If you want to run just the CPUACCOUNTING
> controllers without the need to run the entire controller tests through
> test_controller.sh, then create a following file like:
>
> # cat runtest/cpuacct
> CPUACCT01 $LTPROOT/testcases/bin/run_cpuacct_test.sh 1
> CPUACCT02 $LTPROOT/testcases/bin/run_cpuacct_test.sh 2
>
> Then try with:
>
> ./runltp -f cpuacct
>
> But i get the following output on my machine:
>
> <<<test_start>>>
> tag=CPUACCT01 stime=1250185313
> cmdline="$LTPROOT/testcases/bin/run_cpuacct_test.sh 1"
> contacts=""
> analysis=exit
> <<<test_output>>>
> Cleanup called
> TEST 1:CPU ACCOUNTING CONTROLLER TESTING
> RUNNING SETUP.....
> TEST STARTED: Please avoid using system while this test executes
> gcc: /root/subrata/ltp/ltp-full-20090731/testcases/bin/cpuacct_task.c:
> No such file or directory
> gcc: no input files
> TFAIL Task file cpuacct_task.c not compiled
> Please check Makefile Exiting test
> <<<execution_status>>>
> initiation_status="ok"
> duration=0 termination_type=exited termination_id=255 corefile=no
> cutime=3 cstime=11
> <<<test_end>>>
> <<<test_start>>>
> tag=CPUACCT02 stime=1250185313
> cmdline="$LTPROOT/testcases/bin/run_cpuacct_test.sh 2"
> contacts=""
> analysis=exit
> <<<test_output>>>
> incrementing stop
> Cleanup called
> TEST 2:CPU ACCOUNTING CONTROLLER TESTING
> RUNNING SETUP.....
> TEST STARTED: Please avoid using system while this test executes
> gcc: /root/subrata/ltp/ltp-full-20090731/testcases/bin/cpuacct_task.c:
> No such file or directory
> gcc: no input files
> TFAIL Task file cpuacct_task.c not compiled
> Please check Makefile Exiting test
> Cleanup called
> <<<execution_status>>>
> initiation_status="ok"
> duration=1 termination_type=exited termination_id=255 corefile=no
> cutime=5 cstime=13
> <<<test_end>>>
>
> What has gcc got to do during test run ??
> Your makefile says that
> "testcases/kernel/controllers/cpuacct/cpuacct_task" will get installed
> at "testcases/bin/", but i do not find it after "make install", however
> "run_cpuacct_test.sh" was present at "testcases/bin/". Though i manually
> copied "testcases/kernel/controllers/cpuacct/cpuacct_task" to
> "testcases/bin/", still i get the above output. Please fix this and
> resend.

Duddu,

I'd reject this right away:

+case ${TEST_NUM} in
+ "1" )
+ gcc -o $PWD/cpuacct_task $PWD/cpuacct_task.c
+ ls $PWD/cpuacct_task &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo "TFAIL Task file cpuacct_task.c not compiled"
+ echo "Please check Makefile Exiting test"
+ exit -1
+ fi

If your testcase can't live without gcc, then it needs to be
redesigned. I will do the Makefile work making things conform to a
proper standard, but I don't want to have to go hacking a bunch of
scripts if I can help it...
Thanks,
-Garrett

> On Thu, 2009-08-13 at 13:24 +0530, Rajasekhar Duddu wrote:
>> Hi Subrata, I have done the changes to the patch as you have
>> suggested, please review it and let me know if it needs any
>> changes thanku.
>>
>> I am psoting the results also here.