Skip to content

tests: Ensure upstream IIF is in correct state after interface events - #21114

Merged
Jafaral merged 1 commit into
FRRouting:masterfrom
donaldsharp:fix_multicast_pim_topo_test
Mar 13, 2026
Merged

tests: Ensure upstream IIF is in correct state after interface events#21114
Jafaral merged 1 commit into
FRRouting:masterfrom
donaldsharp:fix_multicast_pim_topo_test

Conversation

@donaldsharp

Copy link
Copy Markdown
Member

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.

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>
@frrbot frrbot Bot added the tests Topotests, make check, etc label Mar 12, 2026
@greptile-apps

greptile-apps Bot commented Mar 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds four verify_upstream_iif barrier checks in test_multicast_pim_uplink_topo1.py to ensure the PIM upstream inbound interface (IIF) has converged to a valid/active interface after intentional interface shutdown events, before the test proceeds to verify mroute state and multicast traffic.

Key changes:

  • In three test functions (test_mroutes_updated_with_correct_oil_iif_when_receiver_is_in_and_outside_DUT β€” two separate invocations β€” and test_mroutes_updated_with_correct_oil_iif_when_source_is_in_and_outside_DUT_), a verify_upstream_iif call is inserted immediately after the shutdown_bringup_interface loop that takes down odd-numbered r2 links.
  • Each call passes the set of remaining active interfaces (even-numbered r2 links + r3 links) as acceptable IIFs, correctly reflecting which interfaces are still up after the shutdown.
  • This prevents the subsequent verify_mroutes assertions from racing against PIM reconvergence, improving test reliability.
  • One minor style inconsistency: the third insertion (around line 962) is missing a blank line between the for loop and the verify_upstream_iif call, unlike the other three insertions.

Confidence Score: 4/5

  • This PR is safe to merge β€” it only adds test stabilization checks with no impact on production code.
  • All four new verify_upstream_iif calls correctly enumerate the active (non-shutdown) interfaces as acceptable IIFs, and the function itself has a 60-second retry timeout to handle convergence delays. The only finding is a trivial missing blank line in one of the four insertions.
  • No files require special attention.

Important Files Changed

Filename Overview
tests/topotests/multicast_pim_uplink_topo1/test_multicast_pim_uplink_topo1.py Adds four verify_upstream_iif barrier checks after interface shutdown events in three test functions, ensuring PIM upstream IIF state has converged before proceeding. Logic is correct; one minor style inconsistency (missing blank line) at line 962.

Sequence Diagram

sequenceDiagram
    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
Loading
Prompt To Fix All 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.

Last reviewed commit: 32493a3

Comment on lines +962 to +970
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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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!

@Jafaral

Jafaral commented Mar 12, 2026

Copy link
Copy Markdown
Member

@Mergifyio backport stable/10.6

@mergify

mergify Bot commented Mar 12, 2026

Copy link
Copy Markdown

backport stable/10.6

βœ… Backports have been created

Details

@Jafaral

Jafaral commented Mar 13, 2026

Copy link
Copy Markdown
Member

@Mergifyio backport stable/10.6

@Jafaral
Jafaral merged commit c09e303 into FRRouting:master Mar 13, 2026
32 of 33 checks passed
@mergify

mergify Bot commented Mar 13, 2026

Copy link
Copy Markdown

backport stable/10.6

β˜‘οΈ Command backport stable/10.6 ignored because it is already running from a previous command.

Jafaral added a commit that referenced this pull request Mar 14, 2026
tests: Ensure upstream IIF is in correct state after interface events (backport #21114)
@donaldsharp
donaldsharp deleted the fix_multicast_pim_topo_test branch April 29, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport master size/M tests Topotests, make check, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants