OLD | NEW |
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 argparse | 8 import argparse |
9 import json | 9 import json |
10 import logging | 10 import logging |
11 import os | 11 import os |
12 import psutil | 12 import psutil |
13 import re | 13 import re |
14 import signal | 14 import signal |
15 import smtplib | 15 import smtplib |
16 import subprocess | 16 import subprocess |
17 import sys | 17 import sys |
18 import time | 18 import time |
19 import urllib | 19 import urllib |
20 | 20 |
21 import bb_annotations | 21 import bb_annotations |
22 import bb_utils | 22 import bb_utils |
23 | 23 |
24 sys.path.append(os.path.join(os.path.dirname(__file__), | 24 sys.path.append(os.path.join(os.path.dirname(__file__), |
25 os.pardir, os.pardir, 'util', 'lib', | 25 os.pardir, os.pardir, 'util', 'lib', |
26 'common')) | 26 'common')) |
27 import perf_tests_results_helper # pylint: disable=F0401 | 27 import perf_tests_results_helper # pylint: disable=F0401 |
28 | 28 |
29 sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) | 29 sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) |
| 30 from devil.android import battery_utils |
| 31 from devil.android import device_blacklist |
| 32 from devil.android import device_errors |
| 33 from devil.android import device_list |
| 34 from devil.android import device_utils |
| 35 from devil.android.sdk import adb_wrapper |
30 from devil.utils import reset_usb | 36 from devil.utils import reset_usb |
| 37 from devil.utils import run_tests_helper |
| 38 from devil.utils import timeout_retry |
31 from pylib import constants | 39 from pylib import constants |
32 from pylib.cmd_helper import GetCmdOutput | 40 from pylib.cmd_helper import GetCmdOutput |
33 from pylib.device import adb_wrapper | |
34 from pylib.device import battery_utils | |
35 from pylib.device import device_blacklist | |
36 from pylib.device import device_errors | |
37 from pylib.device import device_list | |
38 from pylib.device import device_utils | |
39 from pylib.utils import run_tests_helper | |
40 from pylib.utils import timeout_retry | |
41 | 41 |
42 _RE_DEVICE_ID = re.compile('Device ID = (\d+)') | 42 _RE_DEVICE_ID = re.compile('Device ID = (\d+)') |
43 | 43 |
44 def DeviceInfo(device, args): | 44 def DeviceInfo(device, args): |
45 """Gathers info on a device via various adb calls. | 45 """Gathers info on a device via various adb calls. |
46 | 46 |
47 Args: | 47 Args: |
48 device: A DeviceUtils instance for the device to construct info about. | 48 device: A DeviceUtils instance for the device to construct info about. |
49 | 49 |
50 Returns: | 50 Returns: |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 | 409 |
410 if num_failed_devs == len(devices): | 410 if num_failed_devs == len(devices): |
411 return 2 | 411 return 2 |
412 | 412 |
413 if not devices: | 413 if not devices: |
414 return 1 | 414 return 1 |
415 | 415 |
416 | 416 |
417 if __name__ == '__main__': | 417 if __name__ == '__main__': |
418 sys.exit(main()) | 418 sys.exit(main()) |
OLD | NEW |