OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 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 """Provisions Android devices with settings required for bots. | 7 """Provisions Android devices with settings required for bots. |
8 | 8 |
9 Usage: | 9 Usage: |
10 ./provision_devices.py [-d <device serial number>] | 10 ./provision_devices.py [-d <device serial number>] |
11 """ | 11 """ |
12 | 12 |
13 import argparse | 13 import argparse |
14 import datetime | 14 import datetime |
15 import json | 15 import json |
16 import logging | 16 import logging |
17 import os | 17 import os |
18 import posixpath | 18 import posixpath |
19 import re | 19 import re |
20 import subprocess | 20 import subprocess |
21 import sys | 21 import sys |
22 import time | 22 import time |
23 | 23 |
| 24 import devil_chromium |
24 from devil.android import battery_utils | 25 from devil.android import battery_utils |
25 from devil.android import device_blacklist | 26 from devil.android import device_blacklist |
26 from devil.android import device_errors | 27 from devil.android import device_errors |
27 from devil.android import device_temp_file | 28 from devil.android import device_temp_file |
28 from devil.android import device_utils | 29 from devil.android import device_utils |
29 from devil.android.sdk import version_codes | 30 from devil.android.sdk import version_codes |
30 from devil.utils import run_tests_helper | 31 from devil.utils import run_tests_helper |
31 from devil.utils import timeout_retry | 32 from devil.utils import timeout_retry |
32 from pylib import constants | 33 from pylib import constants |
33 from pylib import device_settings | 34 from pylib import device_settings |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 help='Wait for the battery to have this temp or lower.') | 478 help='Wait for the battery to have this temp or lower.') |
478 parser.add_argument('--output-device-blacklist', | 479 parser.add_argument('--output-device-blacklist', |
479 help='Json file to output the device blacklist.') | 480 help='Json file to output the device blacklist.') |
480 parser.add_argument('--chrome-specific-wipe', action='store_true', | 481 parser.add_argument('--chrome-specific-wipe', action='store_true', |
481 help='only wipe chrome specific data during provisioning') | 482 help='only wipe chrome specific data during provisioning') |
482 args = parser.parse_args() | 483 args = parser.parse_args() |
483 constants.SetBuildType(args.target) | 484 constants.SetBuildType(args.target) |
484 | 485 |
485 run_tests_helper.SetLogLevel(args.verbose) | 486 run_tests_helper.SetLogLevel(args.verbose) |
486 | 487 |
| 488 devil_chromium.Initialize() |
| 489 |
487 return ProvisionDevices(args) | 490 return ProvisionDevices(args) |
488 | 491 |
489 | 492 |
490 if __name__ == '__main__': | 493 if __name__ == '__main__': |
491 sys.exit(main()) | 494 sys.exit(main()) |
OLD | NEW |