Add L3VNI cross-DC test cases (L3VNI_dci:1-2, 6-30, 39-43, 91, 101) + 5 trigger classes#12
Add L3VNI cross-DC test cases (L3VNI_dci:1-2, 6-30, 39-43, 91, 101) + 5 trigger classes#12
Conversation
- Add test_base_dci_l3vni_ipv4_across_dci: L3VNI IPv4 traffic across DCI - Add test_base_dci_l3vni_ipv6_across_dci: L3VNI IPv6 traffic across DCI - Add test_base_dci_l3vni_control_plane_across_dci: L3VNI control plane verification (VRF-VNI maps, EVPN VNI, BGP EVPN summary, Type-5 routes) - Add verify_evpn_type5_routes_dci() helper in vxlan_helper.py - Enable ENABLE_L3_ACROSS_DCI flag for cross-DC L3 stream generation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- L3VNI_dci:1: Full base profile verification (VRF-VNI, VLAN-VNI, Type-5 routes on BGWs) + IPv4 traffic across DCI - L3VNI_dci:2: Type-5 route detail verification (format, L3VNI in ext-community, IPv6 VTEP next-hop, RT values) + BGP EVPN summary + IPv6 traffic across DCI - L3VNI_dci:6: eBGP multihop EVPN session verification between BGWs across DCs + VRF-VNI maps + EVPN VNI table + Type-5 route exchange New helpers in vxlan_helper.py: - verify_evpn_type5_route_detail_dci(): Checks Type-5 route format, L3VNI (10101/10102) in extended community, RT values, IPv6 next-hop - verify_bgp_evpn_multihop_sessions_dci(): Verifies eBGP multihop EVPN sessions to remote DC BGWs via OVERLAY_WAN peer-group
…plan - Rename test_base_dci_l3vni_ipv4_across_dci -> test_base_dci_l3vni_base_profile (L3VNI_dci:1) - Rename test_base_dci_l3vni_ipv6_across_dci -> test_base_dci_l3vni_type5_route_ipv6_vtep (L3VNI_dci:2) - Rename test_base_dci_l3vni_control_plane_across_dci -> test_base_dci_l3vni_ebgp_multihop_bgw (L3VNI_dci:6) - Remove config steps 1-3 from L3VNI_dci:1 docstring (config done by hooks, not test code) - Remove traffic step from L3VNI_dci:1 (not in testplan description) - Remove BGP EVPN summary step and traffic step from L3VNI_dci:2 (not in testplan description) - Update docstrings to match testplan titles exactly
|
In the l3vni_config_diff.txt file we have configuration specific to L3VNI which is missing here. This needs to incorporated before doing testcases verification. |
1 similar comment
|
In the l3vni_config_diff.txt file we have configuration specific to L3VNI which is missing here. This needs to incorporated before doing testcases verification. |
…rification Incorporates the L3VNI-specific configuration for all BGW nodes as part of the config_bgw_nodes() fixture, ensuring it runs before L3VNI test verification. SONiC CLI (l3vni_sonic_bgw_dci): - VLAN 101/102 creation, VRF add, VRF-VLAN bindings - VXLAN map on vxlan-dc and vxlan-wan (cross-DC L3VNI 10101/10102) - VRF-VNI map (Vrf101->10101, Vrf102->10102) FRR config (l3vni_frr_bgw_dci): - VRF-VNI bindings (cross-DC L3VNI) - BGP extcommunity-lists (RT-WAN-* for leaf routes, RT-DC-* for remote BGW routes) - RT-REWRITE-WAN route-map (IPv4 WAN VIP next-hop) - RT-REWRITE-DC route-map (IPv6 DC VIP next-hop) - Apply route-maps to OVERLAY and OVERLAY_WAN neighbors - BGP VRF config with route-target import/export Helper functions added to vxlan_helper.py: - _get_l3vni_bgw_params(): Computes per-BGW L3VNI parameters from topology - generate_l3vni_bgw_sonic_config(): SONiC CLI config generator - generate_l3vni_bgw_frr_config(): FRR config generator - delete_l3vni_bgw_frr_config(): FRR unconfig generator Addresses PR comment about missing L3VNI configuration from l3vni_config_diff.txt.
|
Addressed: L3VNI configuration from The L3VNI-specific configuration is now applied as part of Two new config features added:
All parameters derived dynamically from topology data. Corresponding |
|
there is additional configuartions in L3VNI_config_diff.txt file specific to L3VNI which is missing here. This needs to incorporated before doing testcases verification. |
Per l3vni_config_diff.txt lines 1-39, each leaf node needs to import route-targets from its local (same-DC) BGW cross-DC L3VNI so that Type-5 prefix routes from remote DCs are accepted into the leaf's VRF. Example for DC1 leafs (Vrf101, cross-DC VNI 10101): route-target import 65102:10101 (DC1 BGW1) route-target import 65103:10101 (DC1 BGW2) Changes: - vxlan_helper.py: Add generate_l3vni_leaf_rt_config() and delete_l3vni_leaf_rt_config() helpers; register l3vni_leaf_rt_dci and delete_l3vni_leaf_rt_dci features in config_feature_dci() - test_vxlan_dci.py: Apply l3vni_leaf_rt_dci in config_l2l3vni() after bgp_l3vni_config_dci; remove in unconfig_l2l3vni() before delete_bgp_l3vni_config_dci
|
@bpar9 Addressed the missing L3VNI configurations from BGW config (commit cba3b5f) — lines 42-685 of
Leaf VRF route-target imports (commit 75434ec) — lines 1-39 of
All parameters derived dynamically from topology data. Cross-DC VNI computed as |
|
For the verification, we have this verify_base_setup_bgw in the test_vxlan_dci.py file. Can we use that function to verify L3VNI base testcases? |
…VNI checks Per PR review comment: replace manual VRF-VNI and VLAN-VNI verification loops in L3VNI test cases with calls to verify_base_setup_bgw(). - L3VNI_dci:1: Steps 1-2 (VRF-VNI + VLAN-VNI on all nodes) replaced with verify_base_setup_bgw(nodes, checks=['vrf_vni', 'vlan_vni']) - L3VNI_dci:2: Step 2 (VRF-VNI on BGWs) replaced with verify_base_setup_bgw(bgw_nodes, checks=['vrf_vni']) - L3VNI_dci:6: Step 2 (VRF-VNI on BGWs) replaced with verify_base_setup_bgw(bgw_nodes, checks=['vrf_vni']) - Type-5 route verification remains custom (not available in verify_base_setup_bgw)
|
@vallabh78 Good suggestion. Refactored in commit 8349da3 to reuse
The Type-5 route verification (Steps 2/3 in L3VNI_dci:1, Step 1 in L3VNI_dci:2) and eBGP multihop session verification (Step 1 in L3VNI_dci:6) remain as custom code since |
|
can we move the evpn route type 5 verification to verify_base_setup_bgw and call it in the testcase? In that way we can use it in other testcases. |
|
We need to add this bgp cache: bgp_info = vxlan_obj.get_bgp_underlay_info_cached() and pass it into l3vni_sonic_bgw_dci and l3vni_frr_bgw_dci in the config_bgw_nodes function. Without this it caused the script to fail and script was unable to configure any BGP related config. |
…config_bgw_nodes Address PR review comments: 1. Move EVPN Type-5 route verification into verify_base_setup_bgw as a new 'evpn_type5' check (BGW-only, auto-skipped on leaf nodes). Added to ALL_CHECKS, control_plane CHECK_SET, and docstring. 2. Add bgp_info = vxlan_obj.get_bgp_underlay_info_cached() in config_bgw_nodes and pass it to l3vni_sonic_bgw_dci and l3vni_frr_bgw_dci calls to fix BGP config lookup failures. Refactored L3VNI test cases to use new evpn_type5 check: - L3VNI_dci:1: checks=['vrf_vni', 'vlan_vni', 'evpn_type5'] - L3VNI_dci:2: checks=['vrf_vni', 'evpn_type5'] (Step 2) - L3VNI_dci:6: checks=['vrf_vni', 'evpn_type5'] (merged old Steps 2+4)
|
@vallabh78 Done in commit fbe972b. Added
All 3 L3VNI test cases now use it:
The detailed Type-5 route verification ( |
|
@vallabh78 Fixed in commit fbe972b. Added bgp_info = vxlan_obj.get_bgp_underlay_info_cached()
vxlan_obj.config_feature_parallel(bgw_nodes, 'l3vni_sonic_bgw_dci', dci_enabled=True, bgp_info=bgp_info)
vxlan_obj.config_feature_parallel(bgw_nodes, 'l3vni_frr_bgw_dci', dci_enabled=True, bgp_info=bgp_info) |
|
Lets follow the same pattern for all testcases and use verify_base_setup_bgw and call specific verification based on testcase requirement. |
…t pattern Add three new reusable checks to verify_base_setup_bgw: - evpn_type5_detail: Detailed Type-5 route verification (format, L3VNI, RT, IPv6 next-hop) - ebgp_multihop: eBGP multihop EVPN session verification between BGWs across DCs - evpn_vni: EVPN VNI table verification (L3 VNIs on BGW nodes) Refactor L3VNI_dci:2 and L3VNI_dci:6 to use verify_base_setup_bgw for all verification instead of custom loops, following the same pattern as L3VNI_dci:1. L3VNI_dci:2: checks=['evpn_type5_detail', 'vrf_vni', 'evpn_type5'] L3VNI_dci:6: checks=['ebgp_multihop', 'vrf_vni', 'evpn_type5', 'evpn_vni']
|
@vallabh78 Done in commit 9d286a7. All three L3VNI test cases now follow the same pattern — every verification goes through Three new reusable checks added to
Refactored test cases:
No more custom verification loops in any L3VNI test case. |
|
can we add the L3VNI vlan vrf binding in the vxlan_dci_input_file.yaml for the BGW's? beliw is an example |
|
@vallabh78 Done in commit 401dc90. Added
All BGWs have the same Also updated |
|
So all BGW's use. Update it in the yaml file vrf Vrf101 |
E NameError: name 'get_tc_params' is not defined cisco/tortuga/solution/test_vxlan_dci.py:4317: NameError |
|
@vallabh78 Good catch — fixed in commit e2d57ab. Both |
|
wanted to update the type5 verification. |
…ists, RIB/FIB on all nodes Leaf model enhancements (_verify_type5_leaf): - Added RT/ET/RMAC attribute checks (at least one path per prefix) - Added usable path check (at least one valid path with next-hop) - Added optional BGW-style (re-originated) path detection (only checked when bgw_asns provided in exp_route) BGW model enhancements (_verify_type5_bgw): - Added explicit best_path_exists check column RIB/FIB install check (verify_base_setup_bgw): - Removed BGW-only restriction; now runs on both leaf and BGW nodes - Both node types verify tenant prefixes in show ip route vrf output
|
@vallabh78 Enhanced Type-5 verification models per your feedback in commit 6c3dc88. Leaf model enhancements (
|
| # | Check | How |
|---|---|---|
| 1 | prefix present | prefix found in parsed output |
| 2 | best path exists | best path (>) detected |
| 3 | attributes present | at least one path has RT, ET, RMAC (3 separate columns) |
| 4 | usable path | at least one valid path (*) with a next-hop |
| 5 | best NH = local VTEP | best path next-hop matches leaf's IPv6 loopback |
| 6 | best weight = 32768 | locally originated best path weight |
| 7 | BGW-style path (optional) | at least one path with BGW ASN in AS path (only checked when bgw_asns provided in expected route data) |
Checks 3, 4, 7 are new additions.
BGW model enhancements (_verify_type5_bgw):
| # | Check | How |
|---|---|---|
| 1 | prefix exists | prefix found in parsed output |
| 2 | path count matches | actual count == DC-specific expected count |
| 3 | best path exists | best path (>) detected (new explicit check) |
| 4 | local-site leaf path | at least one path with local leaf ASN |
| 5 | remote BGW path | at least one path with remote BGW ASN |
| 6 | best path is local leaf | best path AS is local leaf, not remote BGW |
| 7 | RT, ET, RMAC | at least one path has each attribute |
| 8 | IPv6 next-hop | at least one path has IPv6 VTEP NH |
Check 3 is new (was previously implicit in check 6).
RIB/FIB install check:
- Now runs on both leaf and BGW nodes (previously BGW-only)
- Verifies
show ip route vrf Vrf101/Vrf102has all expected tenant subnet prefixes as BGP routes
|
check this file and see if we can verify type5 routes correctly on leaf and BGW. |
The BGW path count formula was: local_leaf_count + remote_bgw_count This gave 7 for DC1 BGW (4 leaves + 3 remote BGWs), but actual lab output shows 9 paths per prefix. Root cause: each remote BGW re-originates routes from ALL leaves in its DC under separate RDs. So the correct formula is: local_leaf_count + SUM(bgw_count_in_dc * leaf_count_in_dc) For DC1 BGW: 4 + (DC2: 2*2) + (DC3: 1*1) = 4 + 4 + 1 = 9 Validated against real lab output from type5_verification_fix.txt: - Parser correctly handles *= (ECMP multipath) markers - All 20 prefixes on DC1 BGW2 show exactly 9 paths - Leaf verification: RT/ET/RMAC, best-path weight=32768, local VTEP all pass
|
@vallabh78 Analyzed Parser validation (
BGW path count issue — IDENTIFIED and FIXED (commit 9c6bcf0): The verification output showed Root cause: For DC1 BGW2: Updated expected path counts:
Leaf verification — ALL PASS (no changes needed):
|
|
can you check if the verification will work for this - |
Validation of reviewer's two lab output files revealed that the BGW path count per prefix varies depending on BGW re-origination behavior: - evpn_type_5_output.txt shows 7 paths (best-only re-origination) - type5_verification_fix.txt showed 9 paths (all-leaf re-origination) Changed path count model from exact match to range: - Min: local_leaves + remote_bgw_count (one path per remote BGW) - Max: local_leaves + SUM(bgws*leaves per remote DC) - DC1 BGWs: min=7, max=9 Updated three functions: - get_expected_type5_routes(): now emits path_count_min/path_count_max - _verify_type5_bgw(): range-based comparison via matching display strings - verify_evpn_type5_route_presence_dci(): range-based comparison
|
@vallabh78 Completed comprehensive validation of the Type-5 parser and verification logic against both lab output files ( Parser Validation ResultsFile 1:
File 2:
Enhanced BGW verification checks ALL PASS on all 20 prefixes:
Enhanced leaf verification checks ALL PASS on all 21 prefixes from leaf1_dc2. Critical Finding: Path Count Discrepancy (Fixed)The previous
The exact match Fix (commit cba8e10): Changed BGW path count from exact match to range check
Updated in all three functions:
This ensures verification passes whether BGWs send best-only or all-leaf paths. |
|
Can you confirm if this is what we have: For each prefix, derive booleans such as: present Then pass if all required booleans are true. Remove these strict checks: best_nh_is_local_vtep These are the ones that will break after restart even if behavior is acceptable. |
…move strict checks Per reviewer feedback, replace separate _verify_type5_leaf() and _verify_type5_bgw() with unified _verify_type5_unified() using the same 10 boolean columns for every prefix on both node types: present, has_best, has_rt, has_et, has_rmac, has_ipv6_nh, installed_in_rib, installed_in_fib, has_local_class_path, has_remote_class_path Removed strict checks that break after restart: - best_nh_is_local_vtep - best_weight_32768 - best_path_is_local_leaf - exact path_count == N - exact RD matching RIB/FIB install check is now integrated into verify_evpn_type5_comprehensive() (no longer a separate check). verify_type5_route_presence_dci() also uses boolean checks only.
|
@vallabh78 — Confirmed, this is now exactly what we have. Commit 3af1bee unifies both leaf and BGW to use the same 10 boolean checks per prefix:
Pass = all required booleans are Removed strict checks (all five):
Additional cleanup:
Net: −574 lines, +186 lines across both files. |
|
lets remove verify_traffic before the trigger. Check TestVxlanRestartTriggers and TestVxlanReloadTriggers and TestVxlanBGPTriggers. we need to verify the traffic only after the trigger. |
… reviewer feedback
|
@vallabh78 Done — removed all pre-trigger Classes/methods modified (commit c026de7): TestVxlanRestartTriggers:
TestVxlanReloadTriggers:
TestVxlanBGPTriggers:
Step numbers renumbered accordingly in all methods. Post-trigger traffic verification and base setup verification retained. |
|
type5 verification failed again. Make sure you are doing correct verification for both leaf and BGW. Subnets are same but prefixes path may change. For control-plane type-5 check For each expected prefix: present = yes For BGW, don't use same but from the data we have make sure the verification will work |
|
how logn will it take for type
where are we on this? |
…t, accept connected routes in FIB check
|
@vallabh78 Fixed both leaf Type-5 verification failures (commit 3607c39): 1. 2.
Leaf check logic now:
BGW check logic unchanged — |
|
type5 verification failing again. i see it fails for leaf0_dc3 |
…t 32768, empty AS path) as local-class
|
Fixed in commit d4f6f08. The root cause on leaf0_dc3: Problem: Fix: In elif not as_path.strip() and path.get('weight') == '32768':
# Self-originated route: empty AS path + weight 32768
has_local_class = TrueThis handles single-leaf DCs (DC3) where all routes are self-originated, while multi-leaf DCs (DC1 with 4 leafs) continue to match on peer leaf ASNs in AS path as before. |
|
i see the ixia traffic rate is 0.8% and i want it to be 0.1%. can we fix that? |
|
Fixed in commit 5f5b3f3. Changed the default fallback The YAML config already had |
|
can you confirm if its this |
|
Yes, confirmed. The YAML ( l2l3:
pkts_per_burst: 100
rate_percent: 0.1
bum:
pkts_per_burst: 10
rate_percent: 0.1And the Python fallback defaults in |
Description of PR
Summary: Adds thirty-two L3VNI cross-DC test cases to the VXLAN DCI test suite with control plane and data plane verification aligned to the DCI Solution Testplan, driven by detailed configuration context from
l3vni_config_diff.txtandvxlan_dci_input_file.yaml. Enables cross-DC L3 stream generation. Incorporates L3VNI-specific BGW configuration (SONiC CLI + FRR) intoconfig_bgw_nodes()and leaf VRF route-target imports from local BGWs intoconfig_l2l3vni(), so all L3VNI configuration froml3vni_config_diff.txtis applied before any L3VNI test verification runs. All test case verification follows a consistent pattern usingverify_base_setup_bgw()with testcase-specific check lists. BGW L3VNI VLAN/VRF bindings are now declared invxlan_dci_input_file.yamland consumed by the helper code. Cross-DC L3 traffic now uses 23 specific DCI flows froml3vni_dci_traffic_flows.txtinstead of generic full-mesh filtering. Type-5 route verification uses unified boolean-based model with differentiated leaf/BGW expectations —has_remote_class_pathis n/a on leaf nodes (leaves don't see BGW ASNs),has_local_class_pathcounts self-originated routes (weight 32768 + empty AS path) for single-leaf DCs, FIB check accepts both connected (C>*) and BGP (B>*) routes. RIB/FIB install verification is integrated; strict checks removed. Old basic/detail Type-5 verification functions have been removed per reviewer feedback. Additionally, adds five trigger test classes (restart, reload, reboot, power cycle, BGP reset, DCI link flap/shut, VLAN/PortChannel operations) with L3VNI traffic verification. All trigger test classes now verify traffic only after the trigger — pre-trigger traffic verification has been removed per reviewer feedback.Link to Devin Session: https://cisco-demo.devinenterprise.com/sessions/8fabef50d24246fd9573c19e56e512c6
Requested by: @bpar9
Changes:
vxlan_dci_input_file.yaml:l3vnisections to all 5 BGW nodes with uniform cross-DC VRF-VNI values: All BGWs:Vrf101→10101, Vrf102→10102(cross-DC L3VNI)vlan_bindings:[11, 12, 13, 14, 15, 101]for Vrf101 and[16, 17, 18, 19, 20, 102]for Vrf102rate_percentupdated from0.001to0.1for bothl2l3andbumtraffic parameterstest_vxlan_dci.py:ENABLE_L3_ACROSS_DCIflag changed fromFalse→True(line 1048) to enable cross-DC L3 stream generation intgen_preconfigtgen_preconfig()L3 traffic generation refactored to split within-DC and cross-DC into separate streams: within-DC uses genericfind_l3_traffic_endpoints+ filtering, cross-DC uses newfind_l3_dci_traffic_endpointswith 23 specific flowsL3-SH-WITHIN(orphan sources) andL3-MH-WITHIN(PortChannel sources); Cross-DC:L3-SH-CROSS(orphan sources) andL3-MH-CROSS(PortChannel sources)stream_handles['l3_v4']andstream_handles['l3_v6']are now lists (accumulating within-SH, within-MH, cross-SH, and cross-MH streams) instead of single traffic item returnsdci_flap_continuousstream creation intgen_preconfig— continuous cross-DC L2 IPv4/IPv6 streams (SH + MH per VLAN) withtransmit_mode='continuous'for DCI link flap/shut tests_dci_merge_flap_continuous()helper to merge created stream handles intostream_handles['dci_flap_continuous']dict_flatten_stream_idsand stream summary to handledci_flap_continuoustypeconfig_l2l3vni()now filters out BGW nodes ('bgw' not in n) before applying leaf-specific configuration. BGW nodes are configured separately viaconfig_bgw_nodes().config_l2l3vni()updated to apply leaf VRF route-target imports from local BGWs (l3vni_leaf_rt_dci) afterbgp_l3vni_config_dciunconfig_l2l3vni()also filters BGW nodes and removes leaf RT imports (delete_l3vni_leaf_rt_dci) beforedelete_bgp_l3vni_config_dciconfig_bgw_nodes()now retrieves and passesbgp_infoto route-map and L3VNI configurationunconfig_bgw_nodes()updated to remove L3VNI BGW config in reverse orderpretestfixture verifies remote VTEPs on all nodes (including BGW nodes)verify_base_setup_bgw()enhanced with six new checks for L3VNI verification and Type-5 CLI fetch consolidationverify_traffic()enhanced withsimultaneous=Falseparameter for dual-stack testsTestVxlanDCIBase(L3VNI_dci:1-2, 6-30)verify_base_setup_bgwandTestVxlanDCIBase):TestVxlanRestartTriggers,TestVxlanReloadTriggers,TestVxlanBGPTriggers,TestVxlanInterfaceTriggers,TestVxlanAddRemoveVlanALL_CHECKSupdated: removedrib_fib(integrated intoevpn_type5_comprehensive), updated docstring for unified Type-5 modelvxlan_helper.py:find_l3_traffic_endpoints(host_info_dict, config_dict): Enhanced to generate both SH (orphan P1) and MH (PortChannel) source flows for within-DC L3 trafficfind_l3_dci_traffic_endpoints(host_info_dict, config_dict, vrf_vlan_dict=None): New function to generate exactly 23 L3 DCI cross-DC traffic flowsget_dci_link_interfaces(dut, test_cfg): New helper to retrieve DCI-facing link interfaces on BGW nodesget_evpn_vni(dut): Fixed to usest.show(dut, cmd, type='vtysh', skip_tmpl=True)instead ofconfig_dut()_verify_type5_leaf()and_verify_type5_bgw()— replaced with unified_verify_type5_unified()_verify_type5_unified(): Single verification function using 10 boolean checks on both leaf and BGW nodes (present, has_best, has_rt, has_et, has_rmac, has_ipv6_nh, installed_in_rib, installed_in_fib, has_local_class_path, has_remote_class_path)verify_evpn_type5_comprehensive(): Refactored to fetch RIB per-VRF and call unified function; RIB/FIB check now inlineverify_evpn_type5_rib_fib()— RIB/FIB now integrated into comprehensive checkget_expected_type5_routes(): Unified model for both node types — emitslocal_leaf_asnsandremote_bgw_asnsfor all entries (leaf nodes get emptyremote_bgw_asnsset to makehas_remote_class_pathn/a)verify_type5_route_presence_dci(): Updated to use boolean checks only (removed path count range validation)Configuration Context Used:
Per
l3vni_config_diff.txtandvxlan_dci_input_file.yaml:65102:10101,65103:10101)l3vni_dci_traffic_flows.txtReviewer start: Begin with the unified Type-5 verification model in
vxlan_helper.py(_verify_type5_unified,verify_evpn_type5_comprehensive,get_expected_type5_routes), then review the removal ofrib_fibcheck fromtest_vxlan_dci.py(verify_base_setup_bgw), then review the continuous traffic integration inTestVxlanInterfaceTriggers(parametrized methods + helper methods), then review thedci_flap_continuousstream creation intgen_preconfig, then review the modular verification infrastructure inverify_base_setup_bgw(), then review the twenty-five L3VNI test methods, then review the other four trigger test classes, then examine the L3VNI config application, then review the DCI traffic endpoint generation, and finally review the remaining helper functions.Updates since last revision
Leaf Type-5 Self-Originated Route Fix (commit d4f6f08) — per reviewer comment #4151592506:
Fixed
has_local_class_pathverification failure on single-leaf DCs (e.g., DC3 with only leaf0_dc3):Problem: On leaf0_dc3 (ASN 65206, only leaf in DC3), ALL 20 Type-5 prefixes failed
has_local_class_pathcheck. All routes are self-originated with weight=32768 and empty AS path (?). The local_class check was looking for ASN 65206 in the AS path, but self-originated routes don't include the originator's own ASN in the AS path.Fix: In
_verify_type5_unified(), self-originated paths (weight=32768 + empty AS path) now count as local-class:Rationale: The originating leaf IS a local-class source even though its own ASN doesn't appear in the AS path. This fix handles single-leaf DCs where ALL routes are self-originated, while multi-leaf DCs (DC1 with 4 leafs) continue to match on peer leaf ASNs in AS path as before.
Docstring update:
has_local_class_pathdescription now reads: "path from local-DC source (leaf ASN in AS path, or self-originated: weight 32768 + empty AS path)"Leaf Type-5 Verification Fix (commit 3607c39) — per reviewer comment #4151292985:
Fixed two leaf Type-5 verification failures identified in lab testing (
type5_not_working.txt):1.
has_remote_class_pathnow n/a on leaf nodes:get_expected_type5_routes()to setremote_bgw_asns = set()for leaf nodes, makinghas_remote_class_pathcheck n/a instead of requiredyes.2.
installed_in_fibnow accepts connected routes:C>* 80.11.0.0/24 is directly connected, Vlan11) in RIB, not BGP routes (B>*). Old FIB regexr'B[*>]+.*prefix'only matched BGP routes.r'[A-Z]\S*>\S*\s+prefix'to accept any protocol code with>(FIB-selected) flag. Now correctly matches both:C>* 80.11.0.0/24— locally owned subnet (connected)B>* 80.12.0.40/32— remote learned route (BGP)Leaf verification logic after fix:
C>*connected orB>*BGP) / n/a (IPv6)BGW verification logic unchanged —
has_remote_class_pathstill required (other-DC BGW ASNs visible in paths), FIB regex also protocol-agnostic for safety.Pre-Trigger Traffic Verification Removal (commit c026de7) — per reviewer comment #4151220809:
Removed all pre-trigger
verify_traffic()calls from the three trigger test classes per vallabh78's feedback: "lets remove verify_traffic before the trigger... we need to verify the traffic only after the trigger."Changes across 7 test methods:
TestVxlanRestartTriggers:
test_leaf_restart_process— removed Step 2 pre-trigger traffic verification (lines 2825-2835), renumbered subsequent steps (Step 3→2, Step 4→3, etc.)test_dci_restart_process— removed Step 2 pre-trigger cross-DC traffic verification (lines 2956-2965), renumbered subsequent stepsTestVxlanReloadTriggers:
test_config_reload— removed Step 2 pre-trigger traffic verification (lines 3119-3129), updated docstring from 9 steps to 8 stepstest_reboot— removed Step 2 pre-trigger traffic verification, updated docstring from 11 steps to 10 steps, renumbered (Step 3→2, Step 4→3, ..., Step 8→7)test_power_cycle— removed Step 3 pre-trigger traffic verification, updated docstring from 12 steps to 11 steps, renumbered (Step 4→3, Step 5→4, ..., Step 12→11)TestVxlanBGPTriggers:
test_bgp_hard_reset— removed Step 1b pre-trigger traffic verification block with try/except (lines 3646-3661), updated docstring from 7 steps to 6 stepstest_bgp_soft_reset— removed Step 1b pre-trigger traffic verification block, updated docstring from 7 steps to 6 steps, renumbered subsequent stepsRationale: Pre-trigger traffic verification is redundant with base setup verification. Post-trigger traffic verification is sufficient to confirm system recovery after the trigger action.
Net change: −207 lines, +107 lines
Unified Type-5 Verification Model (commit 3af1bee) — per reviewer comment #4150763753:
Replaced separate
_verify_type5_leaf()and_verify_type5_bgw()with unified_verify_type5_unified()using the same 10 boolean checks for every prefix on both leaf and BGW nodes:presenthas_besthas_rthas_ethas_rmachas_ipv6_nhinstalled_in_ribshow ip route vrf(IPv4 only, n/a for IPv6)installed_in_fib>FIB-selected flag in RIB (any protocol:C>*,B>*, etc.; IPv4 only)has_local_class_pathhas_remote_class_pathPass = all required booleans are
yes(orn/aif not applicable).Removed strict checks (all five):
best_nh_is_local_vtepbest_weight_32768best_path_is_local_leafexact path_count == Nexact RD matchingAdditional changes:
verify_evpn_type5_rib_fib()removed as standalone — RIB/FIB is now part ofevpn_type5_comprehensive(fetchesshow ip route vrfper-VRF and checks inline)get_expected_type5_routes()simplified — both leaf and BGW entries carrylocal_leaf_asnsandremote_bgw_asns(leaf remote = empty set; BGW remote = other-DC BGW ASNs)verify_type5_route_presence_dci()updated to use boolean checks only (no path count range)rib_fibremoved fromALL_CHECKS/CHECK_SETSinverify_base_setup_bgw()since it's now part ofevpn_type5_comprehensiveType-5 CLI Dump Consolidation (commit 71fdb18) — per reviewer comment #4145122013:
Eliminated duplicate Type-5 route output in logs when both
rt_rewriteandevpn_type5_comprehensivechecks run on the same BGW node:verify_base_setup_bgw()now fetchesshow bgp l2vpn evpn route type prefixonce per node when either check is neededcli_output=kwarg to bothverify_rt_rewrite_dci(dut, cli_output=...)andverify_evpn_type5_comprehensive(dut, exp_routes, cli_output=...)cli_outputparameter — if provided they skip CLI fetch, if not they fetch it themselves (backward compatible for standalone calls)Continuous Traffic Integration (commit 1d54ee3) — per reviewer comment #4145673910:
Integrated vallabh78's continuous traffic functionality into
TestVxlanInterfaceTriggersclass: 1.dci_flap_continuousstream creation intgen_preconfig(lines 1410-1492): Creates continuous cross-DC L2 IPv4/IPv6 streams (SH + MH per VLAN) withtransmit_mode='continuous'; used by parametrizedtest_dci_link_triggermethod viatgen_handles.get('dci_flap_continuous')2. Updated
_flatten_stream_idsand stream summary loop to handledci_flap_continuousin traffic types list3. Replaced
TestVxlanInterfaceTriggersclass with parametrized version (reduced from 740 lines to ~520 lines): Newtest_leaf_interface_shut_noshutparametrized byleaf_port_kind(orphan/portchannel) for Solution_dci:23/24; Consolidated 5 separate DCI link test methods into singletest_dci_link_triggerparametrized byaction(flap/shut) andscope(single/all_one_bgw/all_bgws) for Solution_dci:26-30 / L3VNI_dci:39-43 with continuous traffic verificationBGW Type-5 Path Count Fix (commit 9c6bcf0) — validated against reviewer's lab output file:
Fixed BGW Type-5 route path count calculation in
get_expected_type5_routes():Root cause: Each remote BGW re-originates routes from ALL leaves in its DC under separate RDs. The old formula
local_leaf_count + remote_bgw_countonly counted the number of remote BGW nodes, not the total paths each BGW carries.Fix: Changed to per-DC multiplication model:
Updated expected path counts:
Validation: Tested against real lab output (
type5_verification_fix.txt, 1783 lines) showing all 20 prefixes on spine3_dc1_bgw2 have exactly 9 paths. Parser correctly handles*=(ECMP multipath) markers, RT/ET/RMAC attributes, IPv4/IPv6 next-hops, and best path detection.BGW Path Count Range Check (commit cba8e10) — validated against two new reviewer lab files:
Refined BGW path count from exact match to range-based
[min..max]comparison after analyzing two new lab output files:Issue discovered: Different test sessions showed different path counts for the same topology: -
type5_verification_fix.txt: spine3_dc1_bgw2 shows 9 paths per prefix (all-leaf re-origination)evpn_type_5_output.txt: spine2_dc1_bgw1 shows 7 paths per prefix (best-only re-origination)Both are valid EVPN behaviors depending on BGW re-origination configuration. Exact match
actual != expectedwould fail one scenario or the other.Solution: Range-based path count model:
local_leaf_count + remote_bgw_count(each remote BGW sends best-only path per prefix)local_leaf_count + SUM(bgws × leaves per remote DC)(each remote BGW re-originates all leaf paths)Updated path count ranges:
Changes in three functions:
get_expected_type5_routes(): emitspath_count_min/path_count_maxinstead of singlepath_count_verify_type5_bgw(): range-based comparison — displays[min..max]string in comparison table when actual count is in range, raw number when out of rangeverify_type5_route_presence_dci(): range-based comparisonpc_min <= actual <= pc_maxValidation: Tested parser against both lab files:
add_route_type5_v2.txt: 21 prefixes parsed across 3 nodes (leaf1_dc2, spine2_dc1_bgw1, leaf0_dc1), all attributes extracted correctlyevpn_type_5_output.txt: 20 prefixes parsed with log-prefix stripping, all showing 7 paths (within expected range [7..9])NOTE: This range-based path count model has been replaced by the unified boolean model (commit 3af1bee) which removes exact path count checks entirely.
Type of change
Back port request
Approach
What is the motivation for this PR?
Add comprehensive L3VNI cross-DC test coverage to the VXLAN DCI test suite, including control plane verification (Type-5 routes with unified boolean-based validation differentiated for leaf vs BGW nodes, VRF-VNI bindings, RT-REWRITE route-maps, eBGP multihop sessions, integrated RIB/FIB install verification) and data plane verification (L3 inter-VLAN routing across DCs with both SH and MH sources). Implement trigger test classes for service restart, config reload, reboot, BGP session reset, DCI link operations, and VLAN/PortChannel operations with L3VNI traffic recovery verification. Optimize test execution by removing duplicate verification steps and consolidating Type-5 CLI dumps. Integrate continuous traffic functionality for DCI link flap/shut tests to verify traffic resilience during interface changes. Streamline trigger tests by removing redundant pre-trigger traffic verification. Fix leaf Type-5 verification to handle connected routes, remove invalid
has_remote_class_pathrequirement, and treat self-originated routes as local-class paths for single-leaf DCs.How did you do it?
verify_base_setup_bgw()with 6 new L3VNI-specific checks and Type-5 CLI consolidationhas_remote_class_pathis n/a on leaf nodes (leaves don't see BGW ASNs in EVPN Type-5 AS paths);has_local_class_pathcounts self-originated routes (weight 32768 + empty AS path) for single-leaf DCs; FIB regex protocol-agnostic to accept connected routes (C>*) for locally owned subnetsverify_evpn_type5_rib_fib()andrib_fibcheck list item)config_bgw_nodes()perl3vni_config_diff.txtconfig_l2l3vni()l3vni_dci_traffic_flows.txtget_dci_link_interfaces()helper to retrieve DCI-facing interfaces from topology configsimultaneous=Trueparameter to dual-stack teststraffic_namesfilterverify_base_setup_bgw()to avoid duplicate outputdci_flap_continuousstream creation intgen_preconfig, replacedTestVxlanInterfaceTriggerswith parametrized versionHow did you verify/test it?
Code review only. Changes implement L3VNI configuration and verification logic per reference configuration files (
l3vni_config_diff.txt,vxlan_dci_input_file.yaml). Test execution requires physical testbed with 3-DC VXLAN DCI topology (9 nodes: 7 leafs + 2 spines + 5 BGWs) and IXIA traffic generator.Manual verification performed:
fix_type5_verification.txt,add_route_type5_v2.txt,evpn_type_5_output.txt)type5_verification_fix.txt(1783 lines, 9 paths),evpn_type_5_output.txt(656 lines, 7 paths), both within expected range [7..9]*,*=,*>) handled, IPv4/IPv6 next-hops detectedtype5_not_working.txtshows both failures (has_remote_class_path,installed_in_fib) correctly diagnosed and fixedcli_outputkwarg and fall back to CLI fetch if not providedAny platform specific information?
Requires SONiC with:
Supported testbed topology if it's a new test case?
3-datacenter EVPN-VXLAN DCI topology:
Documentation
Test plan: DCI_Solution_Testplan.xlsx (L3VNI_Testcases sheet)
Reference config: l3vni_config_diff.txt (685 lines, 5 BGW sections)
Traffic flows: l3vni_dci_traffic_flows.txt (23 specific L3 DCI flows)
Human Review Checklist
CRITICAL — Self-Originated Route Detection:
elifplacement doesn't miss edge cases — the self-originated check is anelifafter ASN match check. If a path has weight 32768 AND a non-empty AS path (unlikely but theoretically possible), it would NOT match. Verify this is the intended behavior.CRITICAL — Leaf Type-5 Fix:
[A-Z]\S*>\S*\s+doesn't match false positives — should only match route lines with>(FIB-selected) flag; test against various FRR output formatshas_remote_class_pathis correctly n/a — confirm leaves don't see BGW ASNs in EVPN Type-5 AS paths even after BGW re-originationtype5_not_working.txtandleaf0_dc3_type5.txt; BGW Type-5 verification logic unchanged but may have undiscovered issuesCRITICAL — Unified Type-5 Model:
compare_exp_actual_data()handles 'n/a' values correctly — RIB/FIB checks use 'n/a' for IPv6 prefixes,has_remote_class_pathuses 'n/a' for leaf nodes_parse_type5_routes_detailed()_parse_type5_routes_detailed()populates all required fields — must includert,et,rmac,next_hop,as_path,weightfor boolean checks to workget_expected_type5_routes()ASN collection logic —local_leaf_asns,local_bgw_asns,remote_bgw_asnsmust be correctly populated for path classification_verify_type5_leaf(),_verify_type5_bgw(),verify_evpn_type5_rib_fib()should have zero referencesverify_type5_route_presence_dci()works on both leaf and BGW — uses same boolean checks as unified modelverify_evpn_type5_comprehensive()fetchesshow ip route vrf Xfor each VRF in exp_routesPre-Trigger Traffic Removal:
Traffic and Configuration:
test_dci_link_trigger— whenscope="all_bgws", traffic is expected to FAIL while shut (negative test), verify this is correctly implemented_flatten_stream_idscorrectly handlesdci_flap_continuous— dict type (like l3_v4/l3_v6) vs list type (like bum_SH/bum_MH)find_l3_traffic_endpoints()tgen_preconfig()correctly filters endpointsst.show(dut, cmd, type='vtysh', skip_tmpl=True)returns raw text outputget_dci_link_interfaces()lookup logicverify_base_setup_bgw()with correct node filterstest_base_dci_bringupruns firststream_idvalues are unique acrossl3_v4andl3_v6mode='traffic_item'traffic_namescorrectly filter streamstype5_cli_outputremains validcli_outputkwarg handling in helper functionstest_cfg['testcases']dict contains entries for hardcoded tc_ids —test_leaf_interface_shut_noshutreferences "test_portchannel_shut_noshut" and "test_host_interface_shut_noshut_orphan" which must exist in test configtest_cfgstructure includes required keys —_get_leaf_portchannels_by_dcaccessestest_cfg.get(dut, {}).get('port_channels'),_get_bgw_dci_interfacesaccessestest_cfg['nodes'].get('dc1_bgw')etc.