Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note: The Compliance engine can validate MCP automation outputs in addition to device configurations. To validate an automation output, select Source → Mass Config Push Result on the Compliance preset screen. The same condition types and matching principles described in this article apply when evaluating automation output.

 

...

Loose mode:

Loose mode verifies that all input lines are present in the source. Their order does not matter, and additional lines may appear between them.

Source contains

The following examples demonstrate how the Loose, Sequential, and Strict match modes affect condition evaluation Loose mode evaluates input lines when using the Source contains condition type.Loose mode

 

Example Input 1:

Code Block
languagetext
 description LAN
hostname R1

Result:  Condition successful

Although the order of the input lines differs from the source, both lines are present.

 

Example Input2:

Code Block
languagetext
hostname R1
 description WAN

...

The line description WAN does not exist in the source.

...


Source matches regex

The Source matches regex condition type treats each input line as a separate regular expression. Loose mode requires each regex to match somewhere in the source, but the matches can occur in any order.

Example Input 3:

Code Block
languagetext
interfacerouter Ethernet1ospf
 ip address 10.0.0.1/24hostname R[0-9]+

Result: Condition successful

Both input lines appear in the source in the correct order. The "description Uplink" line between them is ignoredThis verifies that the device follows the R<number> hostname convention and has OSPF enabled. The two matches are independent, so their order does not matter.

Example Input 4:

Code Block
languagetext
router ipospf
address 10.0.0.1/24
interface Ethernet1hostname R[A-Z]+

Result:  Condition failed

The input lines appear router ospf line matches the source, but hostname R[A-Z]+ regex does not match hostname R1. Because all input lines must match the source, the condition fails.

 

 

Sequential mode

Sequential mode requires all input lines to be present in the source in

...

the same order as entered.

...

Strict mode

Additional lines may appear between them.

Source contains

The following examples demonstrate how Sequential mode evaluates input lines when using the Source contains condition type.

 

Example Input 5:

Code Block
languagetext
interface Ethernet1
 description Uplink
 ip address 10.0.0.1/24

Result:  Condition successful

All three Both input lines appear consecutively in the source in the correct order. The "description Uplink" line between them is ignored.

Example Input 6:

Code Block
languagetext
interface Ethernet1
 ip address 10.0.0.1/24
interface Ethernet1

Result:  Condition failed

The source contains the line "description Uplink" between the two input lines . Strict mode therefore fails.

...

appear in the source in reverse order.

Source matches regex

...

When using Source matches regex condition type. When using this condition type, each input line is treated as a separate regular expression and matched against the source. The selected match mode controls how these regex inputs are matched: whether they can match in any order, must match in the specified order, or must match consecutively.

Loose mode
Example Input 7:

Code Block
languagetext
router ospf
hostname R[0-9]+

Result: Condition successful

This verifies that the device follows the R<number> hostname convention and has OSPF enabled. The two matches are independent, so their order does not matter.

Example Input 8:

Code Block
languagetext
router ospf
hostname R[A-Z]+

Result: Condition failed

The router ospf line matches the source, but hostname R[A-Z]+ regex does not match hostname R1. Because all input lines must match the source, the condition fails.

...

. Sequential mode requires the regexes to match lines in the specified order, but additional lines may appear between the matches.

Example Input 7:

Code Block
languagetext
router ospf
 network [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/([0-9]+) area [0-9]+

...

This verifies that an OSPF network statement appears after the "router ospf" command. Other matching lines may appear between the two lines.

Example Input

...

8:

Code Block
languagetext
network [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/([0-9]+) area [0-9]+
router ospf

Result:  Condition failed

Both lines in the source, but they appear in the opposite order. Sequential mode therefore fails.

 

Strict mode

Strict mode requires input lines to be present in the same order as entered and consecutively in the source. No additional lines may appear between the matching lines.

Source contains

The following examples demonstrate how Strict mode evaluates input lines when using the Source contains condition type.

Example Input 9:

Code Block
languagetext
interface Ethernet1
 description Uplink
 ip address 10.0.0.1/24

Result: Condition successful

All three lines appear consecutively in the source.

Example Input 10:

Code Block
languagetext
interface Ethernet1
 ip address 10.0.0.1/24

Result: Condition failed

The source contains the line "description Uplink" between the two input lines. Strict mode therefore fails.

 

Source matches regex

When using Source matches regex, each input line is treated as a separate regular expression. Strict mode requires the regexes to match consecutive lines in the specified order.

Example Input 11:

Code Block
languagetext
interface Loopback[0-9]+
 description Management Loopback
 ip address 10\.255\.255\.[0-9]+ 255\.255\.255\.255

...

Code Block
languagetext
interface Loopback[0-9]+
ip address 10\.255\.255\.[0-9]+ 255\.255\.255\.255

Result:  Condition failed

Both lines match in the source, but the description Management Loopback line appears between them. Strict mode requires the matching lines to be consecutive, so the condition fails.

 

 

Choosing the right Match mode

...