Juniper / jsnapy

Python version of Junos Snapshot Administrator
Apache License 2.0
115 stars 58 forks source link

question: lldp #167

Open jedelman8 opened 7 years ago

jedelman8 commented 7 years ago

I'm finding it very hard to get started. Are there any examples to test for the following:

Any help or improvement with the docs would be greaet.

vnitinv commented 7 years ago

@jedelman8 For your first query, we can do

check_lldp:
- command: show lldp neighbors
- iterate:
     xpath: //lldp-neighbors-information/lldp-neighbor-information
     id: lldp-local-port-id
     tests:
       - list-not-less: lldp-local-port-id
         err: "Test FAILED!! The post snapshot has less LLDP neighbors
than the pre snapshot"
         info: "Test SUCCEEDED!! The pre and post snapshots have the
same number of LLDP neighbors"
       - list-not-more: lldp-local-port-id
         err: "Test FAILED!! The post snapshot has additional LLDP
neighbors than the pre snapshot"
         info: "Test SUCCEEDED!! The pre and post snapshots have the
same number of LLDP neighbors"

For 2nd query, we can do this using module/script where depending on our first result, we can generate next set of test cases at run time using say jinja template and run those.