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
1=== modified file 'lava_android_test/test_definitions/pm_qa.py'
2--- lava_android_test/test_definitions/pm_qa.py 2013-05-16 09:05:03 +0000
3+++ lava_android_test/test_definitions/pm_qa.py 2013-06-05 08:07:51 +0000
4@@ -23,13 +23,14 @@
5
6 **URL:** https://git.linaro.org/gitweb?p=tools/pm-qa.git;a=summary
7
8-**Default options:** None
9+**Default options:** /data/benchmark/pm-qa
10 """
11
12 import os
13 import lava_android_test.testdef
14 from lava_android_test.config import get_config
15
16+DEFAULT_OPTIONS = '/data/benchmark/pm-qa'
17 test_name = 'pm_qa'
18 config = get_config()
19 curdir = os.path.realpath(os.path.dirname(__file__))
20@@ -42,7 +43,7 @@
21 test_sh_android_path),
22 'shell chmod 777 %s' % test_sh_android_path]
23
24-ADB_SHELL_STEPS = [test_sh_android_path]
25+ADB_SHELL_STEPS = ["%s $(OPTIONS)" % test_sh_android_path]
26 PATTERN = "^\s*(?P<test_case_id>\w+)=(?P<result>\w+)\s*$"
27
28 inst = lava_android_test.testdef.AndroidTestInstaller(
29@@ -53,4 +54,5 @@
30 testobj = lava_android_test.testdef.AndroidTest(testname=test_name,
31 installer=inst,
32 runner=run,
33- parser=parser)
34+ parser=parser,
35+ default_options=DEFAULT_OPTIONS)
36
37=== modified file 'lava_android_test/test_definitions/pm_qa/pm-qa.sh'
38--- lava_android_test/test_definitions/pm_qa/pm-qa.sh 2013-05-30 08:42:45 +0000
39+++ lava_android_test/test_definitions/pm_qa/pm-qa.sh 2013-06-05 08:07:51 +0000
40@@ -1,10 +1,14 @@
41 #!/system/bin/sh
42
43+scripts_dir=$1 && shift
44+if [ -z "${scripts_dir}" ];then
45+ scripts_dir="/data/benchmark/pm-qa"
46+fi
47 test_func(){
48- if [ ! -d /data/benchmark/pm-qa ]; then
49- echo "pm-qa=fail"
50+ if [ ! -d "${scripts_dir}" ]; then
51+ echo "pm_qa=fail"
52 exit
53- fi
54+ fi
55
56 mkdir /data/bin/
57 cd /data/bin
58@@ -30,31 +34,30 @@
59
60 export PATH=/data/bin:$PATH
61
62- cd /data/benchmark/pm-qa
63+ cd "${scripts_dir}"
64
65- pwd=$PWD
66+ pwd_dir=$PWD
67 echo $pwd
68 tests_dirs="cpuidle cpufreq cpuhotplug sched_mc suspend thermal utils"
69- files=`find cpuidle cpufreq cpuhotplug sched_mc suspend -name "*.sh"`
70
71- for dir in $tests_dirs
72- do
73- subDir=`pwd`/$dir
74+ for dir in $tests_dirs; do
75+ subDir=${pwd_dir}/$dir
76 if [ -d $subDir ]; then
77- cd $subDir
78+ cd $subDir
79+ else
80+ continue
81 fi
82
83 echo `pwd`
84- for file in `find . -name "*.sh"`
85- do
86- path=$file
87- echo $path
88- /system/bin/sh $path
89+ for file in `find . -name "*.sh"`; do
90+ path=$file
91+ echo $path
92+ /system/bin/sh $path
93 done
94 cd ..
95 done
96
97- echo "pm-qa=pass"
98+ echo "pm_qa=pass"
99 }
100
101 test_func

Subscribers

People subscribed via source and target branches