all-same operator
Syntax
all-same xpath-expression, [ [reference-item] ] { info string; err "string"; [err "string";] }
Description
Junos Snapshot Administrator test operator that checks if all content values for the specified elements are the same. If you include the optional reference item, the operator checks if all content values for the specified elements are the same as the content value of the reference item.
Parameters
err string | Statement generated when the test case returns false. |
info string | Description of the test case. |
reference-item | (Optional) XPath expression specifying the reference element against which value all other element values are compared. |
xpath-expression | XPath expression selecting the elements to evaluate. |
Usage Examples
The following example code checks that all OSPF neighbors have the same priority value. If any priority values are different, the code generates the error message.
ospf-check { command show ospf neighbor; iterate ospf-neighbor { all-same neighbor-priority { info OSPF neighbors must have the same priority value; err "OSPF interface %s has mismatch priority %s", interface-name, neighbor-priority; } } }
The following example code checks that all OSPF neighbors have the same priority value as that of interface ae19.0. If any priority values are different from that of the reference interface, the code generates the error message.
ospf-check { command show ospf neighbor; iterate ospf-neighbor { all-same neighbor-priority, [interface-name = 'ae19.0'] { info OSPF neighbors must have the same priority value as ae19; err "OSPF interface %s has mismatch priority %s", interface-name, neighbor-priority; } } }
Release Information
Operator introduced in Junos Snapshot Administrator Release 1.0.