Chromium Code Reviews| Index: build/android/buildbot/bb_device_status_check.py |
| diff --git a/build/android/buildbot/bb_device_status_check.py b/build/android/buildbot/bb_device_status_check.py |
| index 1a238de9a054febd12cfde75b76b53d6016eaf5e..8b4018f74bbde31b75fc099528565a6ba86eb5ba 100755 |
| --- a/build/android/buildbot/bb_device_status_check.py |
| +++ b/build/android/buildbot/bb_device_status_check.py |
| @@ -5,6 +5,7 @@ |
| # found in the LICENSE file. |
| """A class to keep track of devices across builds and report state.""" |
| +import json |
| import logging |
| import optparse |
| import os |
| @@ -275,6 +276,8 @@ def main(): |
| help='Output device status data for dashboard.') |
| parser.add_option('--restart-usb', action='store_true', |
| help='Restart USB ports before running device check.') |
| + parser.add_option('--json-output', |
| + help='Output JSON information into a specified file.') |
|
tonyg
2014/07/11 02:19:15
We should document the format somewhere.
|
| options, args = parser.parse_args() |
| if args: |
| @@ -359,6 +362,13 @@ def main(): |
| [battery], '%', |
| 'unimportant') |
| + if options.json_output: |
| + with open(options.json_output, 'wb') as f: |
| + f.write(json.dumps({ |
| + 'online_devices': devices, |
|
tonyg
2014/07/11 02:19:15
Let's add expected_devices too.
Also, prior to re
zty
2014/07/11 18:58:30
Acknowledged.
|
| + 'offline_devices': offline_devices |
| + })) |
| + |
| if False in fail_step_lst: |
| # TODO(navabi): Build fails on device status check step if there exists any |
| # devices with critically low battery. Remove those devices from testing, |