Commit 7e885e72 authored by navabi@google.com's avatar navabi@google.com

Refactor wipe option to wipe on default and have option to skip wipe.

Also remove the option -w to only wipe without provisioning. This was temporary
functionality to recover from INSUFFICIENT_STORAGE on device error. With the
default wiping, this should be unnecessary. For bots that skip wiping, we can
still manually fix by manually running without --skip-wipe.

BUG=383106
TBR=craigdh@chromium.org

Review URL: https://codereview.chromium.org/334503002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276866 0039d316-1c4b-4281-b951-d872f2087c98
parent 2269f0f6
...@@ -126,17 +126,23 @@ def ProvisionDevices(options): ...@@ -126,17 +126,23 @@ def ProvisionDevices(options):
devices = [options.device] devices = [options.device]
else: else:
devices = android_commands.GetAttachedDevices() devices = android_commands.GetAttachedDevices()
# Wipe devices (unless --skip-wipe was specified)
if not options.skip_wipe:
for device_serial in devices: for device_serial in devices:
device = device_utils.DeviceUtils(device_serial) device = device_utils.DeviceUtils(device_serial)
device.old_interface.EnableAdbRoot() device.old_interface.EnableAdbRoot()
WipeDeviceData(device) WipeDeviceData(device)
try: try:
device_utils.DeviceUtils.parallel(devices).Reboot(True) device_utils.DeviceUtils.parallel(devices).old_interface.Reboot(True)
except errors.DeviceUnresponsiveError: except errors.DeviceUnresponsiveError:
pass pass
for device_serial in devices: for device_serial in devices:
device = device_utils.DeviceUtils(device_serial)
device.WaitUntilFullyBooted(timeout=90) device.WaitUntilFullyBooted(timeout=90)
# Provision devices
for device_serial in devices:
device = device_utils.DeviceUtils(device_serial)
device.old_interface.EnableAdbRoot() device.old_interface.EnableAdbRoot()
_ConfigureLocalProperties(device) _ConfigureLocalProperties(device)
device_settings.ConfigureContentSettingsDict( device_settings.ConfigureContentSettingsDict(
...@@ -165,8 +171,8 @@ def main(argv): ...@@ -165,8 +171,8 @@ def main(argv):
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
parser = optparse.OptionParser() parser = optparse.OptionParser()
parser.add_option('-w', '--wipe', action='store_true', parser.add_option('--skip-wipe', action='store_true', default=False,
help='Wipe device data from all attached devices.') help="Don't wipe device data during provisioning.")
parser.add_option('-d', '--device', parser.add_option('-d', '--device',
help='The serial number of the device to be provisioned') help='The serial number of the device to be provisioned')
parser.add_option('-t', '--target', default='Debug', help='The build target') parser.add_option('-t', '--target', default='Debug', help='The build target')
...@@ -180,16 +186,6 @@ def main(argv): ...@@ -180,16 +186,6 @@ def main(argv):
print >> sys.stderr, 'Unused args %s' % args print >> sys.stderr, 'Unused args %s' % args
return 1 return 1
if options.wipe:
devices = android_commands.GetAttachedDevices()
for device_serial in devices:
device = device_utils.DeviceUtils(device_serial)
WipeDeviceData(device)
try:
device_utils.DeviceUtils.parallel(devices).Reboot(True)
except errors.DeviceUnresponsiveError:
pass
else:
ProvisionDevices(options) ProvisionDevices(options)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment