[action] [PR:15411] bgp/test_bgp_session_flap.py
Fix condition intended to skip iBGP neighbors to work on single-asic
#15593
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.
Description of PR
#13662 added support for running
bgp/test_bgp_session_flap.py
onT2
topology.However, the condition it added to skip iBGP neighbors only works on multi-asic LCs:
if 'asic' not in v['description'].lower():
E.G. here is a switch which has 3 LCs (LC4 - multi-asic, LC5 - multi-asic, LC6 - single-asic)
Note that LC4 and LC5 neighbor iBGPs will be skipped because
ASIC
is in the name but LC6 won't because it's single ASIC.The better solution is to check the BGP session's
peer group
which will indicate if it's internal or not regardless of single-asic or multi-asic(Pdb) bgp_facts['bgp_neighbors']['10.0.254.5']
{'admin': 'up', 'accepted prefixes': 7, 'ip_version': 4, 'remote AS': 65100, 'local AS': 65100, 'description': 'cmp314-4', 'peer group': 'VOQ_CHASSIS_V4_PEER', 'remote routerid': '8.0.0.7', 'state': 'established', 'capabilities': {'peer restart timer': 120}, 'message statistics': {'Opens': {'sent': 3, 'rcvd': 3}, 'Notifications': {'sent': 0, 'rcvd': 0}, 'Updates': {'sent': 1634, 'rcvd': 243}, 'Keepalives': {'sent': 2373, 'rcvd': 2373}, 'Route Refresh': {'sent': 0, 'rcvd': 0}, 'Capability': {'sent': 0, 'rcvd': 0}, 'Total': {'sent': 4010, 'rcvd': 2619}}, 'mrai': 0, 'connections established': 3, 'connections dropped': 2}
(Pdb) bgp_facts['bgp_neighbors']['10.0.254.1']
{'admin': 'up', 'accepted prefixes': 4, 'ip_version': 4, 'remote AS': 65100, 'local AS': 65100, 'description': 'ASIC0', 'peer group': 'VOQ_CHASSIS_V4_PEER', 'remote routerid': '8.0.0.2', 'state': 'established', 'capabilities': {'peer restart timer': 120}, 'message statistics': {'Opens': {'sent': 1, 'rcvd': 1}, 'Notifications': {'sent': 0, 'rcvd': 0}, 'Updates': {'sent': 1088, 'rcvd': 1088}, 'Keepalives': {'sent': 2612, 'rcvd': 2612}, 'Route Refresh': {'sent': 0, 'rcvd': 0}, 'Capability': {'sent': 0, 'rcvd': 0}, 'Total': {'sent': 3701, 'rcvd': 3701}}, 'mrai': 0, 'connections established': 1, 'connections dropped': 0}
Note: I included
INTERNAL
as another keyword to indicate an iBGP neighbor as I believe that's what non-voq chassis will have as their neighbor name (Took this from https://github.com/sonic-net/sonic-mgmt/blob/master/tests/bgp/test_bgp_queue.py#L64)Summary:
Fixes #15410
Type of change
Back port request