Merge lp:~liuyq0307/lava-android-test/cts-logcat-hostlog into lp:lava-android-test

Proposed by Yongqin Liu
Status: Merged
Merged at revision: 257
Proposed branch: lp:~liuyq0307/lava-android-test/cts-logcat-hostlog
Merge into: lp:lava-android-test
Diff against target: 49 lines (+23/-6)
2 files modified
lava_android_test/test_definitions/cts.py (+10/-6)
lava_android_test/test_definitions/cts/cts_wrapper.py (+13/-0)
To merge this branch: bzr merge lp:~liuyq0307/lava-android-test/cts-logcat-hostlog
Reviewer Review Type Date Requested Status
Yongqin Liu self test Approve
Review via email: mp+168274@code.launchpad.net

Description of the change

add the host_log and device_logcat log of CTS test into the result as attachment.

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.py'
2--- lava_android_test/test_definitions/cts.py 2013-06-03 08:35:02 +0000
3+++ lava_android_test/test_definitions/cts.py 2013-06-09 07:34:25 +0000
4@@ -52,13 +52,17 @@
5 fixupdict={'PASS': 'pass', 'FAIL': 'fail'})
6
7 attachments = [
8- Attachment(pathname="/data/local/tmp/logcat.log",
9- mime_type="text/plain"),
10- Attachment(pathname="/data/local/tmp/kmsg.log",
11- mime_type="text/plain"),
12- Attachment(pathname="/data/local/tmp/cts-results.zip",
13+ Attachment(pathname="/data/local/tmp/logcat.log",
14+ mime_type="text/plain"),
15+ Attachment(pathname="/data/local/tmp/kmsg.log",
16+ mime_type="text/plain"),
17+ Attachment(pathname="/data/local/tmp/cts-results.zip",
18+ mime_type="application/zip"),
19+ Attachment(pathname="/data/local/tmp/device_logcat.zip",
20+ mime_type="application/zip"),
21+ Attachment(pathname="/data/local/tmp/host_log.zip",
22 mime_type="application/zip")
23- ]
24+ ]
25 testobj = AndroidTest(testname=test_name,
26 installer=inst,
27 runner=run,
28
29=== modified file 'lava_android_test/test_definitions/cts/cts_wrapper.py'
30--- lava_android_test/test_definitions/cts/cts_wrapper.py 2013-06-03 08:35:02 +0000
31+++ lava_android_test/test_definitions/cts/cts_wrapper.py 2013-06-09 07:34:25 +0000
32@@ -61,6 +61,19 @@
33 if ret_code != 0:
34 print "Failed to push file %s to device(%s)" % (zip_f,
35 adb.get_serial())
36+ log_target_dir = os.path.join(os.getcwd(),
37+ './android-cts/repository/logs/')
38+ for zip_f in find_files(log_target_dir, '.zip'):
39+ base_name = os.path.basename(zip_f)
40+ if base_name.startswith('device_logcat_'):
41+ base_name = 'device_logcat.zip'
42+ if base_name.startswith('host_log_'):
43+ base_name = 'host_log.zip'
44+
45+ ret_code = adb.push(zip_f, '/data/local/tmp/%s' % base_name)[0]
46+ if ret_code != 0:
47+ print "Failed to push file %s to device(%s)" % (zip_f,
48+ adb.get_serial())
49 return result
50
51

Subscribers

People subscribed via source and target branches