-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 3 line output for nxos ShowBgpVrfAllAllSummary
On NXOS if the IPv6 address is too long it will cause the other values to wrap to a new line. If the AS on the second line is too long (in the case of a 4-byte ASN) it will wrap to a third line. Like below: Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down... 2001:db8:c006:ff:251::1 4 406942 0 0 0 0 0 05:49:52 Idle Currently the parser will error out on 3-line cases, and this change adds a fix to parse them correctly. The fix adds a p8_2_1 regex that matches the 2nd line. In 3-line case, p8_1 will match the neighbor, the newly added p8_2_1 will match the version and AS, and the existing p8_4 will match the remaining values.
- Loading branch information
Matt Childers
committed
Dec 9, 2023
1 parent
1e2e381
commit 8ba274d
Showing
4 changed files
with
287 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
changelog/undistributed/changelog_show_bgp_nxos_20231209133946.rst
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,6 @@ | ||
-------------------------------------------------------------------------------- | ||
Fix | ||
-------------------------------------------------------------------------------- | ||
* NXOS | ||
* Modified ShowBgpVrfAllAllSummary: | ||
* Added support for parsing 3 lines when v6 neighbor and AS wrap to 3 lines |
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
237 changes: 237 additions & 0 deletions
237
...enie/libs/parser/nxos/tests/ShowBgpVrfAllAllSummary/cli/equal/golden_output_6_expected.py
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,237 @@ | ||
expected_output = { | ||
"vrf": { | ||
"default": { | ||
"neighbor": { | ||
"2001:db8:c006:0:3e57:31ff:feb8:5dc4": { | ||
"address_family": { | ||
"ipv6 unicast": { | ||
"neighbor_table_version": 4, | ||
"as": 65011, | ||
"msg_rcvd": 0, | ||
"msg_sent": 0, | ||
"tbl_ver": 0, | ||
"inq": 0, | ||
"outq": 0, | ||
"up_down": "05:49:52", | ||
"state_pfxrcd": "shut (admin)", | ||
"state": "shut (admin)", | ||
"route_identifier": "172.22.251.3", | ||
"local_as": 65101, | ||
"bgp_table_version": 47, | ||
"config_peers": 6, | ||
"capable_peers": 1, | ||
"attribute_entries": "[4/688]", | ||
"as_path_entries": "[0/0]", | ||
"community_entries": "[0/0]", | ||
"clusterlist_entries": "[0/0]", | ||
"soft_reconfig_recvd_paths": 9, | ||
"soft_reconfig_identical_paths": 9, | ||
"soft_reconfig_combo_paths": 0, | ||
"soft_reconfig_filtered_recvd": 0, | ||
"soft_reconfig_bytes": 0, | ||
"prefixes": { | ||
"total_entries": 9, | ||
"memory_usage": 3744 | ||
}, | ||
"path": { | ||
"total_entries": 21, | ||
"memory_usage": 3744 | ||
} | ||
} | ||
} | ||
}, | ||
"2001:db8:c006:ee::25": { | ||
"address_family": { | ||
"ipv6 unicast": { | ||
"neighbor_table_version": 4, | ||
"as": 65120, | ||
"msg_rcvd": 0, | ||
"msg_sent": 0, | ||
"tbl_ver": 0, | ||
"inq": 0, | ||
"outq": 0, | ||
"up_down": "05:49:52", | ||
"state_pfxrcd": "idle", | ||
"state": "idle", | ||
"route_identifier": "172.22.251.3", | ||
"local_as": 65101, | ||
"bgp_table_version": 47, | ||
"config_peers": 6, | ||
"capable_peers": 1, | ||
"attribute_entries": "[4/688]", | ||
"as_path_entries": "[0/0]", | ||
"community_entries": "[0/0]", | ||
"clusterlist_entries": "[0/0]", | ||
"soft_reconfig_recvd_paths": 9, | ||
"soft_reconfig_identical_paths": 9, | ||
"soft_reconfig_combo_paths": 0, | ||
"soft_reconfig_filtered_recvd": 0, | ||
"soft_reconfig_bytes": 0, | ||
"prefixes": { | ||
"total_entries": 9, | ||
"memory_usage": 3744 | ||
}, | ||
"path": { | ||
"total_entries": 21, | ||
"memory_usage": 3744 | ||
} | ||
} | ||
} | ||
}, | ||
"2001:db8:c006:ff:1::8": { | ||
"address_family": { | ||
"ipv6 unicast": { | ||
"neighbor_table_version": 4, | ||
"as": 65152, | ||
"msg_rcvd": 0, | ||
"msg_sent": 0, | ||
"tbl_ver": 0, | ||
"inq": 0, | ||
"outq": 0, | ||
"up_down": "05:49:52", | ||
"state_pfxrcd": "idle", | ||
"state": "idle", | ||
"route_identifier": "172.22.251.3", | ||
"local_as": 65101, | ||
"bgp_table_version": 47, | ||
"config_peers": 6, | ||
"capable_peers": 1, | ||
"attribute_entries": "[4/688]", | ||
"as_path_entries": "[0/0]", | ||
"community_entries": "[0/0]", | ||
"clusterlist_entries": "[0/0]", | ||
"soft_reconfig_recvd_paths": 9, | ||
"soft_reconfig_identical_paths": 9, | ||
"soft_reconfig_combo_paths": 0, | ||
"soft_reconfig_filtered_recvd": 0, | ||
"soft_reconfig_bytes": 0, | ||
"prefixes": { | ||
"total_entries": 9, | ||
"memory_usage": 3744 | ||
}, | ||
"path": { | ||
"total_entries": 21, | ||
"memory_usage": 3744 | ||
} | ||
} | ||
} | ||
}, | ||
"2001:db8:c006:ff:1::9": { | ||
"address_family": { | ||
"ipv6 unicast": { | ||
"neighbor_table_version": 4, | ||
"as": 65152, | ||
"msg_rcvd": 0, | ||
"msg_sent": 0, | ||
"tbl_ver": 0, | ||
"inq": 0, | ||
"outq": 0, | ||
"up_down": "05:49:52", | ||
"state_pfxrcd": "idle", | ||
"state": "idle", | ||
"route_identifier": "172.22.251.3", | ||
"local_as": 65101, | ||
"bgp_table_version": 47, | ||
"config_peers": 6, | ||
"capable_peers": 1, | ||
"attribute_entries": "[4/688]", | ||
"as_path_entries": "[0/0]", | ||
"community_entries": "[0/0]", | ||
"clusterlist_entries": "[0/0]", | ||
"soft_reconfig_recvd_paths": 9, | ||
"soft_reconfig_identical_paths": 9, | ||
"soft_reconfig_combo_paths": 0, | ||
"soft_reconfig_filtered_recvd": 0, | ||
"soft_reconfig_bytes": 0, | ||
"prefixes": { | ||
"total_entries": 9, | ||
"memory_usage": 3744 | ||
}, | ||
"path": { | ||
"total_entries": 21, | ||
"memory_usage": 3744 | ||
} | ||
} | ||
} | ||
}, | ||
"2001:db8:c006:ff:251::1": { | ||
"address_family": { | ||
"ipv6 unicast": { | ||
"neighbor_table_version": 4, | ||
"as": 406942, | ||
"msg_rcvd": 0, | ||
"msg_sent": 0, | ||
"tbl_ver": 0, | ||
"inq": 0, | ||
"outq": 0, | ||
"up_down": "05:49:52", | ||
"state_pfxrcd": "idle", | ||
"state": "idle", | ||
"route_identifier": "172.22.251.3", | ||
"local_as": 65101, | ||
"bgp_table_version": 47, | ||
"config_peers": 6, | ||
"capable_peers": 1, | ||
"attribute_entries": "[4/688]", | ||
"as_path_entries": "[0/0]", | ||
"community_entries": "[0/0]", | ||
"clusterlist_entries": "[0/0]", | ||
"soft_reconfig_recvd_paths": 9, | ||
"soft_reconfig_identical_paths": 9, | ||
"soft_reconfig_combo_paths": 0, | ||
"soft_reconfig_filtered_recvd": 0, | ||
"soft_reconfig_bytes": 0, | ||
"prefixes": { | ||
"total_entries": 9, | ||
"memory_usage": 3744 | ||
}, | ||
"path": { | ||
"total_entries": 21, | ||
"memory_usage": 3744 | ||
} | ||
} | ||
} | ||
}, | ||
"2001:db8:c006:ff:251::4": { | ||
"address_family": { | ||
"ipv6 unicast": { | ||
"neighbor_table_version": 4, | ||
"as": 65101, | ||
"msg_rcvd": 2104, | ||
"msg_sent": 2101, | ||
"tbl_ver": 47, | ||
"inq": 0, | ||
"outq": 0, | ||
"up_down": "05:49:31", | ||
"state_pfxrcd": "9", | ||
"prefix_received": "9", | ||
"state": "established", | ||
"route_identifier": "172.22.251.3", | ||
"local_as": 65101, | ||
"bgp_table_version": 47, | ||
"config_peers": 6, | ||
"capable_peers": 1, | ||
"attribute_entries": "[4/688]", | ||
"as_path_entries": "[0/0]", | ||
"community_entries": "[0/0]", | ||
"clusterlist_entries": "[0/0]", | ||
"soft_reconfig_recvd_paths": 9, | ||
"soft_reconfig_identical_paths": 9, | ||
"soft_reconfig_combo_paths": 0, | ||
"soft_reconfig_filtered_recvd": 0, | ||
"soft_reconfig_bytes": 0, | ||
"prefixes": { | ||
"total_entries": 9, | ||
"memory_usage": 3744 | ||
}, | ||
"path": { | ||
"total_entries": 21, | ||
"memory_usage": 3744 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...genie/libs/parser/nxos/tests/ShowBgpVrfAllAllSummary/cli/equal/golden_output_6_output.txt
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,24 @@ | ||
show bgp vrf default ipv6 uni summary | ||
BGP summary information for VRF default, address family IPv6 Unicast | ||
BGP router identifier 172.22.251.3, local AS number 65101 | ||
BGP table version is 47, IPv6 Unicast config peers 6, capable peers 1 | ||
9 network entries and 21 paths using 3744 bytes of memory | ||
BGP attribute entries [4/688], BGP AS path entries [0/0] | ||
BGP community entries [0/0], BGP clusterlist entries [0/0] | ||
9 received paths for inbound soft reconfiguration | ||
9 identical, 0 modified, 0 filtered received paths using 0 bytes | ||
|
||
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd | ||
2001:db8:c006:0:3e57:31ff:feb8:5dc4 | ||
4 65011 0 0 0 0 0 05:49:52 Shut (Admin) | ||
2001:db8:c006:ee::25 | ||
4 65120 0 0 0 0 0 05:49:52 Idle | ||
2001:db8:c006:ff:1::8 | ||
4 65152 0 0 0 0 0 05:49:52 Idle | ||
2001:db8:c006:ff:1::9 | ||
4 65152 0 0 0 0 0 05:49:52 Idle | ||
2001:db8:c006:ff:251::1 | ||
4 406942 | ||
0 0 0 0 0 05:49:52 Idle | ||
2001:db8:c006:ff:251::4 | ||
4 65101 2104 2101 47 0 0 05:49:31 9 |