Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devices with same address but diff port are ignored #322

Open
Mierdin opened this issue Jun 6, 2018 · 0 comments
Open

Devices with same address but diff port are ignored #322

Mierdin opened this issue Jun 6, 2018 · 0 comments

Comments

@Mierdin
Copy link

Mierdin commented Jun 6, 2018

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
rahkumar651991 added a commit to rahkumar651991/jsnapy that referenced this issue Jan 22, 2020
rahkumar651991 added a commit to rahkumar651991/jsnapy that referenced this issue Jan 23, 2020
rahkumar651991 added a commit to rahkumar651991/jsnapy that referenced this issue Jan 31, 2020
vnitinv pushed a commit that referenced this issue Feb 3, 2020
* port support added for same Ip-address. #322

* port support added for same Ip-address. #322
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants