tests: Ensure upstream IIF is in correct state after interface events - #21114
Conversation
Add a bit of code to the test_multicast_pim_uplink_topo1.py script to ensure that the upstream interfaces are in correct state before proceeding with the remainder of the test in places where the interface state has been changed. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Greptile SummaryThis PR adds four Key changes:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as Test Script
participant SBI as shutdown_bringup_interface
participant VUI as verify_upstream_iif
participant VM as verify_mroutes
Test->>SBI: Shut r2-link1, r2-link3 (odd links)
SBI-->>Test: Done
Test->>VUI: Verify IIF β {r2-link2, r2-link4} βͺ r3_links (retry up to 60s)
VUI-->>Test: True (IIF converged)
Test->>VM: Verify mroutes updated with new OIL/IIF
VM-->>Test: True
Prompt To Fix All With AIThis is a comment left during a code review.
Path: tests/topotests/multicast_pim_uplink_topo1/test_multicast_pim_uplink_topo1.py
Line: 962-970
Comment:
**Missing blank line before `verify_upstream_iif` call**
The other two similar insertions in this PR include a blank line between the `shutdown_bringup_interface` loop and the `verify_upstream_iif` call (for consistency with the surrounding code style), but this one is missing it.
```suggestion
shutdown_bringup_interface(tgen, "r1", intf, False)
result = verify_upstream_iif(
tgen,
"r1",
[topo["routers"]["r1"]["links"]["r2-link{}".format(i)]["interface"] for i in (2, 4)]
+ r1_r3_links,
"*",
IGMP_JOIN_RANGE_1,
)
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: 32493a3 |
| result = verify_upstream_iif( | ||
| tgen, | ||
| "r1", | ||
| [topo["routers"]["r1"]["links"]["r2-link{}".format(i)]["interface"] for i in (2, 4)] | ||
| + r1_r3_links, | ||
| "*", | ||
| IGMP_JOIN_RANGE_1, | ||
| ) | ||
| assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) |
There was a problem hiding this comment.
Missing blank line before verify_upstream_iif call
The other two similar insertions in this PR include a blank line between the shutdown_bringup_interface loop and the verify_upstream_iif call (for consistency with the surrounding code style), but this one is missing it.
| result = verify_upstream_iif( | |
| tgen, | |
| "r1", | |
| [topo["routers"]["r1"]["links"]["r2-link{}".format(i)]["interface"] for i in (2, 4)] | |
| + r1_r3_links, | |
| "*", | |
| IGMP_JOIN_RANGE_1, | |
| ) | |
| assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) | |
| shutdown_bringup_interface(tgen, "r1", intf, False) | |
| result = verify_upstream_iif( | |
| tgen, | |
| "r1", | |
| [topo["routers"]["r1"]["links"]["r2-link{}".format(i)]["interface"] for i in (2, 4)] | |
| + r1_r3_links, | |
| "*", | |
| IGMP_JOIN_RANGE_1, | |
| ) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/topotests/multicast_pim_uplink_topo1/test_multicast_pim_uplink_topo1.py
Line: 962-970
Comment:
**Missing blank line before `verify_upstream_iif` call**
The other two similar insertions in this PR include a blank line between the `shutdown_bringup_interface` loop and the `verify_upstream_iif` call (for consistency with the surrounding code style), but this one is missing it.
```suggestion
shutdown_bringup_interface(tgen, "r1", intf, False)
result = verify_upstream_iif(
tgen,
"r1",
[topo["routers"]["r1"]["links"]["r2-link{}".format(i)]["interface"] for i in (2, 4)]
+ r1_r3_links,
"*",
IGMP_JOIN_RANGE_1,
)
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
@Mergifyio backport stable/10.6 |
β Backports have been createdDetails
|
|
@Mergifyio backport stable/10.6 |
βοΈ Command
|
tests: Ensure upstream IIF is in correct state after interface events (backport #21114)
Add a bit of code to the test_multicast_pim_uplink_topo1.py script to ensure that the upstream interfaces are in correct state before proceeding with the remainder of the test in places where the interface state has been changed.