Bug 1283584 - Disable android emulator authentication; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Mon, 04 Jul 2016 08:06:55 -0600
changeset 303504 98317a8a0ba441596e4a1064c7bbbdb95c0e42ac
parent 303503 7f6ff2e767e36e7b0f6edf15a44cfb948faa0eea
child 303505 ebd38bf78b58dd2e2af45a2265d958721a3ae345
push id79108
push usergbrown@mozilla.com
push dateMon, 04 Jul 2016 14:06:59 +0000
treeherdermozilla-inbound@98317a8a0ba4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1283584
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1283584 - Disable android emulator authentication; r=jmaher
testing/mozbase/mozrunner/mozrunner/devices/android_device.py
--- a/testing/mozbase/mozrunner/mozrunner/devices/android_device.py
+++ b/testing/mozbase/mozrunner/mozrunner/devices/android_device.py
@@ -17,16 +17,18 @@ import urlparse
 import urllib2
 from distutils.spawn import find_executable
 
 from mozdevice import DeviceManagerADB, DMError
 from mozprocess import ProcessHandler
 
 EMULATOR_HOME_DIR = os.path.join(os.path.expanduser('~'), '.mozbuild', 'android-device')
 
+EMULATOR_AUTH_FILE = os.path.join(os.path.expanduser('~'), '.emulator_console_auth_token')
+
 TOOLTOOL_URL = 'https://raw.githubusercontent.com/mozilla/build-tooltool/master/tooltool.py'
 
 TRY_URL = 'https://hg.mozilla.org/try/raw-file/default'
 
 MANIFEST_PATH = 'testing/config/tooltool-manifests'
 
 verbose_logging = False
 
@@ -365,16 +367,23 @@ class AndroidEmulator(object):
             _download_file(url, 'releng.manifest', EMULATOR_HOME_DIR)
             _tooltool_fetch()
             self._update_avd_paths()
 
     def start(self):
         """
            Launch the emulator.
         """
+        if os.path.exists(EMULATOR_AUTH_FILE):
+            os.remove(EMULATOR_AUTH_FILE)
+            _log_debug("deleted %s" % EMULATOR_AUTH_FILE)
+        # create an empty auth file to disable emulator authentication
+        auth_file = open(EMULATOR_AUTH_FILE, 'w')
+        auth_file.close()
+
         def outputHandler(line):
             self.emulator_log.write("<%s>\n" % line)
         env = os.environ
         env['ANDROID_AVD_HOME'] = os.path.join(EMULATOR_HOME_DIR, "avd")
         command = [self.emulator_path, "-avd",
                    self.avd_info.name, "-port", "5554"]
         if self.avd_info.extra_args:
             # -enable-kvm option is not valid on OSX