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>] |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 device.old_interface.EnableAdbRoot() | 139 device.old_interface.EnableAdbRoot() |
140 _ConfigureLocalProperties(device) | 140 _ConfigureLocalProperties(device) |
141 device_settings.ConfigureContentSettingsDict( | 141 device_settings.ConfigureContentSettingsDict( |
142 device, device_settings.DETERMINISTIC_DEVICE_SETTINGS) | 142 device, device_settings.DETERMINISTIC_DEVICE_SETTINGS) |
143 # TODO(tonyg): We eventually want network on. However, currently radios | 143 # TODO(tonyg): We eventually want network on. However, currently radios |
144 # can cause perfbots to drain faster than they charge. | 144 # can cause perfbots to drain faster than they charge. |
145 if 'perf' in os.environ.get('BUILDBOT_BUILDERNAME', '').lower(): | 145 if 'perf' in os.environ.get('BUILDBOT_BUILDERNAME', '').lower(): |
146 device_settings.ConfigureContentSettingsDict( | 146 device_settings.ConfigureContentSettingsDict( |
147 device, device_settings.NETWORK_DISABLED_SETTINGS) | 147 device, device_settings.NETWORK_DISABLED_SETTINGS) |
148 device.old_interface.RunShellCommandWithSU('date -u %f' % time.time()) | 148 device.old_interface.RunShellCommandWithSU('date -u %f' % time.time()) |
149 try: | |
jbudorick
2014/06/09 20:57:15
Can you add a TODO for me to parallelize this afte
navabi
2014/06/09 22:56:18
Done.
| |
150 (device_utils.DeviceUtils.parallel(devices) | |
151 .old_interface.Reboot(True)) | |
tonyg
2014/06/09 20:56:29
Nit: I think this and the above copy can fit on a
navabi
2014/06/09 22:56:18
Done.
| |
152 except errors.DeviceUnresponsiveError: | |
153 pass | |
154 for device_serial in devices: | |
155 device = device_utils.DeviceUtils(device_serial) | |
156 device.WaitUntilFullyBooted(timeout=90) | |
149 (_, props) = device.old_interface.GetShellCommandStatusAndOutput('getprop') | 157 (_, props) = device.old_interface.GetShellCommandStatusAndOutput('getprop') |
150 for prop in props: | 158 for prop in props: |
151 print prop | 159 print prop |
152 if options.auto_reconnect: | 160 if options.auto_reconnect: |
153 PushAndLaunchAdbReboot(devices, options.target) | 161 PushAndLaunchAdbReboot(devices, options.target) |
154 | 162 |
155 | 163 |
156 def main(argv): | 164 def main(argv): |
157 logging.basicConfig(level=logging.INFO) | 165 logging.basicConfig(level=logging.INFO) |
158 | 166 |
(...skipping 22 matching lines...) Expand all Loading... | |
181 (device_utils.DeviceUtils.parallel(devices) | 189 (device_utils.DeviceUtils.parallel(devices) |
182 .old_interface.Reboot(True).pFinish(None)) | 190 .old_interface.Reboot(True).pFinish(None)) |
183 except errors.DeviceUnresponsiveError: | 191 except errors.DeviceUnresponsiveError: |
184 pass | 192 pass |
185 else: | 193 else: |
186 ProvisionDevices(options) | 194 ProvisionDevices(options) |
187 | 195 |
188 | 196 |
189 if __name__ == '__main__': | 197 if __name__ == '__main__': |
190 sys.exit(main(sys.argv)) | 198 sys.exit(main(sys.argv)) |
OLD | NEW |