Bug 909323 - Improve jit-tests ADB support. r=terrence
authorDouglas Crosher <dtc-moz@scieneer.com>
Mon, 26 Aug 2013 23:32:32 +1000
changeset 158334 eb191de7ce4121f78043952c3f1391da23f9bd7a
parent 158333 77c3b54f9a909381d13f360390b6b27e26874d6e
child 158335 319da3c6c4a388b7b8d6f05680952672c96194c5
push id407
push userlsblakk@mozilla.com
push dateTue, 03 Dec 2013 03:32:50 +0000
treeherdermozilla-release@babf8c9ebc52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 909323 - Improve jit-tests ADB support. r=terrence
--- a/js/src/jit-test/jit_test.py
+++ b/js/src/jit-test/jit_test.py
@@ -77,16 +77,19 @@ def main(argv):
     op.add_option('--remote', action='store_true',
                   help='Run tests on a remote device')
     op.add_option('--deviceIP', action='store',
                   type='string', dest='device_ip',
                   help='IP address of remote device to test')
     op.add_option('--devicePort', action='store',
                   type=int, dest='device_port', default=20701,
                   help='port of remote device to test')
+    op.add_option('--deviceSerial', action='store',
+                  type='string', dest='device_serial', default=None,
+                  help='ADB device serial number of remote device to test')
     op.add_option('--deviceTransport', action='store',
                   type='string', dest='device_transport', default='sut',
                   help='The transport to use to communicate with device: [adb|sut]; default=sut')
     op.add_option('--remoteTestRoot', dest='remote_test_root', action='store',
                   type='string', default='/data/local/tests',
                   help='The remote directory to use as test root (eg. /data/local/tests)')
     op.add_option('--localLib', dest='local_lib', action='store',
--- a/js/src/tests/lib/jittests.py
+++ b/js/src/tests/lib/jittests.py
@@ -601,36 +601,36 @@ def push_progs(options, device, progs):
         device.pushFile(local_file, remote_file)
 def run_tests_remote(tests, prefix, options):
     # Setup device with everything needed to run our tests.
     from mozdevice import devicemanager, devicemanagerADB, devicemanagerSUT
     if options.device_transport == 'adb':
         if options.device_ip:
-            dm = devicemanagerADB.DeviceManagerADB(options.device_ip, options.devicePort, packageName=None, deviceRoot=options.remoteTestRoot)
+            dm = devicemanagerADB.DeviceManagerADB(options.device_ip, options.device_port, deviceSerial=options.device_serial, packageName=None, deviceRoot=options.remote_test_root)
-            dm = devicemanagerADB.DeviceManagerADB(packageName=None, deviceRoot=options.remote_test_root)
+            dm = devicemanagerADB.DeviceManagerADB(deviceSerial=options.device_serial, packageName=None, deviceRoot=options.remote_test_root)
         dm = devicemanagerSUT.DeviceManagerSUT(options.device_ip, options.device_port, deviceRoot=options.remote_test_root)
         if options.device_ip == None:
             print('Error: you must provide a device IP to connect to via the --device option')
     # Update the test root to point to our test directory.
     options.remote_test_root = posixpath.join(options.remote_test_root, 'jit-tests')
     # Push js shell and libraries.
     if dm.dirExists(options.remote_test_root):
     push_libs(options, dm)
     push_progs(options, dm, [prefix[0]])
-    dm.pushDir(os.path.dirname(TEST_DIR), options.remote_test_root)
+    dm.pushDir(os.path.dirname(TEST_DIR), options.remote_test_root, timeout=600)
     prefix[0] = os.path.join(options.remote_test_root, 'js')
     # Run all tests.
     gen = get_remote_results(tests, dm, prefix, options)
     ok = process_test_results(gen, len(tests), options)
     return ok
 def parse_jitflags(options):
--- a/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
+++ b/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
@@ -213,17 +213,17 @@ class DeviceManagerADB(DeviceManager):
             self._checkCmd(["push", os.path.realpath(localname), destname],
     def mkDir(self, name):
         result = self._runCmdAs(["shell", "mkdir", name]).stdout.read()
         if 'read-only file system' in result.lower():
             raise DMError("Error creating directory: read only file system")
-    def pushDir(self, localDir, remoteDir, retryLimit=None):
+    def pushDir(self, localDir, remoteDir, retryLimit=None, timeout=None):
         # adb "push" accepts a directory as an argument, but if the directory
         # contains symbolic links, the links are pushed, rather than the linked
         # files; we either zip/unzip or re-copy the directory into a temporary
         # one to get around this limitation
         retryLimit = retryLimit or self.retryLimit
         if not self.dirExists(remoteDir):
         if self._useZip:
@@ -243,17 +243,17 @@ class DeviceManagerADB(DeviceManager):
                 self._logger.info("zip/unzip failure: falling back to normal push")
                 self._useZip = False
                 self.pushDir(localDir, remoteDir, retryLimit=retryLimit)
             tmpDir = tempfile.mkdtemp()
             # copytree's target dir must not already exist, so create a subdir
             tmpDirTarget = os.path.join(tmpDir, "tmp")
             shutil.copytree(localDir, tmpDirTarget)
-            self._checkCmd(["push", tmpDirTarget, remoteDir], retryLimit=retryLimit)
+            self._checkCmd(["push", tmpDirTarget, remoteDir], retryLimit=retryLimit, timeout=timeout)
     def dirExists(self, remotePath):
         p = self._runCmd(["shell", "ls", "-a", remotePath + '/'])
         data = p.stdout.readlines()
         if len(data) == 1:
             res = data[0]