Skip to content

Commit

Permalink
Merge branch 'devel' into add_bgp_additional_paths_bgp_root_new_model
Browse files Browse the repository at this point in the history
  • Loading branch information
ClausHolbechArista authored Sep 30, 2024
2 parents ccb31f8 + 827961c commit 60f3edb
Show file tree
Hide file tree
Showing 5 changed files with 337 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
!
hostname only-connected-endpoints
!
interface Port-Channel1
description SERVER_TEST_SERVER_01
no shutdown
switchport trunk native vlan 1000
switchport trunk allowed vlan 1-100
switchport mode trunk
switchport
!
interface Ethernet1
description SERVER_TEST_SERVER_01_Nic1
no shutdown
channel-group 1 mode active
!
interface Ethernet2
description SERVER_TEST_SERVER_01_Nic2
no shutdown
channel-group 1 mode active
!
interface Ethernet12
description SERVER_TEST_SERVER_01_Nic1
no shutdown
switchport trunk native vlan 1000
switchport trunk allowed vlan 1-100
switchport mode trunk
switchport
!
interface Ethernet20
description Network Port
no shutdown
switchport trunk native vlan 1000
switchport trunk allowed vlan 1-100
switchport mode trunk
switchport
!
interface Ethernet21
description Network Port
no shutdown
switchport trunk native vlan 1000
switchport trunk allowed vlan 1-100
switchport mode trunk
switchport
!
interface Ethernet22
description Network Port
no shutdown
switchport trunk native vlan 1000
switchport trunk allowed vlan 1-100
switchport mode trunk
switchport
!
interface Ethernet23
description Network Port
no shutdown
switchport trunk native vlan 1000
switchport trunk allowed vlan 1-100
switchport mode trunk
switchport
!
interface Ethernet24
description Network Port
no shutdown
switchport trunk native vlan 1000
switchport trunk allowed vlan 1-100
switchport mode trunk
switchport
!
interface Ethernet25
description Network Port
no shutdown
switchport trunk native vlan 1000
switchport trunk allowed vlan 1-100
switchport mode trunk
switchport
!
interface Ethernet26
description Network Port
no shutdown
switchport trunk native vlan 1000
switchport trunk allowed vlan 1-100
switchport mode trunk
switchport
!
interface Ethernet27
description Network Port
no shutdown
switchport trunk native vlan 1000
switchport trunk allowed vlan 1-100
switchport mode trunk
switchport
!
interface Ethernet28
description Network Port
no shutdown
switchport trunk native vlan 1000
switchport trunk allowed vlan 1-100
switchport mode trunk
switchport
!
interface Ethernet29
description Network Port
no shutdown
switchport trunk native vlan 1000
switchport trunk allowed vlan 1-100
switchport mode trunk
switchport
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
hostname: only-connected-endpoints
is_deployed: null
service_routing_protocols_model: null
vlan_internal_order: null
aaa_root: null
config_end: null
enable_password: null
transceiver_qsfp_default_mode_4x10: null
spanning_tree: null
vrfs: null
management_api_http: null
ethernet_interfaces:
- name: Ethernet20
peer: Network Port
peer_type: network_port
port_profile: MY_PROFILE
description: Network Port
shutdown: false
switchport:
enabled: true
mode: trunk
trunk:
allowed_vlan: 1-100
native_vlan: 1000
- name: Ethernet21
peer: Network Port
peer_type: network_port
port_profile: MY_PROFILE
description: Network Port
shutdown: false
switchport:
enabled: true
mode: trunk
trunk:
allowed_vlan: 1-100
native_vlan: 1000
- name: Ethernet22
peer: Network Port
peer_type: network_port
port_profile: MY_PROFILE
description: Network Port
shutdown: false
switchport:
enabled: true
mode: trunk
trunk:
allowed_vlan: 1-100
native_vlan: 1000
- name: Ethernet23
peer: Network Port
peer_type: network_port
port_profile: MY_PROFILE
description: Network Port
shutdown: false
switchport:
enabled: true
mode: trunk
trunk:
allowed_vlan: 1-100
native_vlan: 1000
- name: Ethernet24
peer: Network Port
peer_type: network_port
port_profile: MY_PROFILE
description: Network Port
shutdown: false
switchport:
enabled: true
mode: trunk
trunk:
allowed_vlan: 1-100
native_vlan: 1000
- name: Ethernet25
peer: Network Port
peer_type: network_port
port_profile: MY_PROFILE
description: Network Port
shutdown: false
switchport:
enabled: true
mode: trunk
trunk:
allowed_vlan: 1-100
native_vlan: 1000
- name: Ethernet26
peer: Network Port
peer_type: network_port
port_profile: MY_PROFILE
description: Network Port
shutdown: false
switchport:
enabled: true
mode: trunk
trunk:
allowed_vlan: 1-100
native_vlan: 1000
- name: Ethernet27
peer: Network Port
peer_type: network_port
port_profile: MY_PROFILE
description: Network Port
shutdown: false
switchport:
enabled: true
mode: trunk
trunk:
allowed_vlan: 1-100
native_vlan: 1000
- name: Ethernet28
peer: Network Port
peer_type: network_port
port_profile: MY_PROFILE
description: Network Port
shutdown: false
switchport:
enabled: true
mode: trunk
trunk:
allowed_vlan: 1-100
native_vlan: 1000
- name: Ethernet29
peer: Network Port
peer_type: network_port
port_profile: MY_PROFILE
description: Network Port
shutdown: false
switchport:
enabled: true
mode: trunk
trunk:
allowed_vlan: 1-100
native_vlan: 1000
- name: Ethernet12
peer: TEST_SERVER_01
peer_interface: Nic1
peer_type: server
port_profile: MY_PROFILE
description: SERVER_TEST_SERVER_01_Nic1
shutdown: false
switchport:
enabled: true
mode: trunk
trunk:
allowed_vlan: 1-100
native_vlan: 1000
- name: Ethernet1
peer: TEST_SERVER_01
peer_interface: Nic1
peer_type: server
port_profile: MY_PROFILE
description: SERVER_TEST_SERVER_01_Nic1
shutdown: false
channel_group:
id: 1
mode: active
- name: Ethernet2
peer: TEST_SERVER_01
peer_interface: Nic2
peer_type: server
port_profile: MY_PROFILE
description: SERVER_TEST_SERVER_01_Nic2
shutdown: false
channel_group:
id: 1
mode: active
port_channel_interfaces:
- name: Port-Channel1
description: SERVER_TEST_SERVER_01
shutdown: false
switchport:
enabled: true
mode: trunk
trunk:
allowed_vlan: 1-100
native_vlan: 1000
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# Minimum config to only generate connected endpoints
node_type_keys:
- key: device
type: device
connected_endpoints: true
underlay_router: false
uplink_type: port-channel

type: device
device:
defaults:
structured_config:
# hostname: null # Hostname is kept to avoid pyavd tests from failing. Uncomment this if you are trying to build connected-endpoints only configs.
is_deployed: null
service_routing_protocols_model: null
vlan_internal_order: null
aaa_root: null
config_end: null
enable_password: null
transceiver_qsfp_default_mode_4x10: null
spanning_tree: null
vrfs: null
management_api_http: null

port_profiles:
- profile: MY_PROFILE
vlans: 1-100
mode: trunk
native_vlan: 1000
enabled: true

servers: # dynamic_key: connected_endpoints
- name: TEST_SERVER_01
adapters:
- switches: [only-connected-endpoints]
switch_ports: [Ethernet12]
endpoint_ports: [Nic1]
profile: MY_PROFILE

- switches: [only-connected-endpoints, only-connected-endpoints]
switch_ports: [Ethernet1, Ethernet2]
endpoint_ports: [Nic1, Nic2]
profile: MY_PROFILE
port_channel:
mode: active

network_ports:
- switches: ["only-connected-endpoints(-something-showing-this-supports-regex)?"]
switch_ports: [Ethernet20-29]
endpoint: Network Port
profile: MY_PROFILE
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ all:
spanning-tree-mode-rapid-pvst:
node-type-l3-interfaces:
ipv4-acls:
only-connected-endpoints:
platform_settings:
varpv6:
OVERRIDE_UPLINK_TYPE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_validate_structured_config_with_invalid_data(hostname: str, structured_

# No dict found, so we insert our own instead
if not updated:
structured_config.update({"bgp_peer_groups": {"invalid_key": "some_value"}})
structured_config.update({"router_bgp": {"invalid_key": "some_value"}})

validation_result = validate_structured_config(structured_config)
assert validation_result.failed is True
Expand Down

0 comments on commit 60f3edb

Please sign in to comment.