Browse Source

[REST tests] prevent backtracking in cat.nodeattrs

Spencer 10 years ago
parent
commit
ff9999876c

+ 4 - 4
rest-api-spec/src/main/resources/rest-api-spec/test/cat.nodeattrs/10_basic.yaml

@@ -27,8 +27,8 @@
                $/
   - match: # A specific planted attribute is present and looks good
       $body: |
-               /#   node\s+         host\s+ ip\s+                   attr\s+     value\s* \n
-                    ((\S+\s?){1,10})\s+ (\S+)\s+(\d{1,3}\.){3}\d{1,3}\s+testattr\s+ test \s* \n
+               /#   node\s+              host\s+  ip\s+                   attr\s+     value\s* \n
+                    (\S+(\s\S+){0,7})\s+ (\S+)\s+ (\d{1,3}\.){3}\d{1,3}\s+testattr\s+ test \s* \n
                /
   # Note for future editors: its quite possible to construct a regex with an
   # intense amount of backtracking if you use something like (\S\s?)+ to match
@@ -44,8 +44,8 @@
                $/
   - match: # A specific planted attribute is present and looks good
       $body: |
-               /#   node\s+        host\s+ ip\s+                   attr\s+     value\s* \n
-                    ((\S+\s?){1,10})\s+ (\S+)\s+(\d{1,3}\.){3}\d{1,3}\s+testattr\s+ test \s* \n
+               /#   node\s+              host\s+  ip\s+                    attr\s+     value\s* \n
+                    (\S+(\s\S+){0,7})\s+ (\S+)\s+ (\d{1,3}\.){3}\d{1,3}\s+ testattr\s+ test \s* \n
                /
 
   - do: