-
Notifications
You must be signed in to change notification settings - Fork 758
Fix route_check.py to ignore local p2p IP prefixes #3882
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
Fix route_check.py to ignore local p2p IP prefixes #3882
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
227374e to
da49c12
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
da49c12 to
44dcf95
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
44dcf95 to
c03c087
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
70f909b to
5930d70
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
5930d70 to
50e9636
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
50e9636 to
c605f09
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
c605f09 to
3ab0820
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
ac95347 to
d71aa3d
Compare
ef9d4bc to
84294b9
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
84294b9 to
44d3417
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
44d3417 to
016c07e
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
* In some cases where there are repeated link flaps, route_check.py flags local
p2p IP prefixes as missing in APPL_DB. These /31 IPv4 or /126 IPv6 IPs are
not expected to be present in APPL_DB after a link goes down. This change
tries to filter out such entries.
Failure results: {{
"missed_ROUTE_TABLE_routes": [
"10.10.196.16/31",
"2603:10b0:31f:753::24/126"
]
}}
Failed. Look at reported mismatches above
add: []
del: [
"10.10.196.16/31",
"2603:10b0:31f:753::24/126"
]
Signed-off-by: Prabhat Aravind <paravind@microsoft.com>
016c07e to
1b3425d
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@prabhataravind , changes lgtm. Since loopback is /32, i think we are good in covering loopback ip. |
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.
Pull Request Overview
This PR updates route_check.py to ignore local point-to-point IP prefixes (/31 IPv4 and /126 IPv6) when checking for missing routes, and adds a corresponding test case.
- Introduce
is_point_to_point_prefix,get_local_p2p_ips, andfilter_out_local_p2p_ipshelpers. - Apply filtering in
check_routes_for_namespacebefore reporting missing APPL_DB routes. - Add test scenario (case 28) covering local P2P IP prefixes.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/route_check_test_data.py | Add test case 28 for validating filtering of local p2p IPs. |
| scripts/route_check.py | New helpers to detect and exclude /31 (IPv4) and /126 (IPv6) prefixes. |
Comments suppressed due to low confidence (3)
scripts/route_check.py:450
- The
:returndescription is incorrect foris_point_to_point_prefix(it returns a boolean, not a list). Update the docstring to reflect that it returns True/False.
:return sorted list of local p2p IP prefixes
scripts/route_check.py:485
- [nitpick] Pretty-printing with
indent=4on every debug log may be expensive; consider logging a summary or cachingget_local_p2p_ipsresults to reduce repeated DB lookups and JSON serialization.
print_message(syslog.LOG_DEBUG, json.dumps({"APPL_DB_INTF": sorted(intf)}, indent=4))
tests/route_check_test_data.py:1321
- The IPv6 prefix here starts with '9603:...' but elsewhere (and in descriptions) it uses '2603:...'. This mismatch may cause the test to not cover the intended prefix.
"PortChannel1021:9603:10b0:503:df4::5e/126": {},
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
In some cases where there are repeated link flaps, route_check.py flags local p2p IP prefixes as missing in APPL_DB. These /31 IPv4 or /126 IPv6 IPs are not expected to be present in APPL_DB after a link goes down. This change tries to filter out such entries.
Failure results: {{
"missed_ROUTE_TABLE_routes": [
"10.10.196.16/31",
"2603:10b0:31f:753::24/126"
]
}}
Failed. Look at reported mismatches above
add: []
del: [
"10.10.196.16/31",
"2603:10b0:31f:753::24/126"
]
What I did
How I did it
How to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)