Skip to content

Commit

Permalink
Feat(eos_designs): Uplink p2p vrfs (#3467)
Browse files Browse the repository at this point in the history
Co-authored-by: Claus Holbech <[email protected]>
  • Loading branch information
gmuloc and ClausHolbechArista authored Jan 26, 2024
1 parent bc72f69 commit b685e71
Show file tree
Hide file tree
Showing 73 changed files with 2,334 additions and 518 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ router_bgp:
vrfs:
- name: Common_VRF
router_id: 172.16.110.5
eos_cli: 'comment
Comment created from raw_eos_cli under BGP for VRF Common_VRF
EOF
'
rd: 172.16.110.5:1025
route_targets:
import:
Expand All @@ -145,13 +152,6 @@ router_bgp:
- 1025:1025
redistribute_routes:
- source_protocol: connected
eos_cli: 'comment
Comment created from raw_eos_cli under BGP for VRF Common_VRF
EOF
'
- name: vrf_with_loopbacks_dc1_pod1_only
router_id: 172.16.110.5
rd: 172.16.110.5:1102
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ router_bgp:
vrfs:
- name: Common_VRF
router_id: 172.16.120.3
eos_cli: 'comment
Comment created from raw_eos_cli under BGP for VRF Common_VRF
EOF
'
rd: 172.16.120.3:1025
route_targets:
import:
Expand All @@ -90,13 +97,6 @@ router_bgp:
- 1025:1025
redistribute_routes:
- source_protocol: connected
eos_cli: 'comment
Comment created from raw_eos_cli under BGP for VRF Common_VRF
EOF
'
- name: vrf_with_loopbacks_dc1_pod1_only
router_id: 172.16.120.3
rd: 172.16.120.3:1102
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ router_bgp:
vrfs:
- name: Common_VRF
router_id: 172.16.110.4
eos_cli: 'comment
Comment created from raw_eos_cli under BGP for VRF Common_VRF
EOF
'
rd: 172.16.110.4:1025
route_targets:
import:
Expand All @@ -143,13 +150,6 @@ router_bgp:
- 1025:1025
redistribute_routes:
- source_protocol: connected
eos_cli: 'comment
Comment created from raw_eos_cli under BGP for VRF Common_VRF
EOF
'
- name: vrf_with_loopbacks_dc1_pod1_only
router_id: 172.16.110.4
rd: 172.16.110.4:1102
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ router_bgp:
vrfs:
- name: Common_VRF
router_id: 172.16.210.3
eos_cli: 'comment
Comment created from raw_eos_cli under BGP for VRF Common_VRF
EOF
'
rd: 172.16.210.3:1025
route_targets:
import:
Expand All @@ -108,13 +115,6 @@ router_bgp:
- 1025:1025
redistribute_routes:
- source_protocol: connected
eos_cli: 'comment
Comment created from raw_eos_cli under BGP for VRF Common_VRF
EOF
'
- name: vrf_with_loopbacks_dc1_pod1_only
router_id: 172.16.210.3
rd: 172.16.210.3:1102
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,27 @@
- ansible_failed_result is defined
- ansible_failed_result.msg == expected_error_message

- name: Converge Negative tests for 'eos_designs_facts'
hosts: fabric_p2p_vrfs
connection: local
tasks:
- name: Run failure scenario Test
block:
- name: Trigger Error
ansible.builtin.import_role:
name: arista.avd.eos_designs
rescue:
- name: Error message
run_once: true
ansible.builtin.debug:
var: ansible_failed_result.msg
- name: Assert eos_designs failed with the expected error message
run_once: true
ansible.builtin.assert:
that:
- ansible_failed_result is defined
- ansible_failed_result.msg == expected_error_message

- name: Converge Negative tests for 'eos_designs_structured_config'
hosts: EOS_DESIGNS_FAILURES
gather_facts: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
fabric_name: fabric_p2p_vrfs

default_node_types:
- node_type: not_underlay_router
match_hostnames:
- ".*underlay.*"

node_type_keys:
- key: not_underlay_router
type: not_underlay_router
underlay_router: false
uplink_type: p2p-vrfs

not_underlay_router:
nodes:
- name: invalid-uplink-type-p2p-vrfs-underlay-router-false

expected_error_message: "Unexpected failure during module execution: 'underlay_router' and 'network_services.l3' must be 'true' for the node_type_key when using 'p2p-vrfs' as 'uplink_type'."
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ all:
fabric_wan_role_overlay_routing_protocol:
hosts:
invalid-wan-role-overlay-routing-protocol:
fabric_p2p_vrfs:
hosts:
invalid-uplink-type-p2p-vrfs-underlay-router-false:
EOS_DESIGNS_FAILURES: # Add cases that fail during 'eos_designs_structured_config' phase
hosts:
failure-port-channel:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
!RANCID-CONTENT-TYPE: arista
!
vlan internal order ascending range 1006 1199
!
transceiver qsfp default-mode 4x10G
!
service routing protocols model multi-agent
!
hostname UPLINK_P2P_VRFS_TESTS_L2LEAF1
!
no enable password
no aaa root
!
vlan 66
name TEST-L2VLAN-ATTRACTION
!
vrf instance MGMT
!
interface Port-Channel1
description UPLINK_P2P_VRFS_TESTS_LEAF1_Po51
no shutdown
switchport
switchport trunk allowed vlan 66
switchport mode trunk
!
interface Ethernet1
description UPLINK_P2P_VRFS_TESTS_LEAF1_Ethernet51
no shutdown
channel-group 1 mode active
!
interface Ethernet2
description UPLINK_P2P_VRFS_TESTS_LEAF1_Ethernet52
no shutdown
channel-group 1 mode active
!
interface Ethernet10
no shutdown
switchport
no ip routing vrf MGMT
!
management api http-commands
protocol https
no shutdown
!
vrf MGMT
no shutdown
!
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
!RANCID-CONTENT-TYPE: arista
!
vlan internal order ascending range 1006 1199
!
transceiver qsfp default-mode 4x10G
!
service routing protocols model multi-agent
!
hostname UPLINK_P2P_VRFS_TESTS_LEAF1
!
no enable password
no aaa root
!
vlan 66
name TEST-L2VLAN-ATTRACTION
!
vrf instance IT
!
vrf instance MGMT
!
vrf instance ONLY-ON-L2LEAF
!
vrf instance PROD
!
interface Port-Channel51
description UPLINK_P2P_VRFS_TESTS_L2LEAF1_Po1
no shutdown
switchport
switchport trunk allowed vlan 66
switchport mode trunk
!
interface Ethernet1
description P2P_LINK_TO_UPLINK_P2P_VRFS_TESTS_SPINE1_Ethernet1
no shutdown
mtu 9214
mac security profile TEST
no switchport
ip address 10.42.42.9/31
!
interface Ethernet1.42
description P2P_LINK_TO_UPLINK_P2P_VRFS_TESTS_SPINE1_Ethernet1.42_vrf_PROD
no shutdown
mtu 9214
encapsulation dot1q vlan 42
vrf PROD
ip address 10.42.42.9/31
!
interface Ethernet1.66
description P2P_LINK_TO_UPLINK_P2P_VRFS_TESTS_SPINE1_Ethernet1.66_vrf_ONLY-ON-L2LEAF
no shutdown
mtu 9214
encapsulation dot1q vlan 66
vrf ONLY-ON-L2LEAF
ip address 10.42.42.9/31
!
interface Ethernet2
description P2P_LINK_TO_UPLINK_P2P_VRFS_TESTS_SPINE2_Ethernet2
no shutdown
mtu 9214
mac security profile TEST
no switchport
ip address 10.42.42.11/31
!
interface Ethernet2.42
description P2P_LINK_TO_UPLINK_P2P_VRFS_TESTS_SPINE2_Ethernet2.42_vrf_PROD
no shutdown
mtu 9214
encapsulation dot1q vlan 42
vrf PROD
ip address 10.42.42.11/31
!
interface Ethernet2.100
description P2P_LINK_TO_UPLINK_P2P_VRFS_TESTS_SPINE2_Ethernet2.100_vrf_IT
no shutdown
mtu 9214
encapsulation dot1q vlan 100
vrf IT
ip address 10.42.42.11/31
!
interface Ethernet51
description UPLINK_P2P_VRFS_TESTS_L2LEAF1_Ethernet1
no shutdown
channel-group 51 mode active
!
interface Ethernet52
description UPLINK_P2P_VRFS_TESTS_L2LEAF1_Ethernet2
no shutdown
channel-group 51 mode active
!
interface Loopback0
description Router_ID
no shutdown
ip address 192.168.42.3/32
!
interface Vlan66
description TEST-L2VLAN-ATTRACTION
no shutdown
vrf ONLY-ON-L2LEAF
ip address virtual 172.16.0.1/24
!
ip virtual-router mac-address cafe:cafe:cafe
!
ip routing
ip routing vrf IT
no ip routing vrf MGMT
ip routing vrf ONLY-ON-L2LEAF
ip routing vrf PROD
!
router bgp 65000
router-id 192.168.42.3
maximum-paths 4 ecmp 4
update wait-install
no bgp default ipv4-unicast
neighbor IPv4-UNDERLAY-PEERS peer group
neighbor IPv4-UNDERLAY-PEERS send-community
neighbor IPv4-UNDERLAY-PEERS maximum-routes 12000
neighbor 10.42.42.8 peer group IPv4-UNDERLAY-PEERS
neighbor 10.42.42.8 remote-as 65000
neighbor 10.42.42.8 description UPLINK_P2P_VRFS_TESTS_SPINE1_Ethernet1
neighbor 10.42.42.10 peer group IPv4-UNDERLAY-PEERS
neighbor 10.42.42.10 remote-as 65000
neighbor 10.42.42.10 description UPLINK_P2P_VRFS_TESTS_SPINE2_Ethernet2
redistribute connected
!
address-family ipv4
neighbor IPv4-UNDERLAY-PEERS activate
!
vrf IT
router-id 192.168.42.3
neighbor 10.42.42.10 remote-as 65000
neighbor 10.42.42.10 peer group IPv4-UNDERLAY-PEERS
neighbor 10.42.42.10 description UPLINK_P2P_VRFS_TESTS_SPINE2_Ethernet2.100_vrf_IT
redistribute connected
!
vrf ONLY-ON-L2LEAF
router-id 192.168.42.3
neighbor 10.42.42.8 remote-as 65000
neighbor 10.42.42.8 peer group IPv4-UNDERLAY-PEERS
neighbor 10.42.42.8 description UPLINK_P2P_VRFS_TESTS_SPINE1_Ethernet1.66_vrf_ONLY-ON-L2LEAF
redistribute connected
!
vrf PROD
router-id 192.168.42.3
neighbor 10.42.42.8 remote-as 65000
neighbor 10.42.42.8 peer group IPv4-UNDERLAY-PEERS
neighbor 10.42.42.8 description UPLINK_P2P_VRFS_TESTS_SPINE1_Ethernet1.42_vrf_PROD
neighbor 10.42.42.10 remote-as 65000
neighbor 10.42.42.10 peer group IPv4-UNDERLAY-PEERS
neighbor 10.42.42.10 description UPLINK_P2P_VRFS_TESTS_SPINE2_Ethernet2.42_vrf_PROD
redistribute connected
!
management api http-commands
protocol https
no shutdown
!
vrf MGMT
no shutdown
!
end
Loading

0 comments on commit b685e71

Please sign in to comment.