Bug 1233506 - Only accept positional arguments to mach try that are directories. r=jgraham draft
authorChris Manchester <cmanchester@mozilla.com>
Thu, 17 Dec 2015 12:38:32 -0800
changeset 316034 ef3640736bb3426e01beff81faa97a8a617de6f6
parent 316006 0711218a018d912036f7d3be2ae2649e213cfb85
child 512123 f62207ea8e567f907f008bf6a8a9539353e76cb9
push id8506
push usercmanchester@mozilla.com
push dateThu, 17 Dec 2015 20:40:10 +0000
reviewersjgraham
bugs1233506
milestone46.0a1
Bug 1233506 - Only accept positional arguments to mach try that are directories. r=jgraham
testing/mach_commands.py
--- a/testing/mach_commands.py
+++ b/testing/mach_commands.py
@@ -528,19 +528,19 @@ class PushToTry(MachCommandBase):
                      if kwargs["talos"] else [])
         except ValueError as e:
             print("Error parsing -t argument:\n%s" % e.message)
             sys.exit(1)
 
         paths = []
         for p in kwargs["paths"]:
             p = os.path.normpath(os.path.abspath(p))
-            if not p.startswith(self.topsrcdir):
-                print('Specified path "%s" is outside of the srcdir, unable to'
-                      ' specify tests outside of the srcdir' % p)
+            if not (os.path.isdir(p) and p.startswith(self.topsrcdir)):
+                print('Specified path "%s" is not a directory under the srcdir,'
+                      ' unable to specify tests outside of the srcdir' % p)
                 sys.exit(1)
             if len(p) <= len(self.topsrcdir):
                 print('Specified path "%s" is at the top of the srcdir and would'
                       ' select all tests.' % p)
                 sys.exit(1)
             paths.append(os.path.relpath(p, self.topsrcdir))
 
         try: