Merge lp:~kejun-zhou/lava-android-test/pm-qa into lp:lava-android-test
- pm-qa
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 173 |
Proposed branch: | lp:~kejun-zhou/lava-android-test/pm-qa |
Merge into: | lp:lava-android-test |
Diff against target: |
126 lines (+107/-0) (has conflicts) 3 files modified
MANIFEST.in (+4/-0) lava_android_test/test_definitions/pm-qa.py (+47/-0) lava_android_test/test_definitions/pm-qa/pm-qa.sh (+56/-0) Text conflict in MANIFEST.in |
To merge this branch: | bzr merge lp:~kejun-zhou/lava-android-test/pm-qa |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Yongqin Liu | Approve | ||
Zach Pfeffer | Pending | ||
Review via email: mp+108892@code.launchpad.net |
This proposal supersedes a proposal from 2012-06-06.
Commit message
Description of the change
The LAVA test is used to make pm-qa test running.
pm-qa is a test suite with many test cases about power management.
Kejun ZHOU (kejun-zhou) wrote : | # |
24 busybox ln -s -f /system/bin/busybox wc
25
26 export PATH=/data/
27
* 28 cd /system/xbin/pm-qa*
29
30 pwd=$PWD
31 echo $pwd
32 tests_dirs="cpuidle cpufreq cpuhotplug sched_mc suspend thermal
utils"
33 files=`find cpuidle cpufreq cpuhotplug sched_mc suspend thermal
utils -name "*.sh"`
34
The line 28 is used to change the working DIR.
On 13 June 2012 17:26, Yongqin Liu <email address hidden> wrote:
> Review: Needs Fixing
>
> 92 + for tests_dirs in $tests_dirs
> the same variable name "tests_dirs" is used.
>
> 94 + subDir=
> 95 + if [ -d $subDir ]; then
> 96 + cd $subDir
> 97 + fi
> the pm-qa.sh will be run like this "adb shell /xxx/pm-qa.sh"
> and the pwd should be the home of root "/",
> if you do not do something before run pm-qa.sh,
> I don't think there will be "cpuidle cpufreq cpuhotplug sched_mc suspend
> thermal utils" directories under the root directory.
> --
>
> https:/
> You are the owner of lp:~kejun-zhou/lava-android-test/pm-qa.
>
Yongqin Liu (liuyq0307) wrote : | # |
> 24 busybox ln -s -f /system/bin/busybox wc
> 25
> 26 export PATH=/data/
> 27
> * 28 cd /system/xbin/pm-qa*
sorry, missed this line.
And some other things:
100 + for dir in `find . -name "*.sh"`
from the find command, we can see that the output should not be directories,
so use the variable name "dir" is not good I think.
104 + `echo $SHELL` $path
The $SHELL veriable seems not defined.
And about this shell script, What do it do?
What I see is:
1. if /system/xbin/pm-qa directory exists, output "pm-qa=pass", otherwise output "pm-qa=fail"
2. if /system/xbin/pm-qa directory exists, list the sh files in that directory.
Is that right?
Kejun ZHOU (kejun-zhou) wrote : | # |
On 13 June 2012 21:50, Yongqin Liu <email address hidden> wrote:
> > 24 busybox ln -s -f /system/bin/busybox wc
> > 25
> > 26 export PATH=/data/
> > 27
> > * 28 cd /system/xbin/pm-qa*
> sorry, missed this line.
>
> And some other things:
> 100 + for dir in `find . -name "*.sh"`
> from the find command, we can see that the output should not be
> directories,
> so use the variable name "dir" is not good I think.
I will update it.
>
> 104 + `echo $SHELL` $path
> The $SHELL veriable seems not defined.
>
$SHELL is defined. In Linaro Android system, it is /system/bin/sh.
> And about this shell script, What do it do?
> What I see is:
> 1. if /system/xbin/pm-qa directory exists, output "pm-qa=pass", otherwise
> output "pm-qa=fail"
> 2. if /system/xbin/pm-qa directory exists, list the sh files in that
> directory.
> Is that right?
If the pm-qa exists, the test will run all the *.sh.
> --
>
> https:/
> You are the owner of lp:~kejun-zhou/lava-android-test/pm-qa.
>
Kejun ZHOU (kejun-zhou) wrote : Posted in a previous version of this proposal | # |
Modify two parts at 15-Jun-2012
Yongqin Liu (liuyq0307) wrote : | # |
The $SHELL should have no value.
lava-android-test will not login to the shell to run the command.
lava-android-test just use "adb shell command" to run the script.
Below is the details about $SHELL.
17:24:25 liuyq:lava-
#!/system/bin/sh
echo $SHELL
17:24:42 liuyq:lava-
17:24:47 liuyq:lava-
root@linaro: /data/local/test.sh
/system/bin/sh
root@linaro: ^D
17:24:58 liuyq:lava-
93 + for tests_dirs in $tests_dirs
Also please make the two variable name different
And also please update this file:
lava-android-
Yongqin Liu (liuyq0307) wrote : | # |
8 +<<<<<<< TREE
9 include lava_android_
10 +=======
11 +include lava_android_
12 +>>>>>>> MERGE-SOURCE
There in conflict in the diff.
And because I don't have the image that pm-qa integrated, so I can't try it in my local.
could you show the output of "lava-android-test run pm-qa"
Kejun ZHOU (kejun-zhou) wrote : | # |
(pm-qa)
$ lava-android-test install pm-qa
LAVA: --Start Operation: Install test (pm-qa)
LAVA: Begin to execute command: adb push
/usr/local/
/data/lava-
LAVA: (stdout) 32 KB/s (1350 bytes in 0.040s)
LAVA: Begin to execute command: adb shell chmod 777
/data/lava-
LAVA: --End Operation: Install test (pm-qa)
(pm-qa)
$ lava-android-test run pm-qa
LAVA: --Start Operation: Run test (pm-qa)
LAVA: Begin to execute command: adb shell
/data/lava-
LAVA: (stdout) mkdir failed for /data/bin/, File exists
LAVA: (stdout) /system/xbin/pm-qa
LAVA: (stdout) find: cpufreq: No such file or directory
LAVA: (stdout) /system/
LAVA: (stdout) ./cpuidle_01.sh
LAVA: (stdout) cpuidle_01.0: checking 'current_driver' exists...
LAVA: (stdout) cpuidle_01.1: checking 'current_
pass
LAVA: (stdout) cpuidle_01.0/cpu0: checking 'desc' exists...
pass
LAVA: (stdout) cpuidle_01.1/cpu0: checking 'latency' exists...
LAVA: (stdout) cpuidle_01.2/cpu0: checking 'name' exists...
pass
LAVA: (stdout) cpuidle_01.3/cpu0: checking 'power' exists...
LAVA: (stdout) cpuidle_01.4/cpu0: checking 'time' exists...
pass
LAVA: (stdout) cpuidle_01.5/cpu0: checking 'usage' exists...
LAVA: (stdout) cpuidle_01.6/cpu0: checking 'desc' exists...
pass
LAVA: (stdout) cpuidle_01.7/cpu0: checking 'latency' exists...
LAVA: (stdout) cpuidle_01.8/cpu0: checking 'name' exists...
pass
LAVA: (stdout) cpuidle_01.9/cpu0: checking 'power' exists...
LAVA: (stdout) cpuidle_01.10/cpu0: checking 'time' exists...
LAVA: (stdout) cpuidle_01.11/cpu0: checking 'usage' exists...
pass
LAVA: (stdout) cpuidle_01.0/cpu1: checking 'desc' exists...
pass
LAVA: (stdout) cpuidle_01.1/cpu1: checking 'latency' exists...
LAVA: (stdout) cpuidle_01.2/cpu1: checking 'name' exists...
pass
LAVA: (stdout) cpuidle_01.3/cpu1: checking 'power' exists...
LAVA: (stdout) cpuidle_01.4/cpu1: checking 'time' exists...
pass
LAVA: (stdout) cpuidle_01.5/cpu1: checking 'usage' exists...
LAVA: (stdout) cpuidle_01.6/cpu1: checking 'desc' exists...
pass
LAVA: (stdout) cpuidle_01.7/cpu1: checking 'latency' exists...
LAVA: (stdout) cpuidle_01.8/cpu1: checking 'name' exists...
pass
LAVA: (stdout) cpuidle_01.9/cpu1: checking 'power' exists...
LAVA: (stdout) cpuidle_01.10/cpu1: checking 'time' exists...
LAVA: (stdout) cpuidle_01.11/cpu1: checking 'usage' exists...
pass
LAVA: (stdout) ./cpuidle_02.sh
LAVA: (stdout) ./cpuidle_
Yongqin Liu (liuyq0307) wrote : | # |
The tests seems not run correctly.
It does not output the pm-qa=fail or pm-qa=pass result.
Thanks,
Yongqin Liu
> (pm-qa)
> $ lava-android-test install pm-qa
> LAVA: --Start Operation: Install test (pm-qa)
> LAVA: Begin to execute command: adb push
> /usr/local/
> packages/
> /pm-qa/pm-qa.sh
> /data/lava-
> LAVA: (stdout) 32 KB/s (1350 bytes in 0.040s)
> LAVA: Begin to execute command: adb shell chmod 777
> /data/lava-
> LAVA: --End Operation: Install test (pm-qa)
> (pm-qa)
> $ lava-android-test run pm-qa
> LAVA: --Start Operation: Run test (pm-qa)
> LAVA: Begin to execute command: adb shell
> /data/lava-
> LAVA: (stdout) mkdir failed for /data/bin/, File exists
> LAVA: (stdout) /system/xbin/pm-qa
> LAVA: (stdout) find: cpufreq: No such file or directory
> LAVA: (stdout) /system/
> LAVA: (stdout) ./cpuidle_01.sh
> LAVA: (stdout) cpuidle_01.0: checking 'current_driver' exists...
> pass
> LAVA: (stdout) cpuidle_01.1: checking 'current_
> pass
> LAVA: (stdout) cpuidle_01.0/cpu0: checking 'desc' exists...
> pass
> LAVA: (stdout) cpuidle_01.1/cpu0: checking 'latency' exists...
> pass
> LAVA: (stdout) cpuidle_01.2/cpu0: checking 'name' exists...
> pass
> LAVA: (stdout) cpuidle_01.3/cpu0: checking 'power' exists...
> pass
> LAVA: (stdout) cpuidle_01.4/cpu0: checking 'time' exists...
> pass
> LAVA: (stdout) cpuidle_01.5/cpu0: checking 'usage' exists...
> pass
> LAVA: (stdout) cpuidle_01.6/cpu0: checking 'desc' exists...
> pass
> LAVA: (stdout) cpuidle_01.7/cpu0: checking 'latency' exists...
> pass
> LAVA: (stdout) cpuidle_01.8/cpu0: checking 'name' exists...
> pass
> LAVA: (stdout) cpuidle_01.9/cpu0: checking 'power' exists...
> pass
> LAVA: (stdout) cpuidle_01.10/cpu0: checking 'time' exists...
> pass
> LAVA: (stdout) cpuidle_01.11/cpu0: checking 'usage' exists...
> pass
> LAVA: (stdout) cpuidle_01.0/cpu1: checking 'desc' exists...
> pass
> LAVA: (stdout) cpuidle_01.1/cpu1: checking 'latency' exists...
> pass
> LAVA: (stdout) cpuidle_01.2/cpu1: checking 'name' exists...
> pass
> LAVA: (stdout) cpuidle_01.3/cpu1: checking 'power' exists...
> pass
> LAVA: (stdout) cpuidle_01.4/cpu1: checking 'time' exists...
> pass
> LAVA: (stdout) cpuidle_01.5/cpu1: checking 'usage' exists...
> pass
> LAVA: (stdout) cpuidle_01.6/cpu1: checking 'desc' exists...
> pass
> LAVA: (stdout) cpuidle_01.7/cpu1: checking 'latency' exists...
> pass
> LAVA: (stdout) cpuidle_01.8/cpu1: checking 'name' exists...
> pass
> LAVA: (stdout) cpuidle_01.9/cpu1: checking 'power' exists...
> ...
Kejun ZHOU (kejun-zhou) wrote : | # |
The test has many cases to run.
At this time some cases have been finished yet. And some cases need to be
fixed. Some cases is blocked.
The pm-qa LAVA test is just to launch the pm-qa original test cases.
On 18 June 2012 11:05, Yongqin Liu <email address hidden> wrote:
> The tests seems not run correctly.
> It does not output the pm-qa=fail or pm-qa=pass result.
>
>
> Thanks,
> Yongqin Liu
> > (pm-qa)
> > $ lava-android-test install pm-qa
> > LAVA: --Start Operation: Install test (pm-qa)
> > LAVA: Begin to execute command: adb push
> > /usr/local/
> >
> packages/
> > /pm-qa/pm-qa.sh
> > /data/lava-
> > LAVA: (stdout) 32 KB/s (1350 bytes in 0.040s)
> > LAVA: Begin to execute command: adb shell chmod 777
> > /data/lava-
> > LAVA: --End Operation: Install test (pm-qa)
> > (pm-qa)
> > $ lava-android-test run pm-qa
> > LAVA: --Start Operation: Run test (pm-qa)
> > LAVA: Begin to execute command: adb shell
> > /data/lava-
> > LAVA: (stdout) mkdir failed for /data/bin/, File exists
> > LAVA: (stdout) /system/xbin/pm-qa
> > LAVA: (stdout) find: cpufreq: No such file or directory
> > LAVA: (stdout) /system/
> > LAVA: (stdout) ./cpuidle_01.sh
> > LAVA: (stdout) cpuidle_01.0: checking 'current_driver' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.1: checking 'current_
> > pass
> > LAVA: (stdout) cpuidle_01.0/cpu0: checking 'desc' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.1/cpu0: checking 'latency' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.2/cpu0: checking 'name' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.3/cpu0: checking 'power' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.4/cpu0: checking 'time' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.5/cpu0: checking 'usage' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.6/cpu0: checking 'desc' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.7/cpu0: checking 'latency' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.8/cpu0: checking 'name' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.9/cpu0: checking 'power' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.10/cpu0: checking 'time' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.11/cpu0: checking 'usage' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.0/cpu1: checking 'desc' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.1/cpu1: checking 'latency' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.2/cpu1: checking 'name' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.3/cpu1: checking 'power' exists...
> > pass
> > LAVA: (stdout) cpuidle_01.4/cpu1: checking 'time' exists...
> > pass
> > ...
Yongqin Liu (liuyq0307) wrote : | # |
OK, from the output above I did not see any issues.
You can use lava-android-test run pm-qa -o /tmp/pm-qa.json to verify the test result.
The the result in "test_results" is what you want.
Then it will be OK.
I will approve it now.
And if you have tested it, please let me know.
I will merge it then.
Thanks.
Yongqin Liu
Preview Diff
1 | === modified file 'MANIFEST.in' |
2 | --- MANIFEST.in 2012-05-24 11:34:49 +0000 |
3 | +++ MANIFEST.in 2012-06-15 10:13:29 +0000 |
4 | @@ -7,4 +7,8 @@ |
5 | include lava_android_test/test_definitions/cts/* |
6 | include lava_android_test/test_definitions/glmark2/* |
7 | include lava_android_test/test_definitions/gatortest/* |
8 | +<<<<<<< TREE |
9 | include lava_android_test/test_definitions/usbhardware/* |
10 | +======= |
11 | +include lava_android_test/test_definitions/pm-qa/* |
12 | +>>>>>>> MERGE-SOURCE |
13 | |
14 | === added directory 'lava_android_test/test_definitions/pm-qa' |
15 | === added file 'lava_android_test/test_definitions/pm-qa.py' |
16 | --- lava_android_test/test_definitions/pm-qa.py 1970-01-01 00:00:00 +0000 |
17 | +++ lava_android_test/test_definitions/pm-qa.py 2012-06-15 10:13:29 +0000 |
18 | @@ -0,0 +1,47 @@ |
19 | +# Copyright (c) 2011 Linaro |
20 | + |
21 | +# Author: Linaro Validation Team <linaro-dev@lists.linaro.org> |
22 | +# |
23 | +# This file is part of LAVA Android Test. |
24 | +# |
25 | +# |
26 | +# This program is free software: you can redistribute it and/or modify |
27 | +# it under the terms of the GNU General Public License as published by |
28 | +# the Free Software Foundation, either version 3 of the License, or |
29 | +# (at your option) any later version. |
30 | +# |
31 | +# This program is distributed in the hope that it will be useful, |
32 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
33 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
34 | +# GNU General Public License for more details. |
35 | +# |
36 | +# You should have received a copy of the GNU General Public License |
37 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
38 | +import os |
39 | +import lava_android_test.testdef |
40 | +from lava_android_test.config import get_config |
41 | + |
42 | +test_name = 'pm-qa' |
43 | +config = get_config() |
44 | +curdir = os.path.realpath(os.path.dirname(__file__)) |
45 | +test_sh_name = 'pm-qa.sh' |
46 | +test_sh_path = os.path.join(curdir, test_name, test_sh_name) |
47 | +test_sh_android_path = os.path.join(config.installdir_android, |
48 | + test_name, test_sh_name) |
49 | + |
50 | +INSTALL_STEPS_ADB_PRE = ['push %s %s ' % (test_sh_path, |
51 | + test_sh_android_path), |
52 | + 'shell chmod 777 %s' % test_sh_android_path] |
53 | + |
54 | +ADB_SHELL_STEPS = [test_sh_android_path] |
55 | +PATTERN = "^\s*(?P<test_case_id>\w+)=(?P<result>\w+)\s*$" |
56 | + |
57 | +inst = lava_android_test.testdef.AndroidTestInstaller( |
58 | + steps_adb_pre=INSTALL_STEPS_ADB_PRE) |
59 | +run = lava_android_test.testdef.AndroidTestRunner( |
60 | + adbshell_steps=ADB_SHELL_STEPS) |
61 | +parser = lava_android_test.testdef.AndroidTestParser(PATTERN) |
62 | +testobj = lava_android_test.testdef.AndroidTest(testname=test_name, |
63 | + installer=inst, |
64 | + runner=run, |
65 | + parser=parser) |
66 | |
67 | === added file 'lava_android_test/test_definitions/pm-qa/pm-qa.sh' |
68 | --- lava_android_test/test_definitions/pm-qa/pm-qa.sh 1970-01-01 00:00:00 +0000 |
69 | +++ lava_android_test/test_definitions/pm-qa/pm-qa.sh 2012-06-15 10:13:29 +0000 |
70 | @@ -0,0 +1,56 @@ |
71 | +#!/system/bin/sh |
72 | + |
73 | +test_func(){ |
74 | + if [ ! -d /system/xbin/pm-qa ]; then |
75 | + echo "pm-qa=fail" |
76 | + exit |
77 | + fi |
78 | + |
79 | + mkdir /data/bin/ |
80 | + cd /data/bin |
81 | + |
82 | + busybox ln -s -f /system/bin/busybox awk |
83 | + busybox ln -s -f /system/bin/busybox basename |
84 | + busybox ln -s -f /system/bin/busybox chmod |
85 | + busybox ln -s -f /system/bin/busybox chown |
86 | + busybox ln -s -f /system/bin/busybox cp |
87 | + busybox ln -s -f /system/bin/busybox diff |
88 | + busybox ln -s -f /system/bin/busybox find |
89 | + busybox ln -s -f /system/bin/busybox grep |
90 | + busybox ln -s -f /system/bin/busybox rm |
91 | + busybox ln -s -f /system/bin/busybox seq |
92 | + busybox ln -s -f /system/bin/busybox taskset |
93 | + busybox ln -s -f /system/bin/busybox tee |
94 | + busybox ln -s -f /system/bin/busybox printf |
95 | + busybox ln -s -f /system/bin/busybox wc |
96 | + |
97 | + export PATH=/data/bin:$PATH |
98 | + |
99 | + cd /system/xbin/pm-qa |
100 | + |
101 | + pwd=$PWD |
102 | + echo $pwd |
103 | + tests_dirs="cpuidle cpufreq cpuhotplug sched_mc suspend thermal utils" |
104 | + files=`find cpuidle cpufreq cpuhotplug sched_mc suspend thermal utils -name "*.sh"` |
105 | + |
106 | + for dir in $tests_dirs |
107 | + do |
108 | + subDir=`pwd`/$dir |
109 | + if [ -d $subDir ]; then |
110 | + cd $subDir |
111 | + fi |
112 | + |
113 | + echo `pwd` |
114 | + for file in `find . -name "*.sh"` |
115 | + do |
116 | + path=$file |
117 | + echo $path |
118 | + /system/bin/sh $path |
119 | + done |
120 | + cd .. |
121 | + done |
122 | + |
123 | + echo "pm-qa=pass" |
124 | +} |
125 | + |
126 | +test_func |
92 + for tests_dirs in $tests_dirs
the same variable name "tests_dirs" is used.
94 + subDir= `pwd`/$ tests_dirs
95 + if [ -d $subDir ]; then
96 + cd $subDir
97 + fi
the pm-qa.sh will be run like this "adb shell /xxx/pm-qa.sh"
and the pwd should be the home of root "/",
if you do not do something before run pm-qa.sh,
I don't think there will be "cpuidle cpufreq cpuhotplug sched_mc suspend thermal utils" directories under the root directory.