Merge lp:~liuyq0307/lava-android-test/pm-qa-indefinite-loop into lp:lava-android-test

Proposed by Yongqin Liu
Status: Merged
Merged at revision: 256
Proposed branch: lp:~liuyq0307/lava-android-test/pm-qa-indefinite-loop
Merge into: lp:lava-android-test
Diff against target: 101 lines (+24/-19)
2 files modified
lava_android_test/test_definitions/pm_qa.py (+5/-3)
lava_android_test/test_definitions/pm_qa/pm-qa.sh (+19/-16)
To merge this branch: bzr merge lp:~liuyq0307/lava-android-test/pm-qa-indefinite-loop
Reviewer Review Type Date Requested Status
Yongqin Liu self test Approve
sanjay singh rawat Pending
HariGopal Pending
Review via email: mp+167470@code.launchpad.net

Description of the change

some changes on the pm-qa test:
1. make it can accept the scripts dir as an option
2. fix the pm-qa.sh script for the definite loop problem
3. fix the test case id according to the pattern of the test definition

To post a comment you must log in.
Revision history for this message
Yongqin Liu (liuyq0307) :
review: Approve (self test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lava_android_test/test_definitions/pm_qa.py'
--- lava_android_test/test_definitions/pm_qa.py 2013-05-16 09:05:03 +0000
+++ lava_android_test/test_definitions/pm_qa.py 2013-06-05 08:07:51 +0000
@@ -23,13 +23,14 @@
2323
24**URL:** https://git.linaro.org/gitweb?p=tools/pm-qa.git;a=summary24**URL:** https://git.linaro.org/gitweb?p=tools/pm-qa.git;a=summary
2525
26**Default options:** None26**Default options:** /data/benchmark/pm-qa
27"""27"""
2828
29import os29import os
30import lava_android_test.testdef30import lava_android_test.testdef
31from lava_android_test.config import get_config31from lava_android_test.config import get_config
3232
33DEFAULT_OPTIONS = '/data/benchmark/pm-qa'
33test_name = 'pm_qa'34test_name = 'pm_qa'
34config = get_config()35config = get_config()
35curdir = os.path.realpath(os.path.dirname(__file__))36curdir = os.path.realpath(os.path.dirname(__file__))
@@ -42,7 +43,7 @@
42 test_sh_android_path),43 test_sh_android_path),
43 'shell chmod 777 %s' % test_sh_android_path]44 'shell chmod 777 %s' % test_sh_android_path]
4445
45ADB_SHELL_STEPS = [test_sh_android_path]46ADB_SHELL_STEPS = ["%s $(OPTIONS)" % test_sh_android_path]
46PATTERN = "^\s*(?P<test_case_id>\w+)=(?P<result>\w+)\s*$"47PATTERN = "^\s*(?P<test_case_id>\w+)=(?P<result>\w+)\s*$"
4748
48inst = lava_android_test.testdef.AndroidTestInstaller(49inst = lava_android_test.testdef.AndroidTestInstaller(
@@ -53,4 +54,5 @@
53testobj = lava_android_test.testdef.AndroidTest(testname=test_name,54testobj = lava_android_test.testdef.AndroidTest(testname=test_name,
54 installer=inst,55 installer=inst,
55 runner=run,56 runner=run,
56 parser=parser)57 parser=parser,
58 default_options=DEFAULT_OPTIONS)
5759
=== modified file 'lava_android_test/test_definitions/pm_qa/pm-qa.sh'
--- lava_android_test/test_definitions/pm_qa/pm-qa.sh 2013-05-30 08:42:45 +0000
+++ lava_android_test/test_definitions/pm_qa/pm-qa.sh 2013-06-05 08:07:51 +0000
@@ -1,10 +1,14 @@
1#!/system/bin/sh1#!/system/bin/sh
22
3scripts_dir=$1 && shift
4if [ -z "${scripts_dir}" ];then
5 scripts_dir="/data/benchmark/pm-qa"
6fi
3test_func(){7test_func(){
4 if [ ! -d /data/benchmark/pm-qa ]; then8 if [ ! -d "${scripts_dir}" ]; then
5 echo "pm-qa=fail"9 echo "pm_qa=fail"
6 exit10 exit
7 fi 11 fi
812
9 mkdir /data/bin/13 mkdir /data/bin/
10 cd /data/bin14 cd /data/bin
@@ -30,31 +34,30 @@
3034
31 export PATH=/data/bin:$PATH35 export PATH=/data/bin:$PATH
3236
33 cd /data/benchmark/pm-qa37 cd "${scripts_dir}"
3438
35 pwd=$PWD39 pwd_dir=$PWD
36 echo $pwd40 echo $pwd
37 tests_dirs="cpuidle cpufreq cpuhotplug sched_mc suspend thermal utils"41 tests_dirs="cpuidle cpufreq cpuhotplug sched_mc suspend thermal utils"
38 files=`find cpuidle cpufreq cpuhotplug sched_mc suspend -name "*.sh"`
3942
40 for dir in $tests_dirs43 for dir in $tests_dirs; do
41 do44 subDir=${pwd_dir}/$dir
42 subDir=`pwd`/$dir
43 if [ -d $subDir ]; then45 if [ -d $subDir ]; then
44 cd $subDir46 cd $subDir
47 else
48 continue
45 fi49 fi
4650
47 echo `pwd`51 echo `pwd`
48 for file in `find . -name "*.sh"`52 for file in `find . -name "*.sh"`; do
49 do53 path=$file
50 path=$file54 echo $path
51 echo $path55 /system/bin/sh $path
52 /system/bin/sh $path
53 done56 done
54 cd ..57 cd ..
55 done58 done
5659
57 echo "pm-qa=pass"60 echo "pm_qa=pass"
58}61}
5962
60test_func63test_func

Subscribers

People subscribed via source and target branches