Merge lp:~liuyq0307/lava-android-test/cts-class-support into lp:lava-android-test

Proposed by Yongqin Liu
Status: Merged
Merged at revision: 250
Proposed branch: lp:~liuyq0307/lava-android-test/cts-class-support
Merge into: lp:lava-android-test
Diff against target: 68 lines (+29/-1)
1 file modified
lava_android_test/test_definitions/cts/cts_wrapper.py (+29/-1)
To merge this branch: bzr merge lp:~liuyq0307/lava-android-test/cts-class-support
Reviewer Review Type Date Requested Status
Yongqin Liu self test Approve
Review via email: mp+162571@code.launchpad.net

Description of the change

Add the support for running by class and method for CTS test,
this will be helpful for try and investigate the class and method test case of CTS on lava.

tested it on my local

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/cts/cts_wrapper.py'
2--- lava_android_test/test_definitions/cts/cts_wrapper.py 2013-03-27 03:52:59 +0000
3+++ lava_android_test/test_definitions/cts/cts_wrapper.py 2013-05-06 08:29:28 +0000
4@@ -104,7 +104,9 @@
5 return True
6
7
8-def run_cts_with_package(cts_cmd=None, package='CTS', timeout=36000):
9+def run_cts_with_package(cts_cmd=None, package=None, timeout=36000):
10+ if not package:
11+ return True
12 pattern = "Time:"
13 plan_command = '--package %s' % package
14 if cts_cmd:
15@@ -117,6 +119,24 @@
16 return True
17
18
19+def run_cts_with_class(cts_cmd=None, cls=None, method=None, timeout=36000):
20+ if not cls:
21+ return True
22+ pattern = "Time:"
23+ cmd = '--class %s' % cls
24+ if method:
25+ cmd = '%s --method %s' % (cmd, method)
26+
27+ if cts_cmd:
28+ cmd = "%s %s --disable-reboot" % (cts_cmd, cmd)
29+ if not stop_at_cts_pattern(command=cmd, pattern=pattern,
30+ timeout=timeout):
31+ print "CTS test times out"
32+ return False
33+
34+ return True
35+
36+
37 def run_cts_continue(cts_cmd=None):
38 pattern = "Time:"
39 continue_command = '--continue-session 0'
40@@ -227,6 +247,8 @@
41
42 package_name = None
43 plan_name = 'CTS'
44+ class_name= None
45+ method_name = None
46 timeout = 36000
47 #--cts_pkg cts_package_file --package package_name --timeout 36000
48 #--cts_pkg cts_package_file --plan plan_name --timeout 36000
49@@ -245,6 +267,9 @@
50 if timeout:
51 timeout = int(timeout)
52
53+ class_name = get_value_from_paras(paras=paras, option='--class')
54+ method_name = get_value_from_paras(paras=paras, option='--method')
55+
56 run_wrapper_path = os.path.join('./android-cts/tools/cts-tradefed ')
57 run_wrapper_cmd = "%s" % run_wrapper_path
58 run_wrapper_cmd = '%s run cts --serial %s' % (run_wrapper_cmd,
59@@ -258,6 +283,9 @@
60 if package_name:
61 run_cts_with_package(cts_cmd=run_wrapper_cmd, package=package_name,
62 timeout=timeout)
63+ elif class_name:
64+ run_cts_with_class(cts_cmd=run_wrapper_cmd, cls=class_name,
65+ method=method_name, timeout=timeout)
66 else:
67 run_cts_with_plan(cts_cmd=run_wrapper_cmd, plan=plan_name,
68 timeout=timeout)

Subscribers

People subscribed via source and target branches