Skip to content

pimd, tests: Add pim test showing that registers work with no path -> rp#20577

Merged
Jafaral merged 2 commits intoFRRouting:masterfrom
donaldsharp:pim_test_registers_with_no_path
Jan 25, 2026
Merged

pimd, tests: Add pim test showing that registers work with no path -> rp#20577
Jafaral merged 2 commits intoFRRouting:masterfrom
donaldsharp:pim_test_registers_with_no_path

Conversation

@donaldsharp
Copy link
Member

@donaldsharp donaldsharp commented Jan 22, 2026

Add a test that creates a test router r1 that does not actually have a path to the rp at first, start a *,G and a S,G stream on r1 and then introduce the ability to actually reach the RP.

@frrbot frrbot bot added the tests Topotests, make check, etc label Jan 22, 2026
@greptile-apps
Copy link

greptile-apps bot commented Jan 22, 2026

Greptile Summary

Added a new topotest validating PIM register functionality when the Rendezvous Point (RP) is initially unreachable, then becomes reachable during active multicast traffic.

The test creates a topology with three routers: rp (RP), r1 (first-hop router), and r2 (multicast source). Key test phases include:

  • Verifying r1 initially has no route to the RP loopback (10.255.0.3/32)
  • Establishing PIM neighbor adjacencies between rp and r1
  • Starting multicast traffic from r2 (10.0.2.2) to group 229.1.1.1 while RP is unreachable
  • Dynamically adding routes to make the RP reachable
  • Validating proper PIM upstream state transitions (RegPrune on r1, RegNoInfo on rp)

This test validates the important edge case where multicast streams start before RP reachability is established, ensuring PIM registers work correctly when paths are later introduced.

Confidence Score: 5/5

  • This PR is safe to merge with no issues identified
  • This is a pure test addition with no production code changes. The test follows established topotest patterns, includes proper topology setup/teardown, comprehensive state validation, and memory leak testing. All configuration files are syntactically correct and align with the test objectives.
  • No files require special attention

Important Files Changed

Filename Overview
tests/topotests/pim_no_path_to_rp/test_pim_no_path_to_rp.py Added comprehensive test validating PIM register behavior when RP is initially unreachable, then becomes reachable
tests/topotests/pim_no_path_to_rp/r1/frr.conf Configuration for r1 router with PIM and IGMP enabled, RP set to 10.255.0.3
tests/topotests/pim_no_path_to_rp/r2/frr.conf Minimal configuration for r2 as multicast source, no PIM configuration needed
tests/topotests/pim_no_path_to_rp/rp/frr.conf Configuration for RP router with loopback address 10.255.0.3/32 serving as the rendezvous point

Sequence Diagram

sequenceDiagram
    participant Test as Test Framework
    participant r1 as Router r1
    participant rp as Router rp (RP)
    participant r2 as Router r2 (Source)
    
    Note over Test,r2: Setup Phase
    Test->>r1: Configure PIM, IGMP, set RP to 10.255.0.3
    Test->>rp: Configure PIM, set loopback 10.255.0.3/32
    Test->>r2: Configure basic IP only
    
    Note over Test,r2: Phase 1: No RP Reachability
    Test->>r1: Verify no route to 10.255.0.3/32
    r1-->>Test: "Network not in table"
    
    Test->>r1: Check PIM neighbor with rp
    Test->>rp: Check PIM neighbor with r1
    r1-->>Test: PIM neighbor on r1-eth0
    rp-->>Test: PIM neighbor on rp-eth0
    
    Note over Test,r2: Phase 2: Start Multicast Traffic
    Test->>r1: Start mcast-tester for 229.1.1.1
    Test->>r2: Start mcast-tx from 10.0.2.2 to 229.1.1.1
    
    r2->>r1: Multicast traffic (S,G)
    Test->>r1: Verify mroute exists
    r1-->>Test: Mroute (10.0.2.2, 229.1.1.1) present
    Test->>r1: Verify IGMP group
    r1-->>Test: IGMP group 229.1.1.1 on r1-eth1
    
    Note over Test,r2: Phase 3: Add RP Reachability
    Test->>rp: Add route: 10.0.2.0/24 via 10.0.1.1
    Test->>r1: Add route: 10.255.0.3/32 via 10.0.1.3
    
    Test->>r1: Verify route to RP loopback
    r1-->>Test: Route via r1-eth0
    Test->>rp: Verify route to source
    rp-->>Test: Route via rp-eth0
    
    Note over Test,r2: Phase 4: Verify PIM State
    Test->>r1: Check PIM RP info
    r1-->>Test: RP reachable via r1-eth0
    
    Test->>r1: Check upstream state
    r1-->>Test: State=J,RegP, regState=RegPrune
    
    Test->>rp: Check upstream state
    rp-->>Test: State=NotJ, regState=RegNoInfo
    
    Test->>r1: Terminate multicast processes
    Test->>r2: Terminate multicast processes
Loading

@greptile-apps
Copy link

greptile-apps bot commented Jan 22, 2026

Greptile found no issues!

From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section.

This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".

@Jafaral Jafaral changed the title tests: Add a test for pim that shows that registers work with no path… tests: Add pim test showing that registers work with no path -> path Jan 23, 2026
@Jafaral Jafaral changed the title tests: Add pim test showing that registers work with no path -> path tests: Add pim test showing that registers work with no path -> rp Jan 23, 2026
@frrbot frrbot bot added the pim label Jan 23, 2026
@donaldsharp donaldsharp force-pushed the pim_test_registers_with_no_path branch from 7b4de6e to 8555780 Compare January 23, 2026 20:10
… to rp

Add a test that creates a test router r1 that does not actually have a path
to the rp at first, start a *,G and a S,G stream on r1 and *then* introduce
the ability to actually reach the RP.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
I'm seeing the test_pim_no_path_to_rp.py fail very rarely.
This test sets up both a S,G sender and a *,G receiver
on the same route.  When certain conditions are hit pim
does not converge on the correct state.

Upon examination of the output we are seeing this race condition:

Working:

S,G stream seen
*,G igmp join seen
state transitions from NotJoined -> Joined

Not Working:

*,G igmp join seen
S,G stream seen
State does not transition from NotJoined -> Joined

The code is effectively never examining on receipt of the
S,G stream whether or not it should do the join_desired()
or not.  Let's just let it do so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
@donaldsharp donaldsharp force-pushed the pim_test_registers_with_no_path branch from 8555780 to 3411699 Compare January 23, 2026 20:11
@Jafaral
Copy link
Member

Jafaral commented Jan 23, 2026

@Mergifyio backport stable/10.5 stable/10.4

@mergify
Copy link

mergify bot commented Jan 23, 2026

backport stable/10.5 stable/10.4

✅ Backports have been created

Details

@Jafaral Jafaral changed the title tests: Add pim test showing that registers work with no path -> rp pimd, tests: Add pim test showing that registers work with no path -> rp Jan 23, 2026
@Jafaral Jafaral merged commit 91b08c1 into FRRouting:master Jan 25, 2026
19 checks passed
donaldsharp added a commit that referenced this pull request Jan 25, 2026
pimd, tests: Add pim test showing that registers work with no path -> rp (backport #20577)
donaldsharp added a commit that referenced this pull request Jan 25, 2026
pimd, tests: Add pim test showing that registers work with no path -> rp (backport #20577)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants