jsnapy
jsnapy copied to clipboard
Devices with same address but diff port are ignored
Description of Issue/Question
I was doing some demo prep and I noticed that when I was running jsnapy against two vqfx devices in vagrant, the test would only run once.
---
hosts:
- device: 127.0.0.1
username : root
passwd: Juniper
port: 2200
- device: 127.0.0.1
username : root
passwd: Juniper
port: 2204
jsnapy --snapcheck -f jsnapyconfig.yaml -v
jsnapy.cfg file location used : /etc/jsnapy
Configuration file location used : /etc/jsnapy
Connecting to device 127.0.0.1 ................
Tests Included : test_rpc_bgp
Taking snapshot of RPC: get-bgp-neighbor-information
***************************** Device: 127.0.0.1 *****************************
Tests Included: test_rpc_bgp
*************************RPC is get-bgp-neighbor-information*************************
----------------------Performing is-equal Test Operation----------------------
Test succeeded!! peer-address is equal to <9.9.9.2+57960>
PASS | All "peer-as" is equal to "64500" [ 1 matched ]
------------------------------- Final Result!! -------------------------------
test_rpc_bgp : Passed
Total No of tests passed: 1
Total No of tests failed: 0
Overall Tests passed!!!
On a hunch, I thought maybe jsnapy was deduplicating hosts based on IP only (not taking port into account) so I renamed one to "localhost" and it tested both devices:
---
hosts:
- device: 127.0.0.1
username : root
passwd: Juniper
port: 2200
- device: localhost
username : root
passwd: Juniper
port: 2204
jsnapy --snapcheck -f jsnapyconfig.yaml -v
jsnapy.cfg file location used : /etc/jsnapy
Configuration file location used : /etc/jsnapy
Connecting to device 127.0.0.1 ................
Tests Included : test_rpc_bgp
Taking snapshot of RPC: get-bgp-neighbor-information
***************************** Device: 127.0.0.1 *****************************
Tests Included: test_rpc_bgp
*************************RPC is get-bgp-neighbor-information*************************
----------------------Performing is-equal Test Operation----------------------
Test succeeded!! peer-address is equal to <9.9.9.2+57960>
PASS | All "peer-as" is equal to "64500" [ 1 matched ]
------------------------------- Final Result!! -------------------------------
test_rpc_bgp : Passed
Total No of tests passed: 1
Total No of tests failed: 0
Overall Tests passed!!!
Connecting to device localhost ................
Tests Included : test_rpc_bgp
Taking snapshot of RPC: get-bgp-neighbor-information
***************************** Device: localhost *****************************
Tests Included: test_rpc_bgp
*************************RPC is get-bgp-neighbor-information*************************
----------------------Performing is-equal Test Operation----------------------
Test succeeded!! peer-address is equal to <9.9.9.1+179>
PASS | All "peer-as" is equal to "64500" [ 1 matched ]
------------------------------- Final Result!! -------------------------------
test_rpc_bgp : Passed
Total No of tests passed: 1
Total No of tests failed: 0
Overall Tests passed!!!
Admittedly, a pretty niche use case but would be nice if whatever deduplication function is in use here could take port number into account as well.
Setup
See above
Steps to Reproduce Issue
See above
Versions Report
~$ python --version
Python 2.7.15
~$ jsnapy --version
JSNAPy version: 1.3.2