summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorsievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-11 04:09:56 +0000
committersievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-11 04:09:56 +0000
commit700d230884a442dd2fcc276625f02d02eaf843ff (patch)
treeb8123aa304e6709287d772d2c7feb7c1e122f31a /build
parentae3b67a5f0787dd93daaaa5cbaf30f6de9c97ade (diff)
downloadchromium_src-700d230884a442dd2fcc276625f02d02eaf843ff.zip
chromium_src-700d230884a442dd2fcc276625f02d02eaf843ff.tar.gz
chromium_src-700d230884a442dd2fcc276625f02d02eaf843ff.tar.bz2
Android: Don't restart/reboot on package install failure
In the scripts used by the test runners only restart the shell or reboot the device if there was a timeout. Otherwise print the error and abort. Review URL: https://chromiumcodereview.appspot.com/23432010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/android/pylib/android_commands.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index d8d3be6..4f2bf26 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -407,7 +407,7 @@ class AndroidCommands(object):
retry_count=0)
def ManagedInstall(self, apk_path, keep_data=False, package_name=None,
- reboots_on_failure=2):
+ reboots_on_timeout=2):
"""Installs specified package and reboots device on timeouts.
If package_name is supplied, checks if the package is already installed and
@@ -418,7 +418,7 @@ class AndroidCommands(object):
keep_data: Reinstalls instead of uninstalling first, preserving the
application data.
package_name: Package name (only needed if keep_data=False).
- reboots_on_failure: number of time to reboot if package manager is frozen.
+ reboots_on_timeout: number of time to reboot if package manager is frozen.
"""
# Check if package is already installed and up to date.
if package_name:
@@ -430,7 +430,7 @@ class AndroidCommands(object):
package_name)
return
# Install.
- reboots_left = reboots_on_failure
+ reboots_left = reboots_on_timeout
while True:
try:
if not keep_data:
@@ -439,17 +439,19 @@ class AndroidCommands(object):
install_status = self.Install(apk_path, reinstall=keep_data)
if 'Success' in install_status:
return
+ else:
+ raise Exception('Install failure: %s' % install_status)
except errors.WaitForResponseTimedOutError:
print '@@@STEP_WARNINGS@@@'
logging.info('Timeout on installing %s on device %s', apk_path,
self._device)
- if reboots_left <= 0:
- raise Exception('Install failure')
+ if reboots_left <= 0:
+ raise Exception('Install timed out')
- # Force a hard reboot on last attempt
- self.Reboot(full_reboot=(reboots_left == 1))
- reboots_left -= 1
+ # Force a hard reboot on last attempt
+ self.Reboot(full_reboot=(reboots_left == 1))
+ reboots_left -= 1
def MakeSystemFolderWritable(self):
"""Remounts the /system folder rw."""