Bug 1495596 - change how ADBAndroid checks for presence of 'ls' command r=bc,gbrown
authorEdwin Gao <egao@mozilla.com>
Fri, 05 Oct 2018 16:00:32 +0000
changeset 496035 476c7c57b03c953a7c109c829172c22e6d1411cf
parent 496034 f3480613106993d658f9b5a46f41e59ca9934a5e
child 496036 f618f65de81b2bfab5fa4256c1b08ad793fa5e48
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbc, gbrown
bugs1495596
milestone64.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 1495596 - change how ADBAndroid checks for presence of 'ls' command r=bc,gbrown Changes: - changed the directory checked by the `/system/bin/ls` or `/system/xbin/ls` to be `/system`. - factor out the directory to a single variable. Checks: - mozregression continues to function, checked with emulator - try runs for all platforms look acceptable Thoughts: - error message slightly altered to address comment 10 on bugzilla, however this may not be enough. Differential Revision: https://phabricator.services.mozilla.com/D7737
testing/mozbase/mozdevice/mozdevice/adb.py
--- a/testing/mozbase/mozdevice/mozdevice/adb.py
+++ b/testing/mozbase/mozdevice/mozdevice/adb.py
@@ -640,24 +640,26 @@ class ADBDevice(ADBCommand):
         except ADBError:
             self._logger.debug("Check for su 0 failed")
 
         self._mkdir_p = None
         # Force the use of /system/bin/ls or /system/xbin/ls in case
         # there is /sbin/ls which embeds ansi escape codes to colorize
         # the output.  Detect if we are using busybox ls. We want each
         # entry on a single line and we don't want . or ..
-        if self.shell_bool("/system/bin/ls /data/local/tmp", timeout=timeout):
+        system_dir = "/system"
+
+        if self.shell_bool("/system/bin/ls {}".format(system_dir), timeout=timeout):
             self._ls = "/system/bin/ls"
-        elif self.shell_bool("/system/xbin/ls /data/local/tmp", timeout=timeout):
+        elif self.shell_bool("/system/xbin/ls {}".format(system_dir), timeout=timeout):
             self._ls = "/system/xbin/ls"
         else:
-            raise ADBError("ADBDevice.__init__: ls not found")
+            raise ADBError("ADBDevice.__init__: ls could not be found")
         try:
-            self.shell_output("%s -1A /data/local/tmp" % self._ls, timeout=timeout)
+            self.shell_output("%s -1A {}".format(system_dir) % self._ls, timeout=timeout)
             self._ls += " -1A"
         except ADBError:
             self._ls += " -a"
 
         self._logger.info("%s supported" % self._ls)
 
         # Do we have cp?
         self._have_cp = self.shell_bool("type cp", timeout=timeout)