Merge lp:~liuyq0307/lava-android-test/cts-4_1_r1 into lp:lava-android-test

Proposed by Yongqin Liu
Status: Merged
Merged at revision: 212
Proposed branch: lp:~liuyq0307/lava-android-test/cts-4_1_r1
Merge into: lp:lava-android-test
Diff against target: 93 lines (+45/-5)
2 files modified
lava_android_test/test_definitions/cts/cts_prepare.sh (+3/-3)
lava_android_test/test_definitions/cts/cts_wrapper.py (+42/-2)
To merge this branch: bzr merge lp:~liuyq0307/lava-android-test/cts-4_1_r1
Reviewer Review Type Date Requested Status
Linaro Validation Team Pending
Review via email: mp+128429@code.launchpad.net

Description of the change

update to use the latest 4.1.r1 package that google provided

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I don't feel particularly qualified to review this, but it looks OK I
guess. We're not actually running CTS currently, right?

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

> I don't feel particularly qualified to review this, but it looks OK I
> guess. We're not actually running CTS currently, right?

Yes, we are not running the CTS because the bug it consumes the CPU.
But this branch is not for that problem, it is just updated to use the latest cts-4_1_r1 CTS package.

And I want to investigate the CTS consumes CPU problem based on this branch with the latest CTS package

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

Sorry, this is the CTS consumes CPU bug:
https://bugs.launchpad.net/linaro-android/+bug/1034218

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Yongqin Liu <email address hidden> writes:

>> I don't feel particularly qualified to review this, but it looks OK I
>> guess. We're not actually running CTS currently, right?
>
> Yes, we are not running the CTS because the bug it consumes the CPU.
> But this branch is not for that problem, it is just updated to use the latest cts-4_1_r1 CTS package.
>
> And I want to investigate the CTS consumes CPU problem based on this branch with the latest CTS package

Fair enough. Merge away then :-)

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/cts/cts_prepare.sh'
2--- lava_android_test/test_definitions/cts/cts_prepare.sh 2012-06-26 03:38:38 +0000
3+++ lava_android_test/test_definitions/cts/cts_prepare.sh 2012-10-08 07:12:20 +0000
4@@ -20,9 +20,9 @@
5
6 #http://source.android.com/compatibility/downloads.html
7
8-cts_pkg="android-cts-4.0.3_r3-linux_x86-arm.zip"
9-media_pkg="android-cts-media-1.0.zip"
10-site_url="https://dl.google.com/dl/android/cts/"
11+cts_pkg="android-cts-linux_x86-arm-latest.zip"
12+media_pkg="android-cts-media-latest.zip"
13+site_url="http://testdata.validation.linaro.org/cts/"
14 #site_url="http://192.168.1.127/images/cts/"
15 #export http_proxy=http://localhost:3128
16
17
18=== modified file 'lava_android_test/test_definitions/cts/cts_wrapper.py'
19--- lava_android_test/test_definitions/cts/cts_wrapper.py 2012-06-27 08:32:16 +0000
20+++ lava_android_test/test_definitions/cts/cts_wrapper.py 2012-10-08 07:12:20 +0000
21@@ -22,6 +22,7 @@
22 import os
23 import re
24 import sys
25+import xml.dom.minidom
26 from lava_android_test.adb import ADB
27 from lava_android_test.utils import stop_at_pattern
28
29@@ -75,6 +76,21 @@
30 return True
31
32
33+def run_cts_with_package(cts_cmd=None, package=None):
34+ pattern = "I/CommandScheduler: All done"
35+ if not package:
36+ return False
37+ package_command = '--package %s' % package
38+ if cts_cmd:
39+ cts_command = "%s %s" % (cts_cmd, package_command)
40+ if not stop_at_pattern(command=cts_command, pattern=pattern,
41+ timeout=36000):
42+ print "CTS test times out"
43+ return False
44+
45+ return True
46+
47+
48 def run_cts_continue(cts_cmd=None):
49 pattern = "Time:"
50 continue_command = '--continue-session 0'
51@@ -147,6 +163,26 @@
52 print '<<<<<=========Log file [%s] ends=========' % log_file
53
54
55+def get_all_packages(plan_file=None):
56+ if not plan_file:
57+ return []
58+ if not os.path.exists(plan_file):
59+ print "file(%s) does not exist" % plan_file
60+ return []
61+
62+ package_list = []
63+ try:
64+ dom = xml.dom.minidom.parse(plan_file)
65+ test_plan = dom.getElementsByTagName("TestPlan")[0]
66+ for entry in test_plan.getElementsByTagName("Entry"):
67+ package_list.append(entry.attributes.get('uri').value)
68+ except Exception as e:
69+ print "Has exception to parse the xml file"
70+ print "Exception: %s" % e
71+ finally:
72+ return package_list
73+
74+
75 def main():
76 run_wrapper_path = os.path.join(curdir, 'cts_run_wrapper.sh')
77 run_wrapper_cmd = "bash %s" % run_wrapper_path
78@@ -156,9 +192,13 @@
79 logs = collect_logs()
80 if not prepare_cts():
81 sys.exit(1)
82+
83+ cts_plan = './android-cts/repository/plans/CTS.xml'
84+ pkg_list = get_all_packages(plan_file=cts_plan)
85 try:
86- run_cts_with_plan(run_wrapper_cmd)
87- run_cts_continue(run_wrapper_cmd)
88+ for pkg in pkg_list:
89+ if not run_cts_with_package(cts_cmd=run_wrapper_cmd, package=pkg):
90+ run_cts_continue(run_wrapper_cmd)
91 finally:
92 for log in logs:
93 pid = log.get('pid')

Subscribers

People subscribed via source and target branches