Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: testing/scripts/host_info.py

Issue 2214883002: [Android] Add known devices flag for host_info. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add warning known_devices_file is used only in host_info Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing/scripts/common.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import json 6 import json
7 import multiprocessing 7 import multiprocessing
8 import os 8 import os
9 import platform 9 import platform
10 import subprocess 10 import subprocess
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 """Parses the device info for each attached device, and returns a summary 50 """Parses the device info for each attached device, and returns a summary
51 of the device info and any mismatches. 51 of the device info and any mismatches.
52 52
53 Returns: 53 Returns:
54 A dict indicating the result. 54 A dict indicating the result.
55 """ 55 """
56 if not is_linux(): 56 if not is_linux():
57 return {} 57 return {}
58 58
59 with common.temporary_file() as tempfile_path: 59 with common.temporary_file() as tempfile_path:
60 rc = common.run_command([ 60 test_cmd = [
61 sys.executable, 61 sys.executeable,
shatch 2016/08/04 16:47:02 Is this right?
rnephew (Reviews Here) 2016/08/04 16:50:48 Would you believe me if I said yes? Fixed.
shatch 2016/08/04 16:58:02 haha
62 os.path.join(args.paths['checkout'], 62 os.path.join(args.paths['checkout'],
63 'third_party', 63 'third_party',
64 'catapult', 64 'catapult',
65 'devil', 65 'devil',
66 'devil', 66 'devil',
67 'android', 67 'android',
68 'tools', 68 'tools',
69 'device_status.py'), 69 'device_status.py'),
70 '--json-output', tempfile_path, 70 '--json-output', tempfile_path,
71 '--blacklist-file', os.path.join( 71 '--blacklist-file', os.path.join(
72 args.paths['checkout'], 'out', 'bad_devices.json')]) 72 args.paths['checkout'], 'out', 'bad_devices.json')
73 ]
74 if args.known_devices_file:
75 test_cmd.extend(['--known-devices-file', args.known_devices_file])
73 76
77 rc = common.run_command(test_cmd)
74 if rc: 78 if rc:
75 failures.append('device_status') 79 failures.append('device_status')
76 return {} 80 return {}
77 81
78 with open(tempfile_path, 'r') as src: 82 with open(tempfile_path, 'r') as src:
79 device_info = json.load(src) 83 device_info = json.load(src)
80 84
81 results = {} 85 results = {}
82 results['devices'] = sorted(v['serial'] for v in device_info) 86 results['devices'] = sorted(v['serial'] for v in device_info)
83 87
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 def main_compile_targets(args): 141 def main_compile_targets(args):
138 json.dump([], args.output) 142 json.dump([], args.output)
139 143
140 144
141 if __name__ == '__main__': 145 if __name__ == '__main__':
142 funcs = { 146 funcs = {
143 'run': main_run, 147 'run': main_run,
144 'compile_targets': main_compile_targets, 148 'compile_targets': main_compile_targets,
145 } 149 }
146 sys.exit(common.run_script(sys.argv[1:], funcs)) 150 sys.exit(common.run_script(sys.argv[1:], funcs))
OLDNEW
« no previous file with comments | « testing/scripts/common.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698