...
Match mode determines how the order of the input lines or regular expressions affects evaluation of the condition against the selected source.
Mode | Order required | Content allowed between matches |
Loose | No | Yes |
Sequential | Yes | Yes |
Strict | Yes | No |
Example Source:
| Code Block | ||
|---|---|---|
| ||
hostname R1 interface Ethernet1 description Uplink ip address 10.0.0.1/24 interface Ethernet2 description LAN ip address 192.168.1.1/24 router ospf network 10.0.0.0/24 area 0 |
Suppose the Condition input is:
| Code Block | ||
|---|---|---|
| ||
interface Ethernet1 ip address 10.0.0.1/24 |
Match mode | Condition Status | Explanation |
Loose | Successful | Both lines exist in the source. |
Sequential | Successful | The lines appear in the correct order. |
Strict | Failed | The description Uplink line appears between them. |
Loose Mode
Loose mode verifies that all input lines exist somewhere in the source. The order is ignored. Additional content between matching lines is irrelevant.
...
Choosing the Right Match Mode
Use case | Recommended mode |
Verify several independent configuration lines exist | Loose |
Verify the order of configuration commands | Sequential |
Verify an exact configuration block | Strict |