Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import contextlib | 5 import contextlib |
| 6 import datetime | 6 import datetime |
| 7 import json | 7 import json |
| 8 import os | 8 import os |
| 9 import re | 9 import re |
| 10 import sys | 10 import sys |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 364 | 364 |
| 365 def device_status_check(self, restart_usb=False, **kwargs): | 365 def device_status_check(self, restart_usb=False, **kwargs): |
| 366 # TODO(bpastene): Remove once chromium revisions prior to | 366 # TODO(bpastene): Remove once chromium revisions prior to |
| 367 # crrev.com/1faecde0c03013b6cd725da413339c60223f8948 are no longer tested. | 367 # crrev.com/1faecde0c03013b6cd725da413339c60223f8948 are no longer tested. |
| 368 # See crbug.com/619707 for context. | 368 # See crbug.com/619707 for context. |
| 369 self.revert_device_file_format() | 369 self.revert_device_file_format() |
| 370 self.device_recovery() | 370 self.device_recovery() |
| 371 return self.device_status() | 371 return self.device_status() |
| 372 | 372 |
| 373 def host_info(self, args=[], **kwargs): | 373 def host_info(self, args=[], **kwargs): |
| 374 results = None | |
| 374 try: | 375 try: |
| 375 with self.handle_exit_codes(): | 376 with self.handle_exit_codes(): |
| 376 args.extend(['run', '--output', self.m.json.output()]) | 377 args.extend(['run', '--output', self.m.json.output()]) |
| 377 results = self.m.step( | 378 results = self.m.step( |
| 378 'Host_Info', | 379 'Host Info', |
|
jbudorick
2016/07/29 18:17:41
This is really the most important part of this pat
rnephew (Reviews Here)
2016/07/29 18:44:48
Acknowledged.
| |
| 379 [self.m.path['checkout'].join('testing', 'scripts', | 380 [self.m.path['checkout'].join('testing', 'scripts', |
| 380 'host_info.py')] + args, | 381 'host_info.py')] + args, |
| 381 env=self.m.chromium.get_env(), | 382 env=self.m.chromium.get_env(), |
| 382 infra_step=True, | 383 infra_step=True, |
| 383 step_test_data=lambda: self.m.json.test_api.output({ | 384 step_test_data=lambda: self.m.json.test_api.output({ |
| 384 'valid': True, | 385 'valid': True, |
| 385 'failures': ['Device 3208154b735c5117 blacklisted'], | 386 'failures': ['Failure A', 'Failure B'], |
| 386 '_host_info': { | 387 '_host_info': { |
| 387 'os_system': 'os_system', | 388 'os_system': 'os_system', |
| 388 'os_release': 'os_release', | 389 'os_release': 'os_release', |
| 389 'processor': 'processor', | 390 'processor': 'processor', |
| 390 'num_cpus': 'num_cpus', | 391 'num_cpus': 'num_cpus', |
| 391 'free_disk_space': 'free_disk_space', | 392 'free_disk_space': 'free_disk_space', |
| 392 'python_version': 'python_version', | 393 'python_version': 'python_version', |
| 393 'python_path': 'python_path', | 394 'python_path': 'python_path', |
| 394 'devices': [{ | 395 'devices': [{ |
| 395 "usb_status": True, | 396 "usb_status": True, |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 411 }, | 412 }, |
| 412 "adb_status": "device", | 413 "adb_status": "device", |
| 413 "imei_slice": "", | 414 "imei_slice": "", |
| 414 "ro.build.product": "bullhead", | 415 "ro.build.product": "bullhead", |
| 415 "ro.build.id": "MDB08Q", | 416 "ro.build.id": "MDB08Q", |
| 416 "serial": "00d0d567893340f4", | 417 "serial": "00d0d567893340f4", |
| 417 "wifi_ip": "" | 418 "wifi_ip": "" |
| 418 }] | 419 }] |
| 419 }}), | 420 }}), |
| 420 **kwargs) | 421 **kwargs) |
| 421 if results.json.output.get('failures'): | |
| 422 results.presentation.logs['Failures'] = results.json.output['failures'] | |
| 423 return results | 422 return results |
| 424 except self.m.step.InfraFailure: | 423 except self.m.step.InfraFailure: |
| 425 pass | 424 pass |
| 425 finally: | |
| 426 if results and results.json.output.get('failures'): | |
| 427 for failure in results.json.output['failures']: | |
|
jbudorick
2016/07/29 18:17:41
optional nit: could do
if results:
for fail
rnephew (Reviews Here)
2016/07/29 18:44:48
Done.
| |
| 428 results.presentation.logs[failure] = [failure] | |
| 426 | 429 |
| 427 def device_recovery(self, restart_usb=False, **kwargs): | 430 def device_recovery(self, restart_usb=False, **kwargs): |
| 428 args = [ | 431 args = [ |
| 429 '--blacklist-file', self.blacklist_file, | 432 '--blacklist-file', self.blacklist_file, |
| 430 '--known-devices-file', self.known_devices_file, | 433 '--known-devices-file', self.known_devices_file, |
| 431 '--adb-path', self.m.adb.adb_path(), | 434 '--adb-path', self.m.adb.adb_path(), |
| 432 '-v' | 435 '-v' |
| 433 ] | 436 ] |
| 434 self.m.step( | 437 self.m.step( |
| 435 'device_recovery', | 438 'device_recovery', |
| (...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1463 script = self.c.test_runner | 1466 script = self.c.test_runner |
| 1464 if wrapper_script_suite_name: | 1467 if wrapper_script_suite_name: |
| 1465 script = self.m.chromium.output_dir.join('bin', 'run_%s' % | 1468 script = self.m.chromium.output_dir.join('bin', 'run_%s' % |
| 1466 wrapper_script_suite_name) | 1469 wrapper_script_suite_name) |
| 1467 else: | 1470 else: |
| 1468 env = kwargs.get('env', {}) | 1471 env = kwargs.get('env', {}) |
| 1469 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', | 1472 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', |
| 1470 self.m.chromium.output_dir) | 1473 self.m.chromium.output_dir) |
| 1471 kwargs['env'] = env | 1474 kwargs['env'] = env |
| 1472 return self.m.python(step_name, script, args, **kwargs) | 1475 return self.m.python(step_name, script, args, **kwargs) |
| OLD | NEW |