Skip to content

Commit

Permalink
Refactor(eos_designs): Refactor network_service vxlan_interfaces (#4962)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc authored Feb 7, 2025
1 parent 8539c58 commit 520ec21
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ tenants:
mac_vrf_vni_base: 10000
mac_vrf_id_base: 20000
l2vlans:
- id: 1 # calculated vni would be 10001 (duplicate)
- id: 1 # calculated vni would be 10001 (duplicate)
name: vlan

expected_error_message: >-
Found duplicate objects with conflicting data while generating configuration for VXLAN VNIs for L2VLANs.
{'id': 1, 'name': None, 'vni': 10001} conflicts with {'id': 111, 'name': None, 'vni': 10001}.
Found duplicate objects with conflicting data while generating configuration for VXLAN VNI 10001.
The following items are conflicting: L2VLAN 1 in tenant Tenant_B, SVI 111 in tenant Tenant_A.
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ tenants:
description: "Tenant_A_OP_Zone"
vrf_vni: 10
svis:
- id: '10'
- id: "10"
name: Tenant_A_OP_Zone_1

- name: Tenant_A_WAN_Zone
vrf_id: 1010
l3_interfaces:
- interfaces: [ Ethernet7 ]
ip_addresses: [ 10.10.10.10/24 ]
nodes: [ duplicate-vni-l3-interfaces-in-vxlan-interface ]
- interfaces: [Ethernet7]
ip_addresses: [10.10.10.10/24]
nodes: [duplicate-vni-l3-interfaces-in-vxlan-interface]
mtu: 9000
enabled: true
description: "test"

expected_error_message: >-
Found duplicate objects with conflicting data while generating configuration for VXLAN VNIs for VRFs.
{'id': None, 'name': 'Tenant_A_WAN_Zone', 'vni': 1010} conflicts with {'id': 10, 'name': None, 'vni': 1010}.
Found duplicate objects with conflicting data while generating configuration for VXLAN VNI 1010.
The following items are conflicting: SVI 10 in tenant Tenant_A, VRF Tenant_A_WAN_Zone in tenant Tenant_A.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ tenants:
vrf_id: 9
svis:
# SVI as string
- id: '110'
- id: "110"
name: Tenant_A_OP_Zone_1
# SVI as integer
- id: 111
vni_override: 10110 # 10111 would be the calculated value.
name: Tenant_A_OP_Zone_2

expected_error_message: >-
Found duplicate objects with conflicting data while generating configuration for VXLAN VNIs for SVIs.
{'id': 111, 'name': None, 'vni': 10110} conflicts with {'id': 110, 'name': None, 'vni': 10110}.
Found duplicate objects with conflicting data while generating configuration for VXLAN VNI 10110.
The following items are conflicting: SVI 110 in tenant Tenant_A, SVI 111 in tenant Tenant_A.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ tenants:
mac_vrf_vni_base: 10000
vrfs:
- name: VRF1
# Making VNI the same and ID different
vrf_vni: 1
vrf_id: 1
svis:
- id: 100
Expand All @@ -35,6 +37,8 @@ tenants:
mac_vrf_vni_base: 10000
vrfs:
- name: VRF1
# Making VNI the same and ID different
vrf_vni: 1
# Conflicting setting on VRF so an error will be raised.
vrf_id: 2
svis:
Expand All @@ -46,6 +50,5 @@ tenants:
expected_error_message: >-
Found duplicate objects with conflicting data while generating configuration for BGP VRFs defined under network services.
{'name': 'VRF1', 'rd': '192.168.255.101:1', 'route_targets': {'import': [{'address_family': 'evpn', 'route_targets': ['1:1']}],
'export': [{'address_family': 'evpn', 'route_targets': ['1:1']}]}} conflicts with {'name': 'VRF1', 'rd': '192.168.255.101:2',
'route_targets': {'import': [{'address_family': 'evpn', 'route_targets': ['2:2']}], 'export': [{'address_family': 'evpn',
'route_targets': ['2:2']}]}}.
'export': [{'address_family': 'evpn', 'route_targets': ['1:1']}]}} conflicts with {'name': 'VRF1', 'rd': '192.168.255.101:2', 'route_targets':
{'import': [{'address_family': 'evpn', 'route_targets': ['2:2']}], 'export': [{'address_family': 'evpn', 'route_targets': ['2:2']}]}}.
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ tenants:
ip_address_virtual: 10.0.100.1/24

expected_error_message: >-
Found duplicate objects with conflicting data while generating configuration for VXLAN VNIs for VRFs.
Found duplicate objects with conflicting data while generating configuration for Vrfs.
{'name': 'VRF1', 'vni': 1} conflicts with {'name': 'VRF1', 'vni': 2}.
Loading

0 comments on commit 520ec21

Please sign in to comment.