| 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 try: | 374 try: |
| 375 with self.handle_exit_codes(): | 375 with self.handle_exit_codes(): |
| 376 args.extend(['run', '--output', self.m.json.output()]) | 376 args.extend(['run', '--output', self.m.json.output()]) |
| 377 self.m.step( | 377 results = self.m.step( |
| 378 'Host_Info', | 378 'Host_Info', |
| 379 [self.m.path['checkout'].join('testing', 'scripts', | 379 [self.m.path['checkout'].join('testing', 'scripts', |
| 380 'host_info.py')] + args, | 380 'host_info.py')] + args, |
| 381 env=self.m.chromium.get_env(), | 381 env=self.m.chromium.get_env(), |
| 382 infra_step=True, | 382 infra_step=True, |
| 383 step_test_data=lambda: self.m.json.test_api.output({ | 383 step_test_data=lambda: self.m.json.test_api.output({ |
| 384 'valid': True, | 384 'valid': True, |
| 385 'failures': [], | 385 'failures': ['Device 3208154b735c5117 blacklisted'], |
| 386 '_host_info': { | 386 '_host_info': { |
| 387 'os_system': 'os_system', | 387 'os_system': 'os_system', |
| 388 'os_release': 'os_release', | 388 'os_release': 'os_release', |
| 389 'processor': 'processor', | 389 'processor': 'processor', |
| 390 'num_cpus': 'num_cpus', | 390 'num_cpus': 'num_cpus', |
| 391 'free_disk_space': 'free_disk_space', | 391 'free_disk_space': 'free_disk_space', |
| 392 'python_version': 'python_version', | 392 'python_version': 'python_version', |
| 393 'python_path': 'python_path', | 393 'python_path': 'python_path', |
| 394 'devices': [{ | 394 'devices': [{ |
| 395 "usb_status": True, | 395 "usb_status": True, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 411 }, | 411 }, |
| 412 "adb_status": "device", | 412 "adb_status": "device", |
| 413 "imei_slice": "", | 413 "imei_slice": "", |
| 414 "ro.build.product": "bullhead", | 414 "ro.build.product": "bullhead", |
| 415 "ro.build.id": "MDB08Q", | 415 "ro.build.id": "MDB08Q", |
| 416 "serial": "00d0d567893340f4", | 416 "serial": "00d0d567893340f4", |
| 417 "wifi_ip": "" | 417 "wifi_ip": "" |
| 418 }] | 418 }] |
| 419 }}), | 419 }}), |
| 420 **kwargs) | 420 **kwargs) |
| 421 if results.json.output.get('failures'): |
| 422 results.presentation.logs['Failures'] = results.json.output['failures'] |
| 423 return results |
| 421 except self.m.step.InfraFailure: | 424 except self.m.step.InfraFailure: |
| 422 pass | 425 pass |
| 423 | 426 |
| 424 def device_recovery(self, restart_usb=False, **kwargs): | 427 def device_recovery(self, restart_usb=False, **kwargs): |
| 425 args = [ | 428 args = [ |
| 426 '--blacklist-file', self.blacklist_file, | 429 '--blacklist-file', self.blacklist_file, |
| 427 '--known-devices-file', self.known_devices_file, | 430 '--known-devices-file', self.known_devices_file, |
| 428 '--adb-path', self.m.adb.adb_path(), | 431 '--adb-path', self.m.adb.adb_path(), |
| 429 '-v' | 432 '-v' |
| 430 ] | 433 ] |
| (...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 script = self.c.test_runner | 1463 script = self.c.test_runner |
| 1461 if wrapper_script_suite_name: | 1464 if wrapper_script_suite_name: |
| 1462 script = self.m.chromium.output_dir.join('bin', 'run_%s' % | 1465 script = self.m.chromium.output_dir.join('bin', 'run_%s' % |
| 1463 wrapper_script_suite_name) | 1466 wrapper_script_suite_name) |
| 1464 else: | 1467 else: |
| 1465 env = kwargs.get('env', {}) | 1468 env = kwargs.get('env', {}) |
| 1466 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', | 1469 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', |
| 1467 self.m.chromium.output_dir) | 1470 self.m.chromium.output_dir) |
| 1468 kwargs['env'] = env | 1471 kwargs['env'] = env |
| 1469 return self.m.python(step_name, script, args, **kwargs) | 1472 return self.m.python(step_name, script, args, **kwargs) |
| OLD | NEW |