summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorjrg@google.com <jrg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-09 07:04:32 +0000
committerjrg@google.com <jrg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-09 07:04:32 +0000
commitce6f0e8c324fcbb427b095cdfbed622d03e2278c (patch)
tree43fe3e0b620a175a1f216f9f57b0394971f8271f /build
parente5466f6b8e218ef3b4530b0e85d9a5d6d208cf9f (diff)
downloadchromium_src-ce6f0e8c324fcbb427b095cdfbed622d03e2278c.zip
chromium_src-ce6f0e8c324fcbb427b095cdfbed622d03e2278c.tar.gz
chromium_src-ce6f0e8c324fcbb427b095cdfbed622d03e2278c.tar.bz2
Android emulator image cleanup.
BUG=None TEST= Review URL: http://codereview.chromium.org/8889040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113771 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-xbuild/android/emulator.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/build/android/emulator.py b/build/android/emulator.py
index a4b6167..49c3caa 100755
--- a/build/android/emulator.py
+++ b/build/android/emulator.py
@@ -114,6 +114,7 @@ class Emulator(object):
If fails, an exception will be raised.
"""
_KillAllEmulators() # just to be sure
+ self._AggressiveImageCleanup()
(self.device, port) = self._DeviceName()
emulator_command = [
self.emulator,
@@ -135,6 +136,22 @@ class Emulator(object):
self._InstallKillHandler()
self._ConfirmLaunch()
+ def _AggressiveImageCleanup(self):
+ """Aggressive cleanup of emulator images.
+
+ Experimentally it looks like our current emulator use on the bot
+ leaves image files around in /tmp/android-$USER. If a "random"
+ name gets reused, we choke with a 'File exists' error.
+ TODO(jrg): is there a less hacky way to accomplish the same goal?
+ """
+ logging.info('Aggressive Image Cleanup')
+ emulator_imagedir = '/tmp/android-%s' % os.environ['USER']
+ for image in os.listdir(emulator_imagedir):
+ full_name = os.path.join(emulator_imagedir, image)
+ if 'emulator' in full_name:
+ logging.info('Deleting emulator image %s', full_name)
+ os.unlink(full_name)
+
def _ConfirmLaunch(self, wait_for_boot=False):
"""Confirm the emulator launched properly.