Bug 1066077 - [mozdevice] Raise an exception when there is no device attached. r=wlachance
authorDave Hunt <dhunt@mozilla.com>
Thu, 20 Nov 2014 04:08:00 +0100
changeset 217056 528869f666ffb47d53ae59f8fd6936e9a59362e0
parent 217055 0e1bd8c6328460f0b459a7d36c09dac5337cbf5d
child 217057 6ace2f2d908534f5f974d7c2d60f320de32a8f75
push id52218
push usercbook@mozilla.com
push dateMon, 24 Nov 2014 08:44:31 +0000
treeherdermozilla-inbound@3aca2904c54a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswlachance
bugs1066077
milestone36.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 1066077 - [mozdevice] Raise an exception when there is no device attached. r=wlachance
testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
--- a/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
+++ b/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
@@ -632,17 +632,17 @@ class DeviceManagerADB(DeviceManager):
                     if self._deviceSerial == m.group(1):
                         deviceStatus = m.group(2)
             if deviceStatus == None:
                 raise DMError("device not found: %s" % self._deviceSerial)
             elif deviceStatus != "device":
                 raise DMError("bad status for device %s: %s" % (self._deviceSerial, deviceStatus))
 
         # Check to see if we can connect to device and run a simple command
-        if self._checkCmd(["shell", "echo"]) is None:
+        if not self._checkCmd(["shell", "echo"]) == 0:
             raise DMError("unable to connect to device")
 
     def _checkForRoot(self):
         # Check whether we _are_ root by default (some development boards work
         # this way, this is also the result of some relatively rare rooting
         # techniques)
         proc = self._runCmd(["shell", "id"])
         if proc.output and 'uid=0(root)' in proc.output[0]: