exists operator
Syntax
exists xpath-expression { info string; err "string"; [err "string";] }
Description
Junos Snapshot Administrator test operator that verifies the existence of an XML element in the snapshot.
Parameters
err string | Statement generated when the test case returns false. |
info string | Description of the test case. |
xpath-expression | XPath expression selecting the elements to test. |
Usage Examples
The following test case checks for active chassis alarms.
If the no-active-alarm
element exists,
there are no active chassis alarms. Otherwise, the code reports an
error indicating that there are active alarms.
alarm-checks { command show chassis alarms; item alarm-summary { exists no-active-alarm { info No chassis alarms; err "There are %s chassis alarms", active-alarm-count; } } }
Release Information
Operator introduced in Junos Snapshot Administrator Release 1.0.