From 1a81d43ee09f7b047690da5c7333c66c9195b8b2 Mon Sep 17 00:00:00 2001 From: Armen Zambrano Gasparnian Date: Wed, 11 Apr 2012 14:51:18 -0400 Subject: [PATCH] Bug 735451. raise exception when DeviceManager fails to initialize. r=jmaher --- build/mobile/devicemanagerSUT.py | 3 ++- layout/tools/reftest/remotereftest.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build/mobile/devicemanagerSUT.py b/build/mobile/devicemanagerSUT.py index 8bcb08b29ee..2ef293ce71a 100644 --- a/build/mobile/devicemanagerSUT.py +++ b/build/mobile/devicemanagerSUT.py @@ -85,7 +85,8 @@ class DeviceManagerSUT(DeviceManager): self.retrylimit = retrylimit self.retries = 0 self._sock = None - self.getDeviceRoot() + if self.getDeviceRoot() == None: + raise BaseException("Failed to connect to SUT Agent and retrieve the device root.") def _cmdNeedsResponse(self, cmd): """ Not all commands need a response from the agent: diff --git a/layout/tools/reftest/remotereftest.py b/layout/tools/reftest/remotereftest.py index 1bc91a817b2..fd73f023b65 100644 --- a/layout/tools/reftest/remotereftest.py +++ b/layout/tools/reftest/remotereftest.py @@ -370,7 +370,11 @@ user_pref("capability.principal.codebase.p2.id", "http://%s:%s"); def cleanup(self, profileDir): # Pull results back from device if (self.remoteLogFile): - self._devicemanager.getFile(self.remoteLogFile, self.localLogName) + try: + self._devicemanager.getFile(self.remoteLogFile, self.localLogName) + except: + print "ERROR: We were not able to retrieve the info from %s" % self.remoteLogFile + sys.exit(5) self._devicemanager.removeDir(self.remoteProfile) self._devicemanager.removeDir(self.remoteTestRoot) RefTest.cleanup(self, profileDir)