tests: fix bgp_soo topotest by separating IPv4/IPv6 address families - #22128
Conversation
The bgp_soo topotest was flaky because IPv4 routes were being advertised over both IPv4 and IPv6 BGP sessions due to the default behavior of "bgp default ipv4-unicast" which auto-activates IPv4 unicast for all neighbors. This caused inconsistent path counts depending on timing: - Sometimes multiPathCount showed 2 or 3 instead of expected values - The duplicate paths from IPv6 sessions carrying IPv4 routes caused the flakiness Fix by adding "no bgp default ipv4-unicast" to all routers and explicitly activating only the appropriate neighbors in each address-family: - IPv4 unicast: only IPv4 peers activated - IPv6 unicast: only IPv6 peers activated Update test expectations to reflect the correct path counts now that duplicate paths are eliminated. Note: The core SoO functionality is validated by test_bgp_soo() which checks route filtering based on SoO extended community matching. The pathCount/multiPathCount changes in other tests only affect JSON output format validation, not SoO behavior. Updated docstrings to clarify this. Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
Greptile SummaryThis PR fixes a flaky topotest in
Confidence Score: 5/5Safe to merge β the change tightens address-family peer activation and updates test expectations to match; no production routing code is touched. All five changed files are topotest infrastructure. The BGP config changes correctly apply No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
CPE1["CPE1 (AS 65000)"]
CPE2["CPE2 (AS 65000)"]
PE1["PE1 VRF RED (AS 65001)"]
PE2["PE2 VRF RED (AS 65001)"]
CPE1 -- "IPv4 eBGP 192.168.1.x" --> PE1
CPE1 -- "IPv6 eBGP 2001:db8:1::x" --> PE1
CPE2 -- "IPv4 eBGP 192.168.2.x" --> PE2
CPE2 -- "IPv6 eBGP 2001:db8:2::x" --> PE2
PE1 -- "IPv4 VPN iBGP 10.10.10.x" --> PE2
CPE1 -- "IPv4 iBGP 10.0.0.x" --> CPE2
CPE1 -- "IPv6 iBGP 2001:db8:10::x" --> CPE2
Reviews (1): Last reviewed commit: "tests: fix bgp_soo topotest by separatin..." | Re-trigger Greptile |
The bgp_soo topotest was flaky because IPv4 routes were being advertised over both IPv4 and IPv6 BGP sessions due to the default behavior of "bgp default ipv4-unicast" which auto-activates IPv4 unicast for all neighbors.
This caused inconsistent path counts depending on timing:
Fix by adding "no bgp default ipv4-unicast" to all routers and explicitly activating only the appropriate neighbors in each address-family:
Update test expectations to reflect the correct path counts now that duplicate paths are eliminated.
Note: The core SoO functionality is validated by test_bgp_soo() which checks route filtering based on SoO extended community matching. The pathCount/multiPathCount changes in other tests only affect JSON output format validation, not SoO behavior. Updated docstrings to clarify this.