Skip to content

Commit

Permalink
Fix(eos_designs): Inherited structured_config on multiple SVIs. (#3298)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClausHolbechArista authored Oct 25, 2023
1 parent 7dc54ea commit 4f07005
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ vlan 114
vlan 115
name svi_profile_tests_115_description
!
vlan 120
name svi_profile_tests_120_description
!
vlan 121
name svi_profile_tests_121_description
!
vlan 210
name igmp_snooping_enabled_210
!
Expand Down Expand Up @@ -119,6 +125,16 @@ interface Vlan115
vrf svi_profile_tests_vrf
ip address virtual 10.1.15.1/24
!
interface Vlan120
description set from svi_profile struct_config_on_multiple_svis
shutdown
vrf svi_profile_tests_vrf
!
interface Vlan121
description set from svi_profile struct_config_on_multiple_svis
shutdown
vrf svi_profile_tests_vrf
!
interface Vlan210
description igmp_snooping_enabled_210
no shutdown
Expand Down Expand Up @@ -207,6 +223,8 @@ interface Vxlan1
vxlan vlan 113 vni 10113
vxlan vlan 114 vni 10114
vxlan vlan 115 vni 10115
vxlan vlan 120 vni 10120
vxlan vlan 121 vni 10121
vxlan vlan 210 vni 10210
vxlan vlan 211 vni 10211
vxlan vlan 212 vni 10212
Expand Down Expand Up @@ -285,6 +303,16 @@ router bgp 65001
route-target both 10115:10115
redistribute learned
!
vlan 120
rd 192.168.255.1:10120
route-target both 10120:10120
redistribute learned
!
vlan 121
rd 192.168.255.1:10121
route-target both 10121:10121
redistribute learned
!
vlan 210
rd 192.168.255.1:10210
route-target both 10210:10210
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ vlan 114
vlan 115
name svi_profile_tests_115_description
!
vlan 120
name svi_profile_tests_120_description
!
vlan 121
name svi_profile_tests_121_description
!
vlan 210
name igmp_snooping_enabled_210
!
Expand Down Expand Up @@ -119,6 +125,16 @@ interface Vlan115
vrf svi_profile_tests_vrf
ip address virtual 10.1.15.1/24
!
interface Vlan120
description set from svi_profile struct_config_on_multiple_svis
shutdown
vrf svi_profile_tests_vrf
!
interface Vlan121
description set from svi_profile struct_config_on_multiple_svis
shutdown
vrf svi_profile_tests_vrf
!
interface Vlan210
description igmp_snooping_enabled_210
no shutdown
Expand Down Expand Up @@ -207,6 +223,8 @@ interface Vxlan1
vxlan vlan 113 vni 10113
vxlan vlan 114 vni 10114
vxlan vlan 115 vni 10115
vxlan vlan 120 vni 10120
vxlan vlan 121 vni 10121
vxlan vlan 210 vni 10210
vxlan vlan 211 vni 10211
vxlan vlan 212 vni 10212
Expand Down Expand Up @@ -259,7 +277,7 @@ router bgp 65002
rd 192.168.255.1:1
route-target both 1:1
redistribute learned
vlan 110-115,210-212,410-412,510-512
vlan 110-115,120-121,210-212,410-412,510-512
!
address-family evpn
neighbor EVPN-OVERLAY-PEERS activate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ router_bgp:
- 10115:10115
redistribute_routes:
- learned
- id: 120
tenant: svi_profile_tests
rd: 192.168.255.1:10120
route_targets:
both:
- 10120:10120
redistribute_routes:
- learned
- id: 121
tenant: svi_profile_tests
rd: 192.168.255.1:10121
route_targets:
both:
- 10121:10121
redistribute_routes:
- learned
- id: 210
tenant: svi_profile_tests
rd: 192.168.255.1:10210
Expand Down Expand Up @@ -253,6 +269,12 @@ vlans:
- id: 115
name: svi_profile_tests_115_description
tenant: svi_profile_tests
- id: 120
name: svi_profile_tests_120_description
tenant: svi_profile_tests
- id: 121
name: svi_profile_tests_121_description
tenant: svi_profile_tests
- id: 210
name: igmp_snooping_enabled_210
tenant: svi_profile_tests
Expand Down Expand Up @@ -336,6 +358,16 @@ vlan_interfaces:
shutdown: false
ip_address_virtual: 10.1.15.1/24
vrf: svi_profile_tests_vrf
- name: Vlan120
tenant: svi_profile_tests
description: set from svi_profile struct_config_on_multiple_svis
shutdown: true
vrf: svi_profile_tests_vrf
- name: Vlan121
tenant: svi_profile_tests
description: set from svi_profile struct_config_on_multiple_svis
shutdown: true
vrf: svi_profile_tests_vrf
- name: Vlan210
tenant: svi_profile_tests
description: igmp_snooping_enabled_210
Expand Down Expand Up @@ -452,6 +484,10 @@ vxlan_interface:
vni: 10114
- id: 115
vni: 10115
- id: 120
vni: 10120
- id: 121
vni: 10121
- id: 210
vni: 10210
- id: 211
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ router_bgp:
- '1:1'
redistribute_routes:
- learned
vlan: 110-115,210-212,410-412,510-512
vlan: 110-115,120-121,210-212,410-412,510-512
static_routes:
- vrf: MGMT
destination_address_prefix: 0.0.0.0/0
Expand Down Expand Up @@ -141,6 +141,12 @@ vlans:
- id: 115
name: svi_profile_tests_115_description
tenant: svi_profile_tests
- id: 120
name: svi_profile_tests_120_description
tenant: svi_profile_tests
- id: 121
name: svi_profile_tests_121_description
tenant: svi_profile_tests
- id: 210
name: igmp_snooping_enabled_210
tenant: svi_profile_tests
Expand Down Expand Up @@ -224,6 +230,16 @@ vlan_interfaces:
shutdown: false
ip_address_virtual: 10.1.15.1/24
vrf: svi_profile_tests_vrf
- name: Vlan120
tenant: svi_profile_tests
description: set from svi_profile struct_config_on_multiple_svis
shutdown: true
vrf: svi_profile_tests_vrf
- name: Vlan121
tenant: svi_profile_tests
description: set from svi_profile struct_config_on_multiple_svis
shutdown: true
vrf: svi_profile_tests_vrf
- name: Vlan210
tenant: svi_profile_tests
description: igmp_snooping_enabled_210
Expand Down Expand Up @@ -340,6 +356,10 @@ vxlan_interface:
vni: 10114
- id: 115
vni: 10115
- id: 120
vni: 10120
- id: 121
vni: 10121
- id: 210
vni: 10210
- id: 211
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ svi_profiles:
- profile: struct_config_child_profile_4
parent_profile: struct_config_parent_profile_2

- profile: struct_config_on_multiple_svis
structured_config:
description: "set from svi_profile struct_config_on_multiple_svis"

#### ---- Test inheritance of svi igmp_snooping_enabled ----- ###
# Tests logic for network services: ip igmp snooping
# Precedence order:
Expand Down Expand Up @@ -252,6 +256,15 @@ tenants:
ip_address_virtual: 10.1.15.1/24
profile: struct_config_child_profile_4

# Expected results:
# - description: set from svi_profile struct_config_on_multiple_svis
- id: 120
name: svi_profile_tests_120_description
profile: struct_config_on_multiple_svis
- id: 121
name: svi_profile_tests_121_description
profile: struct_config_on_multiple_svis

#### ---- Test inheritance of svi igmp_snooping_enabled ----- ###
# Tests logic for network services: ip igmp snooping
# Expected result for all tests is that igmp snooping is enabled for all VLANs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def _extract_and_apply_struct_cfg_from_list_of_dicts(self, list_of_dicts: list,
continue

struct_cfg = item.pop("struct_cfg")
struct_cfg[primary_key] = item[primary_key]
struct_cfgs.append(struct_cfg)
struct_cfgs.append({primary_key: item[primary_key], **struct_cfg})

return struct_cfgs

Expand Down

0 comments on commit 4f07005

Please sign in to comment.