Skip to content

Add L3VNI DCI MAC move test cases (L3VNI_dci:59,60,62,63)#17

Open
bpar9 wants to merge 2 commits into
masterfrom
devin/1775277219-l3vni-dci-mac-move-tests
Open

Add L3VNI DCI MAC move test cases (L3VNI_dci:59,60,62,63)#17
bpar9 wants to merge 2 commits into
masterfrom
devin/1775277219-l3vni-dci-mac-move-tests

Conversation

@bpar9
Copy link
Copy Markdown
Owner

@bpar9 bpar9 commented Apr 4, 2026

Description of PR

Summary:
Adds four new L3VNI host mobility test cases to TestVxlanDciMacMoveTriggers covering cross-VLAN (L3-routed) MAC move scenarios across a 3-DC EVPN-VXLAN fabric. Tests reuse the existing verify_mac_move_dci() flow directly. A helper function is added to vxlan_helper.py for L3VNI endpoint parameter generation.

Key difference from existing L2 MAC move tests: Traffic source is on VLAN 13 and host is on VLAN 11, both in VRF 101, so traffic is routed via L3VNI rather than bridged via L2VNI.

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Approach

What is the motivation for this PR?

Enable L3VNI_dci:59, L3VNI_dci:60, L3VNI_dci:62, L3VNI_dci:63 from the DCI Solution Testplan, covering L3VNI host mobility with cross-subnet traffic verification.

How did you do it?

vxlan_helper.py:

  • Added get_l3vni_mac_move_params() — generates IP/MAC/gateway parameters for cross-VLAN MAC move tests (host on VLAN 11, source on VLAN 13, VRF 101). Includes VRF-VLAN binding validation against the topology config.

test_vxlan_dci.py:

  • Extended get_stream_handles_dci() in TestVxlanDciMacMoveTriggers with 4 new L3VNI move_dir entries. For L3VNI directions, the method uses cross-VLAN configuration: vlan_id=11 for host/dest device groups and src_vlan_id=13 for traffic source streams.
  • Extended _get_dci_mh_expected_nodes() to handle l3vni_mh_to_mh_across_dc and l3vni_orphan_to_mh_across_dc directions.
  • Added L3VNI bands (50–80) to _dci_mm_host_last_octets() and MAC suffixes (0x17–0x1a) to avoid collisions with existing L2 MAC move tests.
  • Added 8 test methods (4 scenarios × mac+ipv4/mac+ipv6) that each call self.verify_mac_move_dci(tc_id, move_dir, host_type) directly, following the same format as existing tests (Solution_dci:71–96):
Test ID Method Scenario
L3VNI_dci:59 test_dci_mac_move_l3vni_orphan_within_dc_mac_and_ipv{4,6} Orphan→orphan within DC1, src=leaf0_dc2
L3VNI_dci:60 test_dci_mac_move_l3vni_orphan_across_dc_mac_and_ipv{4,6} Orphan→orphan across DC1↔DC2, src=leaf2_dc1
L3VNI_dci:62 test_dci_mac_move_l3vni_orphan_to_mh_across_dc_mac_and_ipv{4,6} Orphan→PortChannel across DC, src=leaf2_dc1
L3VNI_dci:63 test_dci_mac_move_l3vni_mh_to_mh_across_dc_mac_and_ipv{4,6} PortChannel→PortChannel across DC, src=leaf2_dc1

Updates since last revision

Refactored per review feedback to reuse verify_mac_move_dci() directly instead of a separate verify_l3vni_mac_move_dci() method:

  • Removed all L3VNI-specific code previously in TestVxlanDCIBase (7 helper methods, verify_l3vni_mac_move_dci, get_l3vni_stream_handles_dci, 4 test methods, _get_dci_l3vni_mac_move_cfg)
  • Moved L3VNI tests into TestVxlanDciMacMoveTriggers, extending existing infrastructure rather than duplicating it
  • Net change vs. prior revision: +86 / −672 lines (eliminated code duplication)

How did you verify/test it?

  • python3 -m py_compile passes for both files.
  • Not run on testbed — requires DCI topology with IXIA. Structural review only.

⚠️ Items for reviewer attention

  1. Cross-VLAN stream VLAN assignment: For L3VNI directions, src1/src2 raw streams and the kw dict for device-group streams all use src_vlan_id (13) while dest device groups use vlan_id (11). Reviewer should confirm that the dest1/dest2 device group creation paths (which use vlan_id) also correctly pick up VLAN 11 for L3VNI scenarios.

  2. mm_cfg.update(l3_params) key safety: The L3VNI params dict is merged into mm_cfg (from _get_dci_mac_move_cfg()). Verify that keys like host_vlan, src_vlan, etc. don't unintentionally overwrite existing keys needed by downstream logic.

  3. l3vni_orphan_within_dc node assignment: Uses ('leaf0_dc1', 'leaf1_dc1', 'leaf0_dc2', ...) — dest1/dest2 within DC1 but traffic source on leaf0_dc2 (cross-DC). Confirm this matches the intended testplan scenario for L3VNI_dci:59.

  4. Hardcoded node names in move_config (e.g., leaf0_dc1, leaf2_dc1) — matches existing patterns in TestVxlanDciMacMoveTriggers but should be confirmed against the testbed topology.

  5. IP/MAC address range: Host IPs use .51/.52 on VLAN 11 (80.11.0.51/52) and source uses .51 on VLAN 13 (80.13.0.51). MACs use 02:00:00:{04|06}:{0b|0d}:{51|52} scheme. Verify these don't collide with existing SAG host device groups (range 10–30) or other test streams.

Any platform specific information?

DCI topology with 3 datacenters and IXIA traffic generation required.

Supported testbed topology if it's a new test case?

3-DC EVPN-VXLAN DCI topology (DC1: 4 leafs + 2 spines + 2 BGW spines, DC2: 2 leafs + 2 BGW spines, DC3: 1 leaf + 1 BGW spine) with IXIA/IxNetwork TGEN.

Documentation

N/A — test cases follow existing patterns documented in the DCI Solution Testplan.

Link to Devin session: https://cisco-demo.devinenterprise.com/sessions/0b27f9d58262480bb0754f522f75c69d
Requested by: @bpar9

- Add get_l3vni_mac_move_params() helper in vxlan_helper.py for cross-VLAN
  host mobility endpoint generation (VLAN 11 host, VLAN 13 source, VRF 101)
- Add _get_dci_l3vni_mac_move_cfg() config function in test_vxlan_dci.py
- Add verify_l3vni_mac_move_dci() 9-phase MAC move verification method
  reusing the pattern from verify_mac_move_dci for L3VNI routing
- Add get_l3vni_stream_handles_dci() for cross-VLAN IXIA stream creation
- Add 4 test cases in TestVxlanDCIBase:
  - test_base_dci_l3vni_mac_move_within_dc (L3VNI_dci:59)
  - test_base_dci_l3vni_mac_move_across_dci (L3VNI_dci:60)
  - test_base_dci_l3vni_mac_move_orphan_to_mh (L3VNI_dci:62)
  - test_base_dci_l3vni_mac_move_mh_to_mh (L3VNI_dci:63)
@devin-ai-integration
Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vallabh78
Copy link
Copy Markdown

Can we reuse the function verify_mac_move_dci for the testcases 59, 60, 62 and 63? I want to have the same format how existing testcases are written.

- Remove L3VNI-specific methods from TestVxlanDCIBase (verify_l3vni_mac_move_dci,
  get_l3vni_stream_handles_dci, 7 helper methods, 4 test methods)
- Remove _get_dci_l3vni_mac_move_cfg module-level function
- Extend get_stream_handles_dci in TestVxlanDciMacMoveTriggers with L3VNI
  move_dir entries and cross-VLAN support (host VLAN 11, src VLAN 13)
- Extend _get_dci_mh_expected_nodes for L3VNI MH directions
- Add L3VNI bands to _dci_mm_host_last_octets
- Add 8 test methods to TestVxlanDciMacMoveTriggers following existing format:
  L3VNI_dci:59 (within DC), 60 (across DC), 62 (orphan->MH), 63 (MH->MH)
  each with mac+ipv4 and mac+ipv6 variants
@devin-ai-integration
Copy link
Copy Markdown

@vallabh78 Refactored as requested. The L3VNI test cases now reuse verify_mac_move_dci() directly in TestVxlanDciMacMoveTriggers, following the same format as existing tests (e.g., Solution_dci:71–96).

What changed:

  • Removed all L3VNI-specific code from TestVxlanDCIBase (verify_l3vni_mac_move_dci, 7 helper methods, get_l3vni_stream_handles_dci, 4 test methods, _get_dci_l3vni_mac_move_cfg) — net -672 lines
  • Extended get_stream_handles_dci() with 4 L3VNI move_dir entries and cross-VLAN support (host VLAN 11, src VLAN 13)
  • Added 8 test methods in TestVxlanDciMacMoveTriggers that each call self.verify_mac_move_dci(tc_id, move_dir, host_type) directly — same pattern as existing tests

Example (compare with test_dci_mac_move_orphan_within_dc_mac_and_ipv4):

def test_dci_mac_move_l3vni_orphan_within_dc_mac_and_ipv4(self):
    """Verify L3VNI mac move between orphan ports mac+ipv4 within DC (L3VNI_dci:59)."""
    tc_id = "mac+ipv4 L3VNI move between orphan ports within DC"
    result = self.verify_mac_move_dci(tc_id, "l3vni_orphan_within_dc", "mac+ipv4")
    report_result(result, tc_id)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants