[pve-devel] [PATCH pve-network 15/17] test: fabrics: add test cases for ospf and openfabric + evpn
Gabriel Goller
g.goller at proxmox.com
Fri Mar 28 18:13:30 CET 2025
From: Stefan Hanreich <s.hanreich at proxmox.com>
Add two additional test cases for EVPN zones, which use fabrics as the
underlay network - one for OSPF, one for OpenFabric.
They cover a full-mesh fabric setup as well as a simple point-to-point
setup to a route reflector as the underlay fabric.
Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
---
.../expected_controller_config | 72 +++++++++++++++++
.../openfabric_fabric/expected_sdn_interfaces | 56 +++++++++++++
.../zones/evpn/openfabric_fabric/interfaces | 6 ++
.../zones/evpn/openfabric_fabric/sdn_config | 79 +++++++++++++++++++
.../ospf_fabric/expected_controller_config | 66 ++++++++++++++++
.../evpn/ospf_fabric/expected_sdn_interfaces | 53 +++++++++++++
src/test/zones/evpn/ospf_fabric/interfaces | 6 ++
src/test/zones/evpn/ospf_fabric/sdn_config | 75 ++++++++++++++++++
8 files changed, 413 insertions(+)
create mode 100644 src/test/zones/evpn/openfabric_fabric/expected_controller_config
create mode 100644 src/test/zones/evpn/openfabric_fabric/expected_sdn_interfaces
create mode 100644 src/test/zones/evpn/openfabric_fabric/interfaces
create mode 100644 src/test/zones/evpn/openfabric_fabric/sdn_config
create mode 100644 src/test/zones/evpn/ospf_fabric/expected_controller_config
create mode 100644 src/test/zones/evpn/ospf_fabric/expected_sdn_interfaces
create mode 100644 src/test/zones/evpn/ospf_fabric/interfaces
create mode 100644 src/test/zones/evpn/ospf_fabric/sdn_config
diff --git a/src/test/zones/evpn/openfabric_fabric/expected_controller_config b/src/test/zones/evpn/openfabric_fabric/expected_controller_config
new file mode 100644
index 000000000000..264a7c422c11
--- /dev/null
+++ b/src/test/zones/evpn/openfabric_fabric/expected_controller_config
@@ -0,0 +1,72 @@
+frr version 8.5.2
+frr defaults datacenter
+hostname localhost
+log syslog informational
+service integrated-vtysh-config
+!
+!
+vrf vrf_evpn
+ vni 100
+exit-vrf
+!
+router bgp 65000
+ bgp router-id 172.20.3.1
+ no bgp hard-administrative-reset
+ no bgp default ipv4-unicast
+ coalesce-time 1000
+ no bgp graceful-restart notification
+ neighbor VTEP peer-group
+ neighbor VTEP remote-as 65000
+ neighbor VTEP bfd
+ neighbor 172.20.3.2 peer-group VTEP
+ neighbor 172.20.3.3 peer-group VTEP
+ !
+ address-family l2vpn evpn
+ neighbor VTEP activate
+ neighbor VTEP route-map MAP_VTEP_IN in
+ neighbor VTEP route-map MAP_VTEP_OUT out
+ advertise-all-vni
+ exit-address-family
+exit
+!
+router bgp 65000 vrf vrf_evpn
+ bgp router-id 172.20.3.1
+ no bgp hard-administrative-reset
+ no bgp graceful-restart notification
+exit
+!
+route-map MAP_VTEP_IN permit 1
+exit
+!
+route-map MAP_VTEP_OUT permit 1
+exit
+router openfabric test
+ net 49.0001.1720.2000.3001.00
+exit
+!
+interface dummy_test
+ ip router openfabric test
+ openfabric passive
+exit
+!
+interface ens20
+ ip router openfabric test
+ openfabric hello-interval 1
+exit
+!
+interface ens21
+ ip router openfabric test
+ openfabric hello-interval 1
+exit
+!
+access-list openfabric_test_ips permit 172.20.3.0/24
+!
+route-map openfabric permit 100
+ match ip address openfabric_test_ips
+ set src 172.20.3.1
+exit
+!
+ip protocol openfabric route-map openfabric
+!
+line vty
+!
\ No newline at end of file
diff --git a/src/test/zones/evpn/openfabric_fabric/expected_sdn_interfaces b/src/test/zones/evpn/openfabric_fabric/expected_sdn_interfaces
new file mode 100644
index 000000000000..e76e0b9e00d5
--- /dev/null
+++ b/src/test/zones/evpn/openfabric_fabric/expected_sdn_interfaces
@@ -0,0 +1,56 @@
+#version:1
+
+auto vnet0
+iface vnet0
+ address 10.123.123.1/24
+ hwaddress BC:24:11:3B:39:34
+ bridge_ports vxlan_vnet0
+ bridge_stp off
+ bridge_fd 0
+ mtu 1450
+ ip-forward on
+ arp-accept on
+ vrf vrf_evpn
+
+auto vrf_evpn
+iface vrf_evpn
+ vrf-table auto
+ post-up ip route add vrf vrf_evpn unreachable default metric 4278198272
+
+auto vrfbr_evpn
+iface vrfbr_evpn
+ bridge-ports vrfvx_evpn
+ bridge_stp off
+ bridge_fd 0
+ mtu 1450
+ vrf vrf_evpn
+
+auto vrfvx_evpn
+iface vrfvx_evpn
+ vxlan-id 100
+ vxlan-local-tunnelip 172.20.3.1
+ bridge-learning off
+ bridge-arp-nd-suppress on
+ mtu 1450
+
+auto vxlan_vnet0
+iface vxlan_vnet0
+ vxlan-id 123456
+ vxlan-local-tunnelip 172.20.3.1
+ bridge-learning off
+ bridge-arp-nd-suppress on
+ mtu 1450
+
+auto dummy_test
+iface dummy_test inet static
+ link-type dummy
+ ip-forward 1
+ address 172.20.3.1/32
+
+auto ens20
+iface ens20 inet manual
+ ip-forward 1
+
+auto ens21
+iface ens21 inet manual
+ ip-forward 1
diff --git a/src/test/zones/evpn/openfabric_fabric/interfaces b/src/test/zones/evpn/openfabric_fabric/interfaces
new file mode 100644
index 000000000000..1b4384bdd8a3
--- /dev/null
+++ b/src/test/zones/evpn/openfabric_fabric/interfaces
@@ -0,0 +1,6 @@
+auto vmbr0
+iface vmbr0 inet static
+ address 172.20.3.1/32
+ bridge-ports eth0
+ bridge-stp off
+ bridge-fd 0
diff --git a/src/test/zones/evpn/openfabric_fabric/sdn_config b/src/test/zones/evpn/openfabric_fabric/sdn_config
new file mode 100644
index 000000000000..2c32598b6308
--- /dev/null
+++ b/src/test/zones/evpn/openfabric_fabric/sdn_config
@@ -0,0 +1,79 @@
+{
+ 'zones' => {
+ 'ids' => {
+ 'evpn' => {
+ 'type' => 'evpn',
+ 'ipam' => 'pve',
+ 'mac' => 'BC:24:11:3B:39:34',
+ 'controller' => 'ctrl',
+ 'vrf-vxlan' => 100
+ }
+ }
+ },
+ 'vnets' => {
+ 'ids' => {
+ 'vnet0' => {
+ 'zone' => 'evpn',
+ 'type' => 'vnet',
+ 'tag' => 123456
+ }
+ }
+ },
+ 'version' => 1,
+ 'subnets' => {
+ 'ids' => {
+ 'evpn-10.123.123.0-24' => {
+ 'vnet' => 'vnet0',
+ 'type' => 'subnet',
+ 'gateway' => '10.123.123.1'
+ }
+ }
+ },
+ 'controllers' => {
+ 'ids' => {
+ 'ctrl' => {
+ 'peers' => '172.20.3.1,172.20.3.2,172.20.3.3',
+ 'asn' => 65000,
+ 'type' => 'evpn'
+ }
+ }
+ },
+ 'openfabric' => {
+ 'ids' => {
+ 'test' => {
+ 'ty' => 'fabric',
+ 'fabric_id' => 'test',
+ 'hello_interval' => 1,
+ 'loopback_prefix' => '172.20.3.0/24'
+ },
+ 'test_localhost' => {
+ 'interface' => [
+ 'name=ens20',
+ 'name=ens21'
+ ],
+ 'node_id' => 'test_localhost',
+ 'ty' => 'node',
+ 'router_id' => '172.20.3.1'
+ },
+ 'test_pathfinder' => {
+ 'node_id' => 'test_pathfinder',
+ 'interface' => [
+ 'name=ens20',
+ 'name=ens21'
+ ],
+ 'router_id' => '172.20.3.2',
+ 'ty' => 'node'
+ },
+ 'test_raider' => {
+ 'router_id' => '172.20.3.3',
+ 'ty' => 'node',
+ 'interface' => [
+ 'name=ens21',
+ 'name=ens20'
+ ],
+ 'node_id' => 'test_raider'
+ }
+ }
+ }
+ };
+
diff --git a/src/test/zones/evpn/ospf_fabric/expected_controller_config b/src/test/zones/evpn/ospf_fabric/expected_controller_config
new file mode 100644
index 000000000000..75fb1ffa1717
--- /dev/null
+++ b/src/test/zones/evpn/ospf_fabric/expected_controller_config
@@ -0,0 +1,66 @@
+frr version 8.5.2
+frr defaults datacenter
+hostname localhost
+log syslog informational
+service integrated-vtysh-config
+!
+!
+vrf vrf_evpn
+ vni 100
+exit-vrf
+!
+router bgp 65000
+ bgp router-id 172.20.30.1
+ no bgp hard-administrative-reset
+ no bgp default ipv4-unicast
+ coalesce-time 1000
+ no bgp graceful-restart notification
+ neighbor VTEP peer-group
+ neighbor VTEP remote-as 65000
+ neighbor VTEP bfd
+ neighbor 172.20.30.2 peer-group VTEP
+ neighbor 172.20.30.3 peer-group VTEP
+ !
+ address-family l2vpn evpn
+ neighbor VTEP activate
+ neighbor VTEP route-map MAP_VTEP_IN in
+ neighbor VTEP route-map MAP_VTEP_OUT out
+ advertise-all-vni
+ exit-address-family
+exit
+!
+router bgp 65000 vrf vrf_evpn
+ bgp router-id 172.20.30.1
+ no bgp hard-administrative-reset
+ no bgp graceful-restart notification
+exit
+!
+route-map MAP_VTEP_IN permit 1
+exit
+!
+route-map MAP_VTEP_OUT permit 1
+exit
+router ospf
+ ospf router-id 172.20.30.1
+exit
+!
+interface dummy_0
+ ip ospf area 0
+ ip ospf passive
+exit
+!
+interface ens19
+ ip ospf area 0
+exit
+!
+access-list ospf_0_ips permit 172.20.30.0/24
+!
+route-map ospf permit 10
+ match ip address ospf_0_ips
+ set src 172.20.30.1
+exit
+!
+ip protocol ospf route-map ospf
+!
+line vty
+!
\ No newline at end of file
diff --git a/src/test/zones/evpn/ospf_fabric/expected_sdn_interfaces b/src/test/zones/evpn/ospf_fabric/expected_sdn_interfaces
new file mode 100644
index 000000000000..cadf046bc2bf
--- /dev/null
+++ b/src/test/zones/evpn/ospf_fabric/expected_sdn_interfaces
@@ -0,0 +1,53 @@
+#version:1
+
+auto vnet0
+iface vnet0
+ address 10.123.123.1/24
+ hwaddress BC:24:11:3B:39:34
+ bridge_ports vxlan_vnet0
+ bridge_stp off
+ bridge_fd 0
+ mtu 1450
+ ip-forward on
+ arp-accept on
+ vrf vrf_evpn
+
+auto vrf_evpn
+iface vrf_evpn
+ vrf-table auto
+ post-up ip route add vrf vrf_evpn unreachable default metric 4278198272
+
+auto vrfbr_evpn
+iface vrfbr_evpn
+ bridge-ports vrfvx_evpn
+ bridge_stp off
+ bridge_fd 0
+ mtu 1450
+ vrf vrf_evpn
+
+auto vrfvx_evpn
+iface vrfvx_evpn
+ vxlan-id 100
+ vxlan-local-tunnelip 172.20.30.1
+ bridge-learning off
+ bridge-arp-nd-suppress on
+ mtu 1450
+
+auto vxlan_vnet0
+iface vxlan_vnet0
+ vxlan-id 123456
+ vxlan-local-tunnelip 172.20.30.1
+ bridge-learning off
+ bridge-arp-nd-suppress on
+ mtu 1450
+
+auto dummy_0
+iface dummy_0 inet static
+ link-type dummy
+ ip-forward 1
+ address 172.20.30.1/32
+
+auto ens19
+iface ens19 inet static
+ address 172.16.3.10/31
+ ip-forward 1
diff --git a/src/test/zones/evpn/ospf_fabric/interfaces b/src/test/zones/evpn/ospf_fabric/interfaces
new file mode 100644
index 000000000000..79ba9c11bd0a
--- /dev/null
+++ b/src/test/zones/evpn/ospf_fabric/interfaces
@@ -0,0 +1,6 @@
+auto vmbr0
+iface vmbr0 inet static
+ address 172.20.30.1/32
+ bridge-ports eth0
+ bridge-stp off
+ bridge-fd 0
diff --git a/src/test/zones/evpn/ospf_fabric/sdn_config b/src/test/zones/evpn/ospf_fabric/sdn_config
new file mode 100644
index 000000000000..938c088dd43c
--- /dev/null
+++ b/src/test/zones/evpn/ospf_fabric/sdn_config
@@ -0,0 +1,75 @@
+{
+ 'zones' => {
+ 'ids' => {
+ 'evpn' => {
+ 'type' => 'evpn',
+ 'ipam' => 'pve',
+ 'mac' => 'BC:24:11:3B:39:34',
+ 'controller' => 'ctrl',
+ 'vrf-vxlan' => 100
+ }
+ }
+ },
+ 'vnets' => {
+ 'ids' => {
+ 'vnet0' => {
+ 'zone' => 'evpn',
+ 'type' => 'vnet',
+ 'tag' => 123456
+ }
+ }
+ },
+ 'version' => 1,
+ 'subnets' => {
+ 'ids' => {
+ 'evpn-10.123.123.0-24' => {
+ 'vnet' => 'vnet0',
+ 'type' => 'subnet',
+ 'gateway' => '10.123.123.1'
+ }
+ }
+ },
+ 'controllers' => {
+ 'ids' => {
+ 'ctrl' => {
+ 'peers' => '172.20.30.1,172.20.30.2,172.20.30.3',
+ 'asn' => 65000,
+ 'type' => 'evpn'
+ }
+ }
+ },
+ 'ospf' => {
+ 'ids' => {
+ '0_pathfinder' => {
+ 'node_id' => '0_pathfinder',
+ 'interface' => [
+ 'name=ens19,ip=172.16.3.20/31'
+ ],
+ 'router_id' => '172.20.30.2',
+ 'ty' => 'node'
+ },
+ '0' => {
+ 'loopback_prefix' => '172.20.30.0/24',
+ 'area' => '0',
+ 'ty' => 'fabric'
+ },
+ '0_localhost' => {
+ 'node_id' => '0_localhost',
+ 'interface' => [
+ 'name=ens19,passive=false,ip=172.16.3.10/31'
+ ],
+ 'router_id' => '172.20.30.1',
+ 'ty' => 'node'
+ },
+ '0_raider' => {
+ 'ty' => 'node',
+ 'router_id' => '172.20.30.3',
+ 'node_id' => '0_raider',
+ 'interface' => [
+ 'name=ens19,ip=172.16.3.30/31'
+ ]
+ }
+ }
+ }
+ };
+
--
2.39.5
More information about the pve-devel
mailing list