Bug 817235 - Make xpcshell tests work with sutAgent; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Tue, 18 Dec 2012 22:18:03 -0700
changeset 125609 f9e5c189ae6b
parent 125608 f6d35a8b7dad
child 125610 ffe29f6052f2
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs817235
milestone20.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 817235 - Make xpcshell tests work with sutAgent; r=jmaher
testing/xpcshell/remotexpcshelltests.py
--- a/testing/xpcshell/remotexpcshelltests.py
+++ b/testing/xpcshell/remotexpcshelltests.py
@@ -20,22 +20,26 @@ class XPCShellRemote(xpcshell.XPCShellTe
     def __init__(self, devmgr, options, args):
         xpcshell.XPCShellTests.__init__(self)
         self.localLib = options.localLib
         self.localBin = options.localBin
         self.options = options
         self.device = devmgr
         self.pathMapping = []
         self.remoteTestRoot = self.device.getTestRoot("xpcshell")
-        # Terse directory names are used here ("b" for a binaries directory)
+        # remoteBinDir contains xpcshell and its wrapper script, both of which must
+        # be executable. Since +x permissions cannot usually be set on /mnt/sdcard,
+        # and the test root may be on /mnt/sdcard, remoteBinDir is set to be on 
+        # /data/local, always.
+        self.remoteBinDir = "/data/local/xpcb"
+        # Terse directory names are used here ("c" for the components directory)
         # to minimize the length of the command line used to execute
         # xpcshell on the remote device. adb has a limit to the number
         # of characters used in a shell command, and the xpcshell command
         # line can be quite complex.
-        self.remoteBinDir = self.remoteJoin(self.remoteTestRoot, "b")
         self.remoteTmpDir = self.remoteJoin(self.remoteTestRoot, "tmp")
         self.remoteScriptsDir = self.remoteTestRoot
         self.remoteComponentsDir = self.remoteJoin(self.remoteTestRoot, "c")
         self.remoteModulesDir = self.remoteJoin(self.remoteTestRoot, "m")
         self.profileDir = self.remoteJoin(self.remoteTestRoot, "p")
         self.remoteDebugger = options.debugger
         self.remoteDebuggerArgs = options.debuggerArgs
         self.testingModulesDir = options.testingModulesDir
@@ -78,16 +82,20 @@ class XPCShellRemote(xpcshell.XPCShellTe
 
     def remoteForLocal(self, local):
         for mapping in self.pathMapping:
           if (os.path.abspath(mapping.local) == os.path.abspath(local)):
             return mapping.remote
         return local
 
     def setupUtilities(self):
+        if (not self.device.dirExists(self.remoteBinDir)):
+          # device.mkDir may fail here where shellCheckOutput may succeed -- see bug 817235
+          self.device.shellCheckOutput(["mkdir", self.remoteBinDir]);
+
         remotePrefDir = self.remoteJoin(self.remoteBinDir, "defaults/pref")
         if (self.device.dirExists(self.remoteTmpDir)):
           self.device.removeDir(self.remoteTmpDir)
         self.device.mkDir(self.remoteTmpDir)
         if (not self.device.dirExists(remotePrefDir)):
           self.device.mkDirs(self.remoteJoin(remotePrefDir, "extra"))
         if (not self.device.dirExists(self.remoteScriptsDir)):
           self.device.mkDir(self.remoteScriptsDir)