|
@@ -1,30 +1,64 @@
|
|
|
---
|
|
|
-"Test cat nodes attrs output":
|
|
|
+"Help":
|
|
|
+ - do:
|
|
|
+ cat.nodeattrs:
|
|
|
+ help: true
|
|
|
|
|
|
- - skip:
|
|
|
- version: "all"
|
|
|
- reason: "Waiting for #12558"
|
|
|
+ - match:
|
|
|
+ $body: |
|
|
|
+ /^ node .+ \n
|
|
|
+ id .+ \n
|
|
|
+ pid .+ \n
|
|
|
+ host .+ \n
|
|
|
+ ip .+ \n
|
|
|
+ port .+ \n
|
|
|
+ attr .+ \n
|
|
|
+ value .+ \n
|
|
|
+ $/
|
|
|
|
|
|
+---
|
|
|
+"Test cat nodes attrs output":
|
|
|
- do:
|
|
|
cat.nodeattrs: {}
|
|
|
-
|
|
|
- - match:
|
|
|
+ - match: # All attributes look 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+(\S+)\s+ (\S+)\s* \n)+
|
|
|
+ $/
|
|
|
+ - match: # A specific planted attribute is present and looks good
|
|
|
$body: |
|
|
|
- /((\S+)\s+(\S+)\s+(\d{1,3}\.){3}\d{1,3}\s+(\S+)\s+(\S+)\s*)+/
|
|
|
+ /# 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
|
|
|
+ /
|
|
|
+ # 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
|
|
|
+ # node name.
|
|
|
|
|
|
- do:
|
|
|
cat.nodeattrs:
|
|
|
v: true
|
|
|
-
|
|
|
- - match:
|
|
|
+ - match: # All attributes look good including the heading
|
|
|
$body: |
|
|
|
- /((\S+)\s+(\S+)\s+(\d{1,3}\.){3}\d{1,3}\s+(\S+)\s+(\S+)\s*)+/
|
|
|
+ /^ 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+(\S+)\s+ (\S+)\s* \n)+
|
|
|
+ $/
|
|
|
+ - 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
|
|
|
+ /
|
|
|
|
|
|
- do:
|
|
|
cat.nodeattrs:
|
|
|
h: attr,value
|
|
|
v: true
|
|
|
-
|
|
|
- - match:
|
|
|
+ - match: # All attributes look good
|
|
|
+ $body: |
|
|
|
+ /^ attr\s+ value\s*\n
|
|
|
+ ((\S+)\s+ (\S+)\s*)+
|
|
|
+ $/
|
|
|
+ - match: # A specific planted attribute is present and looks good
|
|
|
$body: |
|
|
|
- /((\S+)\s+(\S+)\s*)+/
|
|
|
+ /# attr\s+ value\s*\n
|
|
|
+ testattr\s+ test\s*\n
|
|
|
+ /
|