Bug 1526084 - In Mn test_capabilities.py, allow for multiple links to sdcard; r=whimboo
authorGeoff Brown <gbrown@mozilla.com>
Tue, 12 Feb 2019 09:24:16 -0700
changeset 458712 cb96244f54b1
parent 458711 a90e2dd8b1a5
child 458713 78b4a9446213
push id35546
push userrmaries@mozilla.com
push dateWed, 13 Feb 2019 04:27:59 +0000
treeherdermozilla-central@636d2c00234d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1526084
milestone67.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 1526084 - In Mn test_capabilities.py, allow for multiple links to sdcard; r=whimboo
testing/marionette/harness/marionette_harness/tests/unit/test_capabilities.py
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_capabilities.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_capabilities.py
@@ -42,20 +42,24 @@ class TestCapabilities(MarionetteTestCas
             # universally available (missing from sdk 18).
             # Attempt to resolve the most common symlink cases by using
             # ls -l to determine if the root of the path (like /sdcard)
             # is a symlink.
             import posixpath
             import re
             device = self.marionette.instance.runner.device.app_ctx.device
             root = posixpath.sep.join(profile.split(posixpath.sep)[0:2])
-            ls_out = device.shell_output("ls -l %s" % root)
-            match = re.match(r'.*->\s(.*)', ls_out)
-            if match:
-                new_root = match.group(1)
+            new_root = root
+            match = True
+            while match:
+                ls_out = device.shell_output("ls -l %s" % new_root)
+                match = re.match(r'.*->\s(.*)', ls_out)
+                if match:
+                    new_root = match.group(1)
+            if new_root != root:
                 profile = profile.replace(root, new_root)
         return profile
 
     def test_mandated_capabilities(self):
         self.assertIn("browserName", self.caps)
         self.assertIn("browserVersion", self.caps)
         self.assertIn("platformName", self.caps)
         self.assertIn("platformVersion", self.caps)