tests: Ensure that nexthop group and route are installed before conti…#22614
tests: Ensure that nexthop group and route are installed before conti…#22614donaldsharp wants to merge 1 commit into
Conversation
…nuing Currently test_all_protocol_startup.py is initiating route installation for a route that depends on other routes that were also installed by sharpd. Under very heavy load previous sharpd route installs have not finished and the recursive route is not properly being installed due to timing. Modify the code such that when looking for the routes nexthop group, that the route is actually installed. Also provide a way to ignore the need for the route installation for the one case where we are testing a route-map deny of the install. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Greptile SummaryThis PR makes the all-protocol startup topotest wait for route installation before using a route's nexthop group. The main changes are:
Confidence Score: 4/5The changed test flow looks mergeable after tightening the deny-route nexthop-group check.
tests/topotests/all_protocol_startup/test_all_protocol_startup.py Important Files Changed
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
tests/topotests/all_protocol_startup/test_all_protocol_startup.py:1589
**Denied Route Can Reuse Installed Group**
When the denied route still reports a `Nexthop Group ID`, this opt-out allows `route_get_nhg_id` to return an ID without checking whether the route is installed. Since this route is installed with the same named nexthop group as the permitted route, `show nexthop-group rib <id>` can inspect the shared installed group and make the deny test fail on `Valid` or `Installed` even though the denied route itself was not installed.
Reviews (1): Last reviewed commit: "tests: Ensure that nexthop group and rou..." | Re-trigger Greptile |
| ) | ||
|
|
||
| nhg_id = route_get_nhg_id(deny_route_str) | ||
| nhg_id = route_get_nhg_id(deny_route_str, require_installed=False) |
There was a problem hiding this comment.
Denied Route Can Reuse Installed Group
When the denied route still reports a Nexthop Group ID, this opt-out allows route_get_nhg_id to return an ID without checking whether the route is installed. Since this route is installed with the same named nexthop group as the permitted route, show nexthop-group rib <id> can inspect the shared installed group and make the deny test fail on Valid or Installed even though the denied route itself was not installed.
Rule Used: Do not flag test dependencies in FRRouting test su... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/topotests/all_protocol_startup/test_all_protocol_startup.py
Line: 1589
Comment:
**Denied Route Can Reuse Installed Group**
When the denied route still reports a `Nexthop Group ID`, this opt-out allows `route_get_nhg_id` to return an ID without checking whether the route is installed. Since this route is installed with the same named nexthop group as the permitted route, `show nexthop-group rib <id>` can inspect the shared installed group and make the deny test fail on `Valid` or `Installed` even though the denied route itself was not installed.
**Rule Used:** Do not flag test dependencies in FRRouting test su... ([source](https://app.greptile.com/frrouting/github/frrouting/frr/-/custom-context?memory=46f3e596-e95d-4f59-b33a-1c9746142882))
How can I resolve this? If you propose a fix, please make it concise.
…nuing
Currently test_all_protocol_startup.py is initiating route installation for a route that depends on other routes that were also installed by sharpd. Under very heavy load previous sharpd route installs have not finished and the recursive route is not properly being installed due to timing. Modify the code such that when looking for the routes nexthop group, that the route is actually installed. Also provide a way to ignore the need for the route installation for the one case where we are testing a route-map deny of the install.