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

Side by Side Diff: build/android/buildbot/bb_device_status_check.py

Issue 181433020: GetAttachedDevices() should not include bad devices listed in .bad_devices file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add ResetBadDevices and ExtendBadDevices to android_commands.py. Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | build/android/pylib/android_commands.py » ('j') | 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 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """A class to keep track of devices across builds and report state.""" 7 """A class to keep track of devices across builds and report state."""
8 import logging 8 import logging
9 import optparse 9 import optparse
10 import os 10 import os
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 parser.add_option('--no-provisioning-check', action='store_true', 286 parser.add_option('--no-provisioning-check', action='store_true',
287 help='Will not check if devices are provisioned properly.') 287 help='Will not check if devices are provisioned properly.')
288 parser.add_option('--device-status-dashboard', action='store_true', 288 parser.add_option('--device-status-dashboard', action='store_true',
289 help='Output device status data for dashboard.') 289 help='Output device status data for dashboard.')
290 parser.add_option('--restart-usb', action='store_true', 290 parser.add_option('--restart-usb', action='store_true',
291 help='Restart USB ports before running device check.') 291 help='Restart USB ports before running device check.')
292 options, args = parser.parse_args() 292 options, args = parser.parse_args()
293 if args: 293 if args:
294 parser.error('Unknown options %s' % args) 294 parser.error('Unknown options %s' % args)
295 295
296 # Remove the last builds "bad devices" before checking device statuses.
297 android_commands.ResetBadDevices()
298
296 if options.restart_usb: 299 if options.restart_usb:
297 expected_devices = GetLastDevices(os.path.abspath(options.out_dir)) 300 expected_devices = GetLastDevices(os.path.abspath(options.out_dir))
298 devices = android_commands.GetAttachedDevices() 301 devices = android_commands.GetAttachedDevices()
299 # Only restart usb if devices are missing. 302 # Only restart usb if devices are missing.
300 if set(expected_devices) != set(devices): 303 if set(expected_devices) != set(devices):
301 KillAllAdb() 304 KillAllAdb()
302 retries = 5 305 retries = 5
303 usb_restarted = True 306 usb_restarted = True
304 if not RestartUsb(): 307 if not RestartUsb():
305 usb_restarted = False 308 usb_restarted = False
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 # devices with critically low battery or install speed. Remove those devices 368 # devices with critically low battery or install speed. Remove those devices
366 # from testing, allowing build to continue with good devices. 369 # from testing, allowing build to continue with good devices.
367 return 1 370 return 1
368 371
369 if not devices: 372 if not devices:
370 return 1 373 return 1
371 374
372 375
373 if __name__ == '__main__': 376 if __name__ == '__main__':
374 sys.exit(main()) 377 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/android_commands.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698