-
Notifications
You must be signed in to change notification settings - Fork 555
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
Junos get_lldp_neighbor port returns the port-id, not the port-decription #1470
Merged
mirceaulinic
merged 11 commits into
napalm-automation:develop
from
chadell:junos-lldp-neighbors-port-meaning
Oct 13, 2021
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
acd64a3
Junos get_lldp_neighbor port return the port-id, not the port-decription
chadell 66a146e
Fix tests by adding port-id references
chadell bf14534
Keep backwards compatibility with older Junos versions
chadell 16b67d3
Change get-lldp-neighbors-information response to test the port-descr…
chadell 395c75e
Define the tests for old and new junos LLDP
chadell f44bbfc
Refine get_lldp_neighbors logic to pick only the first element of mul…
chadell ada8dbb
Enforce string coding for values from list
chadell 4cdfcb7
Handle empty list case to get first list element
chadell e199e43
Merge branch 'develop' into junos-lldp-neighbors-port-meaning
mirceaulinic da21e5e
Merge branch 'develop' into junos-lldp-neighbors-port-meaning
chadell dc3e680
Merge branch 'develop' into junos-lldp-neighbors-port-meaning
mirceaulinic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/junos/mocked_data/test_get_lldp_neighbors/normal/expected_result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"me0.0": [{"hostname": "lom-bjg61-r1-1", "port": "27"}], "xe-4/3/6": [{"hostname": "peer00.lab.demo", "port": "Ethernet1"}], "xe-0/1/0.0": [{"hostname": "spine00", "port": "xe-0/0/0"}], "ge-0/0/0.0": [{"hostname": "rtr00.demo", "port": "GigabitEthernet0/0/0/0"}]} | ||
{"me0.0": [{"hostname": "lom-bjg61-r1-1", "port": "27"}], "xe-4/3/6": [{"hostname": "peer00.lab.demo", "port": "Ethernet1"}], "xe-0/1/0.0": [{"hostname": "spine00", "port": "xe-0/0/0"}], "ge-0/0/0.0": [{"hostname": "rtr00.demo", "port": "ge-0/0/0"}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/expected_result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"me0.0": [{"hostname": "lom-bjg61-r1-1", "port": "Interface 27"}], "xe-4/3/6": [{"hostname": "peer00.lab.demo", "port": "Ethernet1 interface"}], "xe-0/1/0.0": [{"hostname": "spine00", "port": "xe-0/0/0"}], "ge-0/0/0.0": [{"hostname": "rtr00.demo", "port": "GigabitEthernet0/0/0/0"}]} |
36 changes: 36 additions & 0 deletions
36
...ata/test_get_lldp_neighbors/old_without_remote_port_id/get-lldp-neighbors-information.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<lldp-neighbors-information style="brief"> | ||
<lldp-neighbor-information> | ||
<lldp-local-port-id>xe-4/3/6</lldp-local-port-id> | ||
<lldp-local-parent-interface-name>-</lldp-local-parent-interface-name> | ||
<lldp-remote-chassis-id-subtype>Mac address</lldp-remote-chassis-id-subtype> | ||
<lldp-remote-chassis-id>00:1c:73:8f:0a:ed</lldp-remote-chassis-id> | ||
<lldp-remote-port-id-subtype>Interface name</lldp-remote-port-id-subtype> | ||
<lldp-remote-port-description>Ethernet1 interface</lldp-remote-port-description> | ||
<lldp-remote-system-name>peer00.lab.demo</lldp-remote-system-name> | ||
</lldp-neighbor-information> | ||
<lldp-neighbor-information> | ||
<lldp-local-interface>me0.0</lldp-local-interface> | ||
<lldp-local-parent-interface-name>-</lldp-local-parent-interface-name> | ||
<lldp-remote-chassis-id-subtype>Mac address</lldp-remote-chassis-id-subtype> | ||
<lldp-remote-chassis-id>00:23:47:50:21:40</lldp-remote-chassis-id> | ||
<lldp-remote-port-description>Interface 27</lldp-remote-port-description> | ||
<lldp-remote-system-name>lom-bjg61-r1-1</lldp-remote-system-name> | ||
</lldp-neighbor-information> | ||
<lldp-neighbor-information> | ||
<lldp-local-interface>ge-0/0/0.0</lldp-local-interface> | ||
<lldp-local-parent-interface-name>-</lldp-local-parent-interface-name> | ||
<lldp-remote-chassis-id-subtype>Mac address</lldp-remote-chassis-id-subtype> | ||
<lldp-remote-chassis-id>02:e4:c8:6c:a4:00</lldp-remote-chassis-id> | ||
<lldp-remote-port-description>GigabitEthernet0/0/0/0</lldp-remote-port-description> | ||
<lldp-remote-system-name>rtr00.demo</lldp-remote-system-name> | ||
</lldp-neighbor-information> | ||
<lldp-neighbor-information> | ||
<lldp-local-interface>xe-0/1/0.0</lldp-local-interface> | ||
<lldp-local-parent-interface-name>-</lldp-local-parent-interface-name> | ||
<lldp-remote-chassis-id-subtype>Mac address</lldp-remote-chassis-id-subtype> | ||
<lldp-remote-chassis-id>dc:38:e1:b7:26:16</lldp-remote-chassis-id> | ||
<lldp-remote-port-id>xe-0/0/0</lldp-remote-port-id> | ||
<lldp-remote-port-description>xe-0/0/0</lldp-remote-port-description> | ||
<lldp-remote-system-name>spine00</lldp-remote-system-name> | ||
</lldp-neighbor-information> | ||
</lldp-neighbors-information> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lldp-remote-port-description
needs to stay as that's what older Junos versions provide.