Bug 1245347 - [Autophone|mozdevice] - catch initial ADBRootError during initialization if root is not supported, r=wlach.
authorBob Clary <bclary@bclary.com>
Thu, 17 Nov 2016 09:21:06 -0800
changeset 370446 950e7c87e15174ebc2197d34ad8df33d15cc6a01
parent 370445 5ae4982816f1f5c1147c14bcfd015a6546f840fe
child 370447 129f96353f01f04c84004d976f9cd125b94e0b5a
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswlach
bugs1245347
milestone53.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 1245347 - [Autophone|mozdevice] - catch initial ADBRootError during initialization if root is not supported, r=wlach.
testing/mozbase/mozdevice/mozdevice/adb_android.py
--- a/testing/mozbase/mozdevice/mozdevice/adb_android.py
+++ b/testing/mozbase/mozdevice/mozdevice/adb_android.py
@@ -5,17 +5,17 @@
 import os
 import re
 import time
 
 from abc import ABCMeta
 
 import version_codes
 
-from adb import ADBDevice, ADBError
+from adb import ADBDevice, ADBError, ADBRootError
 
 
 class ADBAndroid(ADBDevice):
     """ADBAndroid implements :class:`ADBDevice` providing Android-specific
     functionality.
 
     ::
 
@@ -85,17 +85,18 @@ class ADBAndroid(ADBDevice):
         # usage:  setenforce [ Enforcing | Permissive | 1 | 0 ]
         # getenforce returns either Enforcing or Permissive
 
         try:
             self.selinux = True
             if self.shell_output('getenforce', timeout=timeout) != 'Permissive':
                 self._logger.info('Setting SELinux Permissive Mode')
                 self.shell_output("setenforce Permissive", timeout=timeout, root=True)
-        except ADBError:
+        except (ADBError, ADBRootError), e:
+            self._logger.warning('Unable to set SELinux Permissive due to %s.', e)
             self.selinux = False
 
         self.version = int(self.shell_output("getprop ro.build.version.sdk",
                                              timeout=timeout))
 
     def reboot(self, timeout=None):
         """Reboots the device.