tests: Fix wrong expectations in bgp_srv6_unicast topotest#21284
Merged
donaldsharp merged 2 commits intoFRRouting:masterfrom Mar 22, 2026
Merged
tests: Fix wrong expectations in bgp_srv6_unicast topotest#21284donaldsharp merged 2 commits intoFRRouting:masterfrom
bgp_srv6_unicast topotest#21284donaldsharp merged 2 commits intoFRRouting:masterfrom
Conversation
When check_route() is called with expect_sid="" to assert that a route has no SRv6 SID, it silently succeeds even if a SID is present. Add an explicit check: when expect_sid is "", return an error if a SRv6 SID is found on the route. Signed-off-by: Carmine Scarpitta <[email protected]>
bgp_srv6_unicast topotest
Greptile SummaryThis PR fixes two related bugs in the
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant R1
participant R2
participant R3
Note over R1: no sid export auto (unconfigured)
Note over R3: sid export auto (still active)
R1->>R2: Advertise 10.0.0.1/32 (no SRv6 SID)
R2->>R2: Install 10.0.0.1/32 — expect_sid="" ✓
R3->>R1: Advertise 10.0.0.3/32 + r3_unicast_sid
R1->>R2: Re-advertise 10.0.0.3/32 + r3_unicast_sid
R2->>R2: Install 10.0.0.3/32 — expect_sid=r3_unicast_sid ✓ (was wrongly "")
Reviews (1): Last reviewed commit: "tests: Fix test_bgp_srv6_sid_unexport ex..." | Re-trigger Greptile |
After removing sid export on R1, the test checks both 10.0.0.1/32 and 10.0.0.3/32 on R2 with expect_sid="", expecting neither to carry a SRv6 SID. This is wrong: 10.0.0.3/32 is originated by R3 which still has sid export configured, so it should still be seen on R2 with r3_unicast_sid. This wrong expectation was not caught because check_route() did not verify the absence of a SID when expect_sid="". Fix the check for 10.0.0.3/32 to expect r3_unicast_sid on R2, while keeping 10.0.0.1/32 checked for absence of SID. Signed-off-by: Carmine Scarpitta <[email protected]>
55a3c16 to
52e96d2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After removing sid export on R1, the test checks both 10.0.0.1/32 and 10.0.0.3/32 on R2 with
expect_sid="", expecting neither to carry a SRv6 SID. This is wrong: 10.0.0.3/32 is originated by R3 which still has sid export configured, so it should still beseen on R2 with
r3_unicast_sid.This wrong expectation was not caught because
check_route()did not verify the absence of a SID whenexpect_sid="".Fix the check for 10.0.0.3/32 to expect
r3_unicast_sidon R2, while keeping 10.0.0.1/32 checked for absence of SID.