Add a few tests that should cover most of the options possible in the
bgp and evpn plugin. Also add a tests in combination with isis.

The bgp_ebgp_reverse_order tests the case where the evpn and bgp controller
processing order is reversed (This leads to different configs).

Signed-off-by: Gabriel Goller <[email protected]>
---
 .../evpn/bgp_ebgp/expected_controller_config  | 55 ++++++++++++++
 .../evpn/bgp_ebgp/expected_sdn_interfaces     | 41 ++++++++++
 src/test/zones/evpn/bgp_ebgp/interfaces       |  7 ++
 src/test/zones/evpn/bgp_ebgp/sdn_config       | 49 ++++++++++++
 .../expected_controller_config                | 68 +++++++++++++++++
 .../bgp_ebgp_multihop/expected_sdn_interfaces | 41 ++++++++++
 .../zones/evpn/bgp_ebgp_multihop/interfaces   | 10 +++
 .../zones/evpn/bgp_ebgp_multihop/sdn_config   | 51 +++++++++++++
 .../expected_controller_config                | 53 +++++++++++++
 .../expected_sdn_interfaces                   | 41 ++++++++++
 .../evpn/bgp_ebgp_reverse_order/interfaces    |  7 ++
 .../evpn/bgp_ebgp_reverse_order/sdn_config    | 49 ++++++++++++
 .../bgp_loopback/expected_controller_config   | 66 ++++++++++++++++
 .../evpn/bgp_loopback/expected_sdn_interfaces | 41 ++++++++++
 src/test/zones/evpn/bgp_loopback/interfaces   | 10 +++
 src/test/zones/evpn/bgp_loopback/sdn_config   | 49 ++++++++++++
 .../expected_controller_config                | 56 ++++++++++++++
 .../expected_sdn_interfaces                   | 41 ++++++++++
 .../zones/evpn/bgp_multipath_relax/interfaces |  7 ++
 .../zones/evpn/bgp_multipath_relax/sdn_config | 49 ++++++++++++
 .../expected_controller_config                | 76 +++++++++++++++++++
 .../combined_bgp_isis/expected_sdn_interfaces | 41 ++++++++++
 .../zones/evpn/combined_bgp_isis/interfaces   | 10 +++
 .../zones/evpn/combined_bgp_isis/sdn_config   | 57 ++++++++++++++
 .../evpn/ebgp_only/expected_controller_config | 26 +++++++
 .../evpn/ebgp_only/expected_sdn_interfaces    |  1 +
 src/test/zones/evpn/ebgp_only/interfaces      |  7 ++
 src/test/zones/evpn/ebgp_only/sdn_config      | 19 +++++
 28 files changed, 1028 insertions(+)
 create mode 100644 src/test/zones/evpn/bgp_ebgp/expected_controller_config
 create mode 100644 src/test/zones/evpn/bgp_ebgp/expected_sdn_interfaces
 create mode 100644 src/test/zones/evpn/bgp_ebgp/interfaces
 create mode 100644 src/test/zones/evpn/bgp_ebgp/sdn_config
 create mode 100644 
src/test/zones/evpn/bgp_ebgp_multihop/expected_controller_config
 create mode 100644 
src/test/zones/evpn/bgp_ebgp_multihop/expected_sdn_interfaces
 create mode 100644 src/test/zones/evpn/bgp_ebgp_multihop/interfaces
 create mode 100644 src/test/zones/evpn/bgp_ebgp_multihop/sdn_config
 create mode 100644 
src/test/zones/evpn/bgp_ebgp_reverse_order/expected_controller_config
 create mode 100644 
src/test/zones/evpn/bgp_ebgp_reverse_order/expected_sdn_interfaces
 create mode 100644 src/test/zones/evpn/bgp_ebgp_reverse_order/interfaces
 create mode 100644 src/test/zones/evpn/bgp_ebgp_reverse_order/sdn_config
 create mode 100644 src/test/zones/evpn/bgp_loopback/expected_controller_config
 create mode 100644 src/test/zones/evpn/bgp_loopback/expected_sdn_interfaces
 create mode 100644 src/test/zones/evpn/bgp_loopback/interfaces
 create mode 100644 src/test/zones/evpn/bgp_loopback/sdn_config
 create mode 100644 
src/test/zones/evpn/bgp_multipath_relax/expected_controller_config
 create mode 100644 
src/test/zones/evpn/bgp_multipath_relax/expected_sdn_interfaces
 create mode 100644 src/test/zones/evpn/bgp_multipath_relax/interfaces
 create mode 100644 src/test/zones/evpn/bgp_multipath_relax/sdn_config
 create mode 100644 
src/test/zones/evpn/combined_bgp_isis/expected_controller_config
 create mode 100644 
src/test/zones/evpn/combined_bgp_isis/expected_sdn_interfaces
 create mode 100644 src/test/zones/evpn/combined_bgp_isis/interfaces
 create mode 100644 src/test/zones/evpn/combined_bgp_isis/sdn_config
 create mode 100644 src/test/zones/evpn/ebgp_only/expected_controller_config
 create mode 100644 src/test/zones/evpn/ebgp_only/expected_sdn_interfaces
 create mode 100644 src/test/zones/evpn/ebgp_only/interfaces
 create mode 100644 src/test/zones/evpn/ebgp_only/sdn_config

diff --git a/src/test/zones/evpn/bgp_ebgp/expected_controller_config 
b/src/test/zones/evpn/bgp_ebgp/expected_controller_config
new file mode 100644
index 000000000000..85015dc2e41b
--- /dev/null
+++ b/src/test/zones/evpn/bgp_ebgp/expected_controller_config
@@ -0,0 +1,55 @@
+frr version 10.4.1
+frr defaults datacenter
+hostname localhost
+log syslog informational
+service integrated-vtysh-config
+!
+!
+vrf vrf_myzone
+ vni 1000
+exit-vrf
+!
+router bgp 65000
+ bgp router-id 192.168.0.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 192.168.0.2 peer-group VTEP
+ neighbor 192.168.0.3 peer-group VTEP
+ neighbor BGP peer-group
+ neighbor BGP remote-as external
+ neighbor BGP bfd
+ neighbor 192.168.0.252 peer-group BGP
+ neighbor 192.168.0.253 peer-group BGP
+ !
+ address-family ipv4 unicast
+  neighbor BGP activate
+  neighbor BGP soft-reconfiguration inbound
+ exit-address-family
+ !
+ 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_myzone
+ bgp router-id 192.168.0.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
+!
+line vty
+!
diff --git a/src/test/zones/evpn/bgp_ebgp/expected_sdn_interfaces 
b/src/test/zones/evpn/bgp_ebgp/expected_sdn_interfaces
new file mode 100644
index 000000000000..4cf13e05e688
--- /dev/null
+++ b/src/test/zones/evpn/bgp_ebgp/expected_sdn_interfaces
@@ -0,0 +1,41 @@
+#version:1
+
+auto myvnet
+iface myvnet
+       address 10.0.0.1/24
+       bridge_ports vxlan_myvnet
+       bridge_stp off
+       bridge_fd 0
+       mtu 1450
+       ip-forward on
+       arp-accept on
+       vrf vrf_myzone
+
+auto vrf_myzone
+iface vrf_myzone
+       vrf-table auto
+       post-up ip route add vrf vrf_myzone unreachable default metric 
4278198272
+
+auto vrfbr_myzone
+iface vrfbr_myzone
+       bridge-ports vrfvx_myzone
+       bridge_stp off
+       bridge_fd 0
+       mtu 1450
+       vrf vrf_myzone
+
+auto vrfvx_myzone
+iface vrfvx_myzone
+       vxlan-id 1000
+       vxlan-local-tunnelip 192.168.0.1
+       bridge-learning off
+       bridge-arp-nd-suppress on
+       mtu 1450
+
+auto vxlan_myvnet
+iface vxlan_myvnet
+       vxlan-id 100
+       vxlan-local-tunnelip 192.168.0.1
+       bridge-learning off
+       bridge-arp-nd-suppress on
+       mtu 1450
diff --git a/src/test/zones/evpn/bgp_ebgp/interfaces 
b/src/test/zones/evpn/bgp_ebgp/interfaces
new file mode 100644
index 000000000000..66bb826a44b3
--- /dev/null
+++ b/src/test/zones/evpn/bgp_ebgp/interfaces
@@ -0,0 +1,7 @@
+auto vmbr0
+iface vmbr0 inet static
+       address 192.168.0.1/24
+       gateway 192.168.0.254
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
diff --git a/src/test/zones/evpn/bgp_ebgp/sdn_config 
b/src/test/zones/evpn/bgp_ebgp/sdn_config
new file mode 100644
index 000000000000..0310e32db93c
--- /dev/null
+++ b/src/test/zones/evpn/bgp_ebgp/sdn_config
@@ -0,0 +1,49 @@
+{
+    version => 1,
+    vnets => {
+        ids => {
+            myvnet => {
+                tag => "100",
+                type => "vnet",
+                zone => "myzone",
+            },
+        },
+    },
+
+    zones   => {
+        ids => {
+            myzone => {
+                ipam => "pve",
+                type => "evpn",
+                controller => "evpnctl",
+                'vrf-vxlan' => 1000,
+            },
+        },
+    },
+    controllers  => {
+        ids => {
+            evpnctl => {
+                type => "evpn",
+                'peers' => '192.168.0.1,192.168.0.2,192.168.0.3',
+                asn => "65000",
+            },
+            localhost => {
+                type => "bgp",
+                'peers' => '192.168.0.252,192.168.0.253',
+                ebgp => "1",
+                asn => "65000",
+                node => "localhost",
+            },
+        },
+    },
+
+    subnets => {
+        ids => {
+            'myzone-10.0.0.0-24' => {
+                'type' => 'subnet',
+                'vnet' => 'myvnet',
+                'gateway' => '10.0.0.1',
+            },
+        },
+    },
+}
diff --git a/src/test/zones/evpn/bgp_ebgp_multihop/expected_controller_config 
b/src/test/zones/evpn/bgp_ebgp_multihop/expected_controller_config
new file mode 100644
index 000000000000..77db51ef64f2
--- /dev/null
+++ b/src/test/zones/evpn/bgp_ebgp_multihop/expected_controller_config
@@ -0,0 +1,68 @@
+frr version 10.4.1
+frr defaults datacenter
+hostname localhost
+log syslog informational
+service integrated-vtysh-config
+!
+!
+vrf vrf_myzone
+ vni 1000
+exit-vrf
+!
+router bgp 65000
+ bgp router-id 192.168.0.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 VTEP update-source lo
+ neighbor 192.168.0.2 peer-group VTEP
+ neighbor 192.168.0.3 peer-group VTEP
+ bgp disable-ebgp-connected-route-check
+ neighbor BGP peer-group
+ neighbor BGP remote-as external
+ neighbor BGP bfd
+ neighbor BGP ebgp-multihop 5
+ neighbor 192.168.0.252 peer-group BGP
+ neighbor 192.168.0.253 peer-group BGP
+ !
+ address-family ipv4 unicast
+  network 192.168.0.1/32
+  neighbor BGP activate
+  neighbor BGP soft-reconfiguration inbound
+ exit-address-family
+ !
+ 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_myzone
+ bgp router-id 192.168.0.1
+ no bgp hard-administrative-reset
+ no bgp graceful-restart notification
+exit
+!
+ip prefix-list loopbacks_ips seq 10 permit 0.0.0.0/0 le 32
+!
+route-map MAP_VTEP_IN permit 1
+exit
+!
+route-map MAP_VTEP_OUT permit 1
+exit
+!
+route-map correct_src permit 1
+ match ip address prefix-list loopbacks_ips
+ set src 192.168.0.1
+exit
+!
+ip protocol bgp route-map correct_src
+!
+line vty
+!
diff --git a/src/test/zones/evpn/bgp_ebgp_multihop/expected_sdn_interfaces 
b/src/test/zones/evpn/bgp_ebgp_multihop/expected_sdn_interfaces
new file mode 100644
index 000000000000..4cf13e05e688
--- /dev/null
+++ b/src/test/zones/evpn/bgp_ebgp_multihop/expected_sdn_interfaces
@@ -0,0 +1,41 @@
+#version:1
+
+auto myvnet
+iface myvnet
+       address 10.0.0.1/24
+       bridge_ports vxlan_myvnet
+       bridge_stp off
+       bridge_fd 0
+       mtu 1450
+       ip-forward on
+       arp-accept on
+       vrf vrf_myzone
+
+auto vrf_myzone
+iface vrf_myzone
+       vrf-table auto
+       post-up ip route add vrf vrf_myzone unreachable default metric 
4278198272
+
+auto vrfbr_myzone
+iface vrfbr_myzone
+       bridge-ports vrfvx_myzone
+       bridge_stp off
+       bridge_fd 0
+       mtu 1450
+       vrf vrf_myzone
+
+auto vrfvx_myzone
+iface vrfvx_myzone
+       vxlan-id 1000
+       vxlan-local-tunnelip 192.168.0.1
+       bridge-learning off
+       bridge-arp-nd-suppress on
+       mtu 1450
+
+auto vxlan_myvnet
+iface vxlan_myvnet
+       vxlan-id 100
+       vxlan-local-tunnelip 192.168.0.1
+       bridge-learning off
+       bridge-arp-nd-suppress on
+       mtu 1450
diff --git a/src/test/zones/evpn/bgp_ebgp_multihop/interfaces 
b/src/test/zones/evpn/bgp_ebgp_multihop/interfaces
new file mode 100644
index 000000000000..af15fa4cb516
--- /dev/null
+++ b/src/test/zones/evpn/bgp_ebgp_multihop/interfaces
@@ -0,0 +1,10 @@
+auto lo
+iface lo inet loopback
+
+auto vmbr0
+iface vmbr0 inet static
+       address 192.168.0.1/24
+       gateway 192.168.0.254
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
diff --git a/src/test/zones/evpn/bgp_ebgp_multihop/sdn_config 
b/src/test/zones/evpn/bgp_ebgp_multihop/sdn_config
new file mode 100644
index 000000000000..ff7e038eddcd
--- /dev/null
+++ b/src/test/zones/evpn/bgp_ebgp_multihop/sdn_config
@@ -0,0 +1,51 @@
+{
+    version => 1,
+    vnets => {
+        ids => {
+            myvnet => {
+                tag => "100",
+                type => "vnet",
+                zone => "myzone",
+            },
+        },
+    },
+
+    zones   => {
+        ids => {
+            myzone => {
+                ipam => "pve",
+                type => "evpn",
+                controller => "evpnctl",
+                'vrf-vxlan' => 1000,
+            },
+        },
+    },
+    controllers  => {
+        ids => {
+            evpnctl => {
+                type => "evpn",
+                'peers' => '192.168.0.1,192.168.0.2,192.168.0.3',
+                asn => "65000",
+            },
+            localhost => {
+                type => "bgp",
+                'peers' => '192.168.0.252,192.168.0.253',
+                ebgp => "1",
+                'ebgp-multihop' => '5',
+                loopback => "lo",
+                asn => "65000",
+                node => "localhost",
+            },
+        },
+    },
+
+    subnets => {
+        ids => {
+            'myzone-10.0.0.0-24' => {
+                'type' => 'subnet',
+                'vnet' => 'myvnet',
+                'gateway' => '10.0.0.1',
+            },
+        },
+    },
+}
diff --git 
a/src/test/zones/evpn/bgp_ebgp_reverse_order/expected_controller_config 
b/src/test/zones/evpn/bgp_ebgp_reverse_order/expected_controller_config
new file mode 100644
index 000000000000..42adea515950
--- /dev/null
+++ b/src/test/zones/evpn/bgp_ebgp_reverse_order/expected_controller_config
@@ -0,0 +1,53 @@
+frr version 10.4.1
+frr defaults datacenter
+hostname localhost
+log syslog informational
+service integrated-vtysh-config
+!
+!
+vrf vrf_myzone
+ vni 1000
+exit-vrf
+!
+router bgp 65000
+ bgp router-id 192.168.0.1
+ no bgp default ipv4-unicast
+ coalesce-time 1000
+ neighbor BGP peer-group
+ neighbor BGP remote-as external
+ neighbor BGP bfd
+ neighbor 192.168.0.252 peer-group BGP
+ neighbor 192.168.0.253 peer-group BGP
+ neighbor VTEP peer-group
+ neighbor VTEP remote-as 65000
+ neighbor VTEP bfd
+ neighbor 192.168.0.2 peer-group VTEP
+ neighbor 192.168.0.3 peer-group VTEP
+ !
+ address-family ipv4 unicast
+  neighbor BGP activate
+  neighbor BGP soft-reconfiguration inbound
+ exit-address-family
+ !
+ 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_myzone
+ bgp router-id 192.168.0.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
+!
+line vty
+!
diff --git a/src/test/zones/evpn/bgp_ebgp_reverse_order/expected_sdn_interfaces 
b/src/test/zones/evpn/bgp_ebgp_reverse_order/expected_sdn_interfaces
new file mode 100644
index 000000000000..4cf13e05e688
--- /dev/null
+++ b/src/test/zones/evpn/bgp_ebgp_reverse_order/expected_sdn_interfaces
@@ -0,0 +1,41 @@
+#version:1
+
+auto myvnet
+iface myvnet
+       address 10.0.0.1/24
+       bridge_ports vxlan_myvnet
+       bridge_stp off
+       bridge_fd 0
+       mtu 1450
+       ip-forward on
+       arp-accept on
+       vrf vrf_myzone
+
+auto vrf_myzone
+iface vrf_myzone
+       vrf-table auto
+       post-up ip route add vrf vrf_myzone unreachable default metric 
4278198272
+
+auto vrfbr_myzone
+iface vrfbr_myzone
+       bridge-ports vrfvx_myzone
+       bridge_stp off
+       bridge_fd 0
+       mtu 1450
+       vrf vrf_myzone
+
+auto vrfvx_myzone
+iface vrfvx_myzone
+       vxlan-id 1000
+       vxlan-local-tunnelip 192.168.0.1
+       bridge-learning off
+       bridge-arp-nd-suppress on
+       mtu 1450
+
+auto vxlan_myvnet
+iface vxlan_myvnet
+       vxlan-id 100
+       vxlan-local-tunnelip 192.168.0.1
+       bridge-learning off
+       bridge-arp-nd-suppress on
+       mtu 1450
diff --git a/src/test/zones/evpn/bgp_ebgp_reverse_order/interfaces 
b/src/test/zones/evpn/bgp_ebgp_reverse_order/interfaces
new file mode 100644
index 000000000000..a2393416a399
--- /dev/null
+++ b/src/test/zones/evpn/bgp_ebgp_reverse_order/interfaces
@@ -0,0 +1,7 @@
+auto vmbr0
+iface vmbr0 inet static
+       address 192.168.0.1/24
+       gateway 192.168.0.254
+       bridge-ports eth0
+       bridge-stp off
+       bridge-fd 0
diff --git a/src/test/zones/evpn/bgp_ebgp_reverse_order/sdn_config 
b/src/test/zones/evpn/bgp_ebgp_reverse_order/sdn_config
new file mode 100644
index 000000000000..e0e7ae788a90
--- /dev/null
+++ b/src/test/zones/evpn/bgp_ebgp_reverse_order/sdn_config
@@ -0,0 +1,49 @@
+{
+    version => 1,
+    vnets => {
+        ids => {
+            myvnet => {
+                tag => "100",
+                type => "vnet",
+                zone => "myzone",
+            },
+        },
+    },
+
+    zones   => {
+        ids => {
+            myzone => {
+                ipam => "pve",
+                type => "evpn",
+                controller => "evpnctl",
+                'vrf-vxlan' => 1000,
+            },
+        },
+    },
+    controllers  => {
+        ids => {
+            blocalhost => {
+                type => "bgp",
+                'peers' => '192.168.0.252,192.168.0.253',
+                ebgp => "1",
+                asn => "65000",
+                node => "localhost",
+            },
+            evpnctl => {
+                type => "evpn",
+                'peers' => '192.168.0.1,192.168.0.2,192.168.0.3',
+                asn => "65000",
+            },
+        },
+    },
+
+    subnets => {
+        ids => {
+            'myzone-10.0.0.0-24' => {
+                'type' => 'subnet',
+                'vnet' => 'myvnet',
+                'gateway' => '10.0.0.1',
+            },
+        },
+    },
+}
diff --git a/src/test/zones/evpn/bgp_loopback/expected_controller_config 
b/src/test/zones/evpn/bgp_loopback/expected_controller_config
new file mode 100644
index 000000000000..0a4207b807cb
--- /dev/null
+++ b/src/test/zones/evpn/bgp_loopback/expected_controller_config
@@ -0,0 +1,66 @@
+frr version 10.4.1
+frr defaults datacenter
+hostname localhost
+log syslog informational
+service integrated-vtysh-config
+!
+!
+vrf vrf_myzone
+ vni 1000
+exit-vrf
+!
+router bgp 65000
+ bgp router-id 192.168.0.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 VTEP update-source lo
+ neighbor 192.168.0.2 peer-group VTEP
+ neighbor 192.168.0.3 peer-group VTEP
+ neighbor BGP peer-group
+ neighbor BGP remote-as 65000
+ neighbor BGP bfd
+ neighbor 192.168.0.252 peer-group BGP
+ neighbor 192.168.0.253 peer-group BGP
+ !
+ address-family ipv4 unicast
+  network 192.168.0.1/32
+  neighbor BGP activate
+  neighbor BGP soft-reconfiguration inbound
+ exit-address-family
+ !
+ 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_myzone
+ bgp router-id 192.168.0.1
+ no bgp hard-administrative-reset
+ no bgp graceful-restart notification
+exit
+!
+ip prefix-list loopbacks_ips seq 10 permit 0.0.0.0/0 le 32
+!
+route-map MAP_VTEP_IN permit 1
+exit
+!
+route-map MAP_VTEP_OUT permit 1
+exit
+!
+route-map correct_src permit 1
+ match ip address prefix-list loopbacks_ips
+ set src 192.168.0.1
+exit
+!
+ip protocol bgp route-map correct_src
+!
+line vty
+!
diff --git a/src/test/zones/evpn/bgp_loopback/expected_sdn_interfaces 
b/src/test/zones/evpn/bgp_loopback/expected_sdn_interfaces
new file mode 100644
index 000000000000..4cf13e05e688
--- /dev/null
+++ b/src/test/zones/evpn/bgp_loopback/expected_sdn_interfaces
@@ -0,0 +1,41 @@
+#version:1
+
+auto myvnet
+iface myvnet
+       address 10.0.0.1/24
+       bridge_ports vxlan_myvnet
+       bridge_stp off
+       bridge_fd 0
+       mtu 1450
+       ip-forward on
+       arp-accept on
+       vrf vrf_myzone
+
+auto vrf_myzone
+iface vrf_myzone
+       vrf-table auto
+       post-up ip route add vrf vrf_myzone unreachable default metric 
4278198272
+
+auto vrfbr_myzone
+iface vrfbr_myzone
+       bridge-ports vrfvx_myzone
+       bridge_stp off
+       bridge_fd 0
+       mtu 1450
+       vrf vrf_myzone
+
+auto vrfvx_myzone
+iface vrfvx_myzone
+       vxlan-id 1000
+       vxlan-local-tunnelip 192.168.0.1
+       bridge-learning off
+       bridge-arp-nd-suppress on
+       mtu 1450
+
+auto vxlan_myvnet
+iface vxlan_myvnet
+       vxlan-id 100
+       vxlan-local-tunnelip 192.168.0.1
+       bridge-learning off
+       bridge-arp-nd-suppress on
+       mtu 1450
diff --git a/src/test/zones/evpn/bgp_loopback/interfaces 
b/src/test/zones/evpn/bgp_loopback/interfaces
new file mode 100644
index 000000000000..af15fa4cb516
--- /dev/null
+++ b/src/test/zones/evpn/bgp_loopback/interfaces
@@ -0,0 +1,10 @@
+auto lo
+iface lo inet loopback
+
+auto vmbr0
+iface vmbr0 inet static
+       address 192.168.0.1/24
+       gateway 192.168.0.254
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
diff --git a/src/test/zones/evpn/bgp_loopback/sdn_config 
b/src/test/zones/evpn/bgp_loopback/sdn_config
new file mode 100644
index 000000000000..852dbdf6803a
--- /dev/null
+++ b/src/test/zones/evpn/bgp_loopback/sdn_config
@@ -0,0 +1,49 @@
+{
+    version => 1,
+    vnets => {
+        ids => {
+            myvnet => {
+                tag => "100",
+                type => "vnet",
+                zone => "myzone",
+            },
+        },
+    },
+
+    zones   => {
+        ids => {
+            myzone => {
+                ipam => "pve",
+                type => "evpn",
+                controller => "evpnctl",
+                'vrf-vxlan' => 1000,
+            },
+        },
+    },
+    controllers  => {
+        ids => {
+            evpnctl => {
+                type => "evpn",
+                'peers' => '192.168.0.1,192.168.0.2,192.168.0.3',
+                asn => "65000",
+            },
+            localhost => {
+                type => "bgp",
+                'peers' => '192.168.0.252,192.168.0.253',
+                loopback => "lo",
+                asn => "65000",
+                node => "localhost",
+            },
+        },
+    },
+
+    subnets => {
+        ids => {
+            'myzone-10.0.0.0-24' => {
+                'type' => 'subnet',
+                'vnet' => 'myvnet',
+                'gateway' => '10.0.0.1',
+            },
+        },
+    },
+}
diff --git a/src/test/zones/evpn/bgp_multipath_relax/expected_controller_config 
b/src/test/zones/evpn/bgp_multipath_relax/expected_controller_config
new file mode 100644
index 000000000000..2f2bf397edb6
--- /dev/null
+++ b/src/test/zones/evpn/bgp_multipath_relax/expected_controller_config
@@ -0,0 +1,56 @@
+frr version 10.4.1
+frr defaults datacenter
+hostname localhost
+log syslog informational
+service integrated-vtysh-config
+!
+!
+vrf vrf_myzone
+ vni 1000
+exit-vrf
+!
+router bgp 65000
+ bgp router-id 192.168.0.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 192.168.0.2 peer-group VTEP
+ neighbor 192.168.0.3 peer-group VTEP
+ bgp bestpath as-path multipath-relax
+ neighbor BGP peer-group
+ neighbor BGP remote-as 65000
+ neighbor BGP bfd
+ neighbor 192.168.0.252 peer-group BGP
+ neighbor 192.168.0.253 peer-group BGP
+ !
+ address-family ipv4 unicast
+  neighbor BGP activate
+  neighbor BGP soft-reconfiguration inbound
+ exit-address-family
+ !
+ 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_myzone
+ bgp router-id 192.168.0.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
+!
+line vty
+!
diff --git a/src/test/zones/evpn/bgp_multipath_relax/expected_sdn_interfaces 
b/src/test/zones/evpn/bgp_multipath_relax/expected_sdn_interfaces
new file mode 100644
index 000000000000..4cf13e05e688
--- /dev/null
+++ b/src/test/zones/evpn/bgp_multipath_relax/expected_sdn_interfaces
@@ -0,0 +1,41 @@
+#version:1
+
+auto myvnet
+iface myvnet
+       address 10.0.0.1/24
+       bridge_ports vxlan_myvnet
+       bridge_stp off
+       bridge_fd 0
+       mtu 1450
+       ip-forward on
+       arp-accept on
+       vrf vrf_myzone
+
+auto vrf_myzone
+iface vrf_myzone
+       vrf-table auto
+       post-up ip route add vrf vrf_myzone unreachable default metric 
4278198272
+
+auto vrfbr_myzone
+iface vrfbr_myzone
+       bridge-ports vrfvx_myzone
+       bridge_stp off
+       bridge_fd 0
+       mtu 1450
+       vrf vrf_myzone
+
+auto vrfvx_myzone
+iface vrfvx_myzone
+       vxlan-id 1000
+       vxlan-local-tunnelip 192.168.0.1
+       bridge-learning off
+       bridge-arp-nd-suppress on
+       mtu 1450
+
+auto vxlan_myvnet
+iface vxlan_myvnet
+       vxlan-id 100
+       vxlan-local-tunnelip 192.168.0.1
+       bridge-learning off
+       bridge-arp-nd-suppress on
+       mtu 1450
diff --git a/src/test/zones/evpn/bgp_multipath_relax/interfaces 
b/src/test/zones/evpn/bgp_multipath_relax/interfaces
new file mode 100644
index 000000000000..66bb826a44b3
--- /dev/null
+++ b/src/test/zones/evpn/bgp_multipath_relax/interfaces
@@ -0,0 +1,7 @@
+auto vmbr0
+iface vmbr0 inet static
+       address 192.168.0.1/24
+       gateway 192.168.0.254
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
diff --git a/src/test/zones/evpn/bgp_multipath_relax/sdn_config 
b/src/test/zones/evpn/bgp_multipath_relax/sdn_config
new file mode 100644
index 000000000000..9513906a47e0
--- /dev/null
+++ b/src/test/zones/evpn/bgp_multipath_relax/sdn_config
@@ -0,0 +1,49 @@
+{
+    version => 1,
+    vnets => {
+        ids => {
+            myvnet => {
+                tag => "100",
+                type => "vnet",
+                zone => "myzone",
+            },
+        },
+    },
+
+    zones   => {
+        ids => {
+            myzone => {
+                ipam => "pve",
+                type => "evpn",
+                controller => "evpnctl",
+                'vrf-vxlan' => 1000,
+            },
+        },
+    },
+    controllers  => {
+        ids => {
+            evpnctl => {
+                type => "evpn",
+                'peers' => '192.168.0.1,192.168.0.2,192.168.0.3',
+                asn => "65000",
+            },
+            localhost => {
+                type => "bgp",
+                'peers' => '192.168.0.252,192.168.0.253',
+                'bgp-multipath-as-path-relax' => "1",
+                asn => "65000",
+                node => "localhost",
+            },
+        },
+    },
+
+    subnets => {
+        ids => {
+            'myzone-10.0.0.0-24' => {
+                'type' => 'subnet',
+                'vnet' => 'myvnet',
+                'gateway' => '10.0.0.1',
+            },
+        },
+    },
+}
diff --git a/src/test/zones/evpn/combined_bgp_isis/expected_controller_config 
b/src/test/zones/evpn/combined_bgp_isis/expected_controller_config
new file mode 100644
index 000000000000..35a3a54e0376
--- /dev/null
+++ b/src/test/zones/evpn/combined_bgp_isis/expected_controller_config
@@ -0,0 +1,76 @@
+frr version 10.4.1
+frr defaults datacenter
+hostname localhost
+log syslog informational
+service integrated-vtysh-config
+!
+!
+vrf vrf_myzone
+ vni 1000
+exit-vrf
+!
+interface eth1
+ ip router isis isis1
+!
+router bgp 65000
+ bgp router-id 192.168.0.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 VTEP update-source lo
+ neighbor 192.168.0.2 peer-group VTEP
+ neighbor 192.168.0.3 peer-group VTEP
+ neighbor BGP peer-group
+ neighbor BGP remote-as 65000
+ neighbor BGP bfd
+ neighbor 192.168.0.252 peer-group BGP
+ neighbor 192.168.0.253 peer-group BGP
+ !
+ address-family ipv4 unicast
+  network 192.168.0.1/32
+  neighbor BGP activate
+  neighbor BGP soft-reconfiguration inbound
+ exit-address-family
+ !
+ 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_myzone
+ bgp router-id 192.168.0.1
+ no bgp hard-administrative-reset
+ no bgp graceful-restart notification
+exit
+!
+router isis isis1
+ net 47.0023.0000.0000.0000.0000.0000.0000.1900.0004.00
+ redistribute ipv4 connected level-1
+ redistribute ipv6 connected level-1
+ log-adjacency-changes
+exit
+!
+ip prefix-list loopbacks_ips seq 10 permit 0.0.0.0/0 le 32
+!
+route-map MAP_VTEP_IN permit 1
+exit
+!
+route-map MAP_VTEP_OUT permit 1
+exit
+!
+route-map correct_src permit 1
+ match ip address prefix-list loopbacks_ips
+ set src 192.168.0.1
+exit
+!
+ip protocol bgp route-map correct_src
+!
+line vty
+!
diff --git a/src/test/zones/evpn/combined_bgp_isis/expected_sdn_interfaces 
b/src/test/zones/evpn/combined_bgp_isis/expected_sdn_interfaces
new file mode 100644
index 000000000000..4cf13e05e688
--- /dev/null
+++ b/src/test/zones/evpn/combined_bgp_isis/expected_sdn_interfaces
@@ -0,0 +1,41 @@
+#version:1
+
+auto myvnet
+iface myvnet
+       address 10.0.0.1/24
+       bridge_ports vxlan_myvnet
+       bridge_stp off
+       bridge_fd 0
+       mtu 1450
+       ip-forward on
+       arp-accept on
+       vrf vrf_myzone
+
+auto vrf_myzone
+iface vrf_myzone
+       vrf-table auto
+       post-up ip route add vrf vrf_myzone unreachable default metric 
4278198272
+
+auto vrfbr_myzone
+iface vrfbr_myzone
+       bridge-ports vrfvx_myzone
+       bridge_stp off
+       bridge_fd 0
+       mtu 1450
+       vrf vrf_myzone
+
+auto vrfvx_myzone
+iface vrfvx_myzone
+       vxlan-id 1000
+       vxlan-local-tunnelip 192.168.0.1
+       bridge-learning off
+       bridge-arp-nd-suppress on
+       mtu 1450
+
+auto vxlan_myvnet
+iface vxlan_myvnet
+       vxlan-id 100
+       vxlan-local-tunnelip 192.168.0.1
+       bridge-learning off
+       bridge-arp-nd-suppress on
+       mtu 1450
diff --git a/src/test/zones/evpn/combined_bgp_isis/interfaces 
b/src/test/zones/evpn/combined_bgp_isis/interfaces
new file mode 100644
index 000000000000..af15fa4cb516
--- /dev/null
+++ b/src/test/zones/evpn/combined_bgp_isis/interfaces
@@ -0,0 +1,10 @@
+auto lo
+iface lo inet loopback
+
+auto vmbr0
+iface vmbr0 inet static
+       address 192.168.0.1/24
+       gateway 192.168.0.254
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
diff --git a/src/test/zones/evpn/combined_bgp_isis/sdn_config 
b/src/test/zones/evpn/combined_bgp_isis/sdn_config
new file mode 100644
index 000000000000..d4c03136dab8
--- /dev/null
+++ b/src/test/zones/evpn/combined_bgp_isis/sdn_config
@@ -0,0 +1,57 @@
+{
+    version => 1,
+    vnets => {
+        ids => {
+            myvnet => {
+                tag => "100",
+                type => "vnet",
+                zone => "myzone",
+            },
+        },
+    },
+
+    zones   => {
+        ids => {
+            myzone => {
+                ipam => "pve",
+                type => "evpn",
+                controller => "evpnctl",
+                'vrf-vxlan' => 1000,
+            },
+        },
+    },
+    controllers  => {
+        ids => {
+            evpnctl => {
+                type => "evpn",
+                'peers' => '192.168.0.1,192.168.0.2,192.168.0.3',
+                asn => "65000",
+            },
+            localhost => {
+                type => "bgp",
+                'peers' => '192.168.0.252,192.168.0.253',
+                loopback => "lo",
+                asn => "65000",
+                node => "localhost",
+            },
+            isisctl => {
+                type => "isis",
+                'isis-domain' => 'isis1',
+                'isis-ifaces' => 'eth1',
+                'isis-net' => 
"47.0023.0000.0000.0000.0000.0000.0000.1900.0004.00",
+                loopback => "lo",
+                node => "localhost",
+            },
+        },
+    },
+
+    subnets => {
+        ids => {
+            'myzone-10.0.0.0-24' => {
+                'type' => 'subnet',
+                'vnet' => 'myvnet',
+                'gateway' => '10.0.0.1',
+            },
+        },
+    },
+}
diff --git a/src/test/zones/evpn/ebgp_only/expected_controller_config 
b/src/test/zones/evpn/ebgp_only/expected_controller_config
new file mode 100644
index 000000000000..4751428b639c
--- /dev/null
+++ b/src/test/zones/evpn/ebgp_only/expected_controller_config
@@ -0,0 +1,26 @@
+frr version 10.4.1
+frr defaults datacenter
+hostname localhost
+log syslog informational
+service integrated-vtysh-config
+!
+!
+router bgp 65001
+ bgp router-id 192.168.0.1
+ no bgp default ipv4-unicast
+ coalesce-time 1000
+ neighbor BGP peer-group
+ neighbor BGP remote-as external
+ neighbor BGP bfd
+ neighbor BGP ebgp-multihop 3
+ neighbor 192.168.0.252 peer-group BGP
+ neighbor 192.168.0.253 peer-group BGP
+ !
+ address-family ipv4 unicast
+  neighbor BGP activate
+  neighbor BGP soft-reconfiguration inbound
+ exit-address-family
+exit
+!
+line vty
+!
diff --git a/src/test/zones/evpn/ebgp_only/expected_sdn_interfaces 
b/src/test/zones/evpn/ebgp_only/expected_sdn_interfaces
new file mode 100644
index 000000000000..edc8ff918531
--- /dev/null
+++ b/src/test/zones/evpn/ebgp_only/expected_sdn_interfaces
@@ -0,0 +1 @@
+#version:1
diff --git a/src/test/zones/evpn/ebgp_only/interfaces 
b/src/test/zones/evpn/ebgp_only/interfaces
new file mode 100644
index 000000000000..66bb826a44b3
--- /dev/null
+++ b/src/test/zones/evpn/ebgp_only/interfaces
@@ -0,0 +1,7 @@
+auto vmbr0
+iface vmbr0 inet static
+       address 192.168.0.1/24
+       gateway 192.168.0.254
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
diff --git a/src/test/zones/evpn/ebgp_only/sdn_config 
b/src/test/zones/evpn/ebgp_only/sdn_config
new file mode 100644
index 000000000000..73d323f7b127
--- /dev/null
+++ b/src/test/zones/evpn/ebgp_only/sdn_config
@@ -0,0 +1,19 @@
+{
+    version => 1,
+    vnets => {},
+    zones => {},
+    controllers => {
+        ids => {
+            localhost => {
+                type => "bgp",
+                'peers' => '192.168.0.252,192.168.0.253',
+                ebgp => "1",
+                'ebgp-multihop' => '3',
+                asn => "65001",
+                node => "localhost",
+            },
+        },
+    },
+
+    subnets => {},
+}
-- 
2.47.3




Reply via email to