Hi.
Here is a test file that posts an error message if an interface status changes between snapshots.
Test interfaces:
- command: show interfaces terse
- iterate:
xpath: physical-interface
id: name
tests:
- no-diff: oper-status
err: "Test Failed: oper-status of {{id_0}} got changed from <{{pre['oper-status']}}> to <{{post['oper-status']}}>"
info: "Test Passed: oper-status is the same, before it was <{{pre['oper-status']}}>, now it is <{{post['oper-status']}}>"
I know that {{ id_0 }} is a variable containing the name of the interface whose status has changed. But what does the "_0" in the variable name stand for?
Thanks,
Deepak