Bug 735451. raise exception when DeviceManager fails to initialize. r=jmaher

This commit is contained in:
Armen Zambrano Gasparnian 2012-04-11 14:51:18 -04:00
Родитель 558003009a
Коммит 1a81d43ee0
2 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -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:

Просмотреть файл

@ -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)