Junos Snapshot Administrator in Python Test Operators Summary
Junos Snapshot Administrator in Python (jsnapy) enables you to capture and audit runtime environment snapshots of your networked devices running Junos OS. The Junos Snapshot Administrator configuration file defines the scope of a snapshot and the evaluation criteria for either a single snapshot or a comparison of two snapshots. The configuration files reference the names of test files that define the details of the tests to be run. Within the test file, you can create test cases that evaluate or compare content from specific Junos OS commands. The test cases use test operators to either evaluate data elements in a single snapshot or compare data elements in two separate snapshots.
Table 1 lists the Junos Snapshot Administrator test operators along with a brief description of each operator. Operators are grouped by operand type.
Operator |
Description |
---|---|
Compare Elements or Element Values in Two Snapshots | |
Compare the change in value of a specified data element, which must be present in both snapshots, to a specified delta. You can specify the delta as an absolute, positive, or negative percentage, or an absolute, positive, or negative fixed value. |
|
Determine if the specified items are present in the first snapshot but are not present in the second snapshot. |
|
Determine if the specified items are present in the second snapshot but are not present in the first snapshot. |
|
Compare specified data elements that are present in both snapshots, and verify that the value is the same. |
|
Operate on Elements with Numeric or String Values | |
Check if all content values for the specified elements are the same. Optionally, you can check if all content values for the specified elements are the same as the content value of a reference item. |
|
Test if an XML element string or integer value matches a given value. |
|
Test if an XML element string or integer value does not match a given value. |
|
Operate on Elements with Numeric Values | |
Test if the XML element value is within a given numeric range. |
|
Test if the XML element value is greater than a given numeric value. |
|
Test if the XML element value is less than a given numeric value. |
|
Test if the XML element value is outside a given numeric range. |
|
Operate on Elements with String Values | |
Determine if an XML element string-value contains the provided string value. |
|
Determine if an XML element string-value is included in a specified list of string values. |
|
Determine if an XML element string value is excluded from a specified list of string values. |
|
Operate on XML Elements | |
Verify the existence of an XML element in the snapshot. |
|
Verify the lack of existence of an XML element in the snapshot. |