diff --git a/testing/xpcshell/remotexpcshelltests.py b/testing/xpcshell/remotexpcshelltests.py index 1d7172de3ad..e7090392883 100644 --- a/testing/xpcshell/remotexpcshelltests.py +++ b/testing/xpcshell/remotexpcshelltests.py @@ -294,7 +294,12 @@ class XPCShellRemote(xpcshell.XPCShellTests, object): 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]); + try: + self.device.shellCheckOutput(["mkdir", self.remoteBinDir]); + except devicemanager.DMError: + # Might get a permission error; try again as root, if available + self.device.shellCheckOutput(["mkdir", self.remoteBinDir], root=True); + self.device.shellCheckOutput(["chmod", "777", self.remoteBinDir], root=True); remotePrefDir = remoteJoin(self.remoteBinDir, "defaults/pref") if (self.device.dirExists(self.remoteTmpDir)):