From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id B4B0A1FF15C
	for <inbox@lore.proxmox.com>; Fri,  4 Apr 2025 18:40:22 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 089A61901;
	Fri,  4 Apr 2025 18:39:26 +0200 (CEST)
From: Gabriel Goller <g.goller@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Fri,  4 Apr 2025 18:28:54 +0200
Message-Id: <20250404162908.563060-44-g.goller@proxmox.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20250404162908.563060-1-g.goller@proxmox.com>
References: <20250404162908.563060-1-g.goller@proxmox.com>
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.022 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: [pve-devel] [PATCH pve-network v2 18/19] test: fabrics: add test
 cases for ospf and openfabric + evpn
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

From: Stefan Hanreich <s.hanreich@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@proxmox.com>
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
 .../expected_controller_config                | 72 ++++++++++++++++
 .../openfabric_fabric/expected_sdn_interfaces | 56 ++++++++++++
 .../zones/evpn/openfabric_fabric/interfaces   |  6 ++
 .../zones/evpn/openfabric_fabric/sdn_config   | 85 +++++++++++++++++++
 .../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    | 82 ++++++++++++++++++
 8 files changed, 426 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..f824aeef28ac
--- /dev/null
+++ b/src/test/zones/evpn/openfabric_fabric/sdn_config
@@ -0,0 +1,85 @@
+{
+          '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'
+                                                  }
+                                      }
+                           },
+           'fabrics' => {
+                 'openfabric' => {
+                               'test' => {
+                                           'type' => 'fabric',
+                                           'fabric_id' => 'test',
+                                           'hello_interval' => 1,
+                                           'loopback_prefix' => '172.20.3.0/24',
+                                         },
+                               'test_localhost' => {
+                                                   'interfaces' => [
+                                                                    'name=ens20',
+                                                                    'name=ens21'
+                                                                  ],
+                                                   'id' => 'test_localhost',
+                                                   'node_id' => 'localhost',
+                                                   'fabric_id' => 'test',
+                                                   'type' => 'node',
+                                                   'router_id' => '172.20.3.1',
+                                                 },
+                               'test_pathfinder' => {
+                                                      'id' => 'test_pathfinder',
+                                                      'node_id' => 'pathfinder',
+                                                      'fabric_id' => 'test',
+                                                      'interfaces' => [
+                                                                       'name=ens20',
+                                                                       'name=ens21'
+                                                                     ],
+                                                      'router_id' => '172.20.3.2',
+                                                      'type' => 'node',
+                                                    },
+                               'test_raider' => {
+                                                  'router_id' => '172.20.3.3',
+                                                  'type' => 'node',
+                                                  'interfaces' => [
+                                                                   'name=ens21',
+                                                                   'name=ens20'
+                                                                 ],
+                                                  'id' => 'test_raider',
+                                                  'node_id' => 'raider',
+                                                  'fabric_id' => 'test',
+                                                }
+                                     }
+              }
+        };
+
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..4e8e0c12deda
--- /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_test
+ ip ospf area 0
+ ip ospf passive
+exit
+!
+interface ens19
+ ip ospf area 0
+exit
+!
+access-list ospf_test_ips permit 172.20.30.0/24
+!
+route-map ospf permit 100
+ match ip address ospf_test_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..56cda622f8ba
--- /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_test
+iface dummy_test 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..eb3a50a56960
--- /dev/null
+++ b/src/test/zones/evpn/ospf_fabric/sdn_config
@@ -0,0 +1,82 @@
+{
+          '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'
+                                                  }
+                                      }
+                           },
+           'fabrics' => {
+                  'ospf' => {
+                                 'test_pathfinder' => {
+                                                     'id' => 'test_pathfinder',
+                                                     'fabric_id' => 'test',
+                                                     'node_id' => 'pathfinder',
+                                                     'interfaces' => [
+                                                                      'name=ens19,ip=172.16.3.20/31'
+                                                                    ],
+                                                     'router_id' => '172.20.30.2',
+                                                     'type' => 'node'
+                                                   },
+                                 'test' => {
+                                          'loopback_prefix' => '172.20.30.0/24',
+                                          'area' => '0',
+                                          'type' => 'fabric',
+                                          'fabric_id' => 'test',
+                                        },
+                                 'test_localhost' => {
+                                                  'id' => 'test_localhost',
+                                                  'fabric_id' => 'test',
+                                                  'node_id' => 'localhost',
+                                                  'interfaces' => [
+                                                                   'name=ens19,passive=false,ip=172.16.3.10/31'
+                                                                 ],
+                                                  'router_id' => '172.20.30.1',
+                                                  'type' => 'node'
+                                                },
+                                 'test_raider' => {
+                                                 'type' => 'node',
+                                                 'router_id' => '172.20.30.3',
+                                                 'id' => 'test_raider',
+                                                 'fabric_id' => 'test',
+                                                 'node_id' => 'raider',
+                                                 'interfaces' => [
+                                                                  'name=ens19,ip=172.16.3.30/31'
+                                                                ]
+                                               }
+                            }
+                }
+        };
+
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel