[pve-devel] [PATCH pve-network 3/3] add zones && controllers unit tests

Alexandre Derumier aderumier at odiso.com
Wed Dec 9 16:11:19 CET 2020


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 Makefile                                      |   6 +-
 test/Makefile                                 |   6 +
 test/{ => debug}/documentation.txt            |   0
 test/{ => debug}/generateconfig.pl            |   0
 test/{ => debug}/statuscheck.pl               |   0
 test/run_test_zones.pl                        | 124 ++++++++++++++++++
 .../evpn/ebgp/expected_controller_config      |  49 +++++++
 test/zones/evpn/ebgp/expected_sdn_interfaces  |  38 ++++++
 test/zones/evpn/ebgp/interfaces               |   7 +
 test/zones/evpn/ebgp/sdn_config               |  29 ++++
 .../ebgp_loopback/expected_controller_config  |  53 ++++++++
 .../ebgp_loopback/expected_sdn_interfaces     |  38 ++++++
 test/zones/evpn/ebgp_loopback/interfaces      |  13 ++
 test/zones/evpn/ebgp_loopback/sdn_config      |  29 ++++
 .../evpn/exitnode/expected_controller_config  |  52 ++++++++
 .../evpn/exitnode/expected_sdn_interfaces     |  38 ++++++
 test/zones/evpn/exitnode/interfaces           |   7 +
 test/zones/evpn/exitnode/sdn_config           |  26 ++++
 .../exitnode_snat/expected_controller_config  |  52 ++++++++
 .../exitnode_snat/expected_sdn_interfaces     |  42 ++++++
 test/zones/evpn/exitnode_snat/interfaces      |   7 +
 test/zones/evpn/exitnode_snat/sdn_config      |  27 ++++
 .../evpn/ipv4/expected_controller_config      |  31 +++++
 test/zones/evpn/ipv4/expected_sdn_interfaces  |  38 ++++++
 test/zones/evpn/ipv4/interfaces               |   7 +
 test/zones/evpn/ipv4/sdn_config               |  26 ++++
 .../zones/qinq/bridge/expected_sdn_interfaces |  17 +++
 test/zones/qinq/bridge/interfaces             |   5 +
 test/zones/qinq/bridge/sdn_config             |  11 ++
 .../bridge_vlanaware/expected_sdn_interfaces  |  15 +++
 test/zones/qinq/bridge_vlanaware/interfaces   |   7 +
 test/zones/qinq/bridge_vlanaware/sdn_config   |  11 ++
 .../expected_sdn_interfaces                   |  17 +++
 .../bridge_vlanaware_vlanawarevnet/interfaces |   7 +
 .../bridge_vlanaware_vlanawarevnet/sdn_config |  11 ++
 .../expected_sdn_interfaces                   |  19 +++
 .../bridge_vlanaware_vlanprotocol/interfaces  |   7 +
 .../bridge_vlanaware_vlanprotocol/sdn_config  |  11 ++
 .../expected_sdn_interfaces                   |  19 +++
 .../qinq/bridge_vlanawarevnet/interfaces      |   5 +
 .../qinq/bridge_vlanawarevnet/sdn_config      |  11 ++
 .../expected_sdn_interfaces                   |  18 +++
 .../zones/qinq/bridge_vlanprotocol/interfaces |   5 +
 .../zones/qinq/bridge_vlanprotocol/sdn_config |  11 ++
 test/zones/qinq/ovs/expected_sdn_interfaces   |  25 ++++
 test/zones/qinq/ovs/interfaces                |   9 ++
 test/zones/qinq/ovs/sdn_config                |  11 ++
 .../ovs_vlanawarevnet/expected_sdn_interfaces |  27 ++++
 test/zones/qinq/ovs_vlanawarevnet/interfaces  |   9 ++
 test/zones/qinq/ovs_vlanawarevnet/sdn_config  |  11 ++
 .../ovs_vlanprotocol/expected_sdn_interfaces  |  25 ++++
 test/zones/qinq/ovs_vlanprotocol/interfaces   |   9 ++
 test/zones/qinq/ovs_vlanprotocol/sdn_config   |  11 ++
 .../simple/basic/expected_sdn_interfaces      |   7 +
 test/zones/simple/basic/interfaces            |   5 +
 test/zones/simple/basic/sdn_config            |  11 ++
 .../zones/simple/ipv4/expected_sdn_interfaces |   8 ++
 test/zones/simple/ipv4/interfaces             |   5 +
 test/zones/simple/ipv4/sdn_config             |  22 ++++
 .../simple/ipv4snat/expected_sdn_interfaces   |  12 ++
 test/zones/simple/ipv4snat/interfaces         |   7 +
 test/zones/simple/ipv4snat/sdn_config         |  23 ++++
 .../zones/vlan/bridge/expected_sdn_interfaces |  23 ++++
 test/zones/vlan/bridge/interfaces             |   5 +
 test/zones/vlan/bridge/sdn_config             |  11 ++
 .../bridge_vlanaware/expected_sdn_interfaces  |   7 +
 test/zones/vlan/bridge_vlanaware/interfaces   |   7 +
 test/zones/vlan/bridge_vlanaware/sdn_config   |  11 ++
 .../expected_sdn_interfaces                   |   9 ++
 .../bridge_vlanaware_vlanawarevnet/interfaces |   7 +
 .../bridge_vlanaware_vlanawarevnet/sdn_config |  11 ++
 test/zones/vlan/ovs/expected_sdn_interfaces   |  17 +++
 test/zones/vlan/ovs/interfaces                |   9 ++
 test/zones/vlan/ovs/sdn_config                |  11 ++
 .../ovs_vlanware_vnet/expected_sdn_interfaces |  19 +++
 test/zones/vlan/ovs_vlanware_vnet/interfaces  |   9 ++
 test/zones/vlan/ovs_vlanware_vnet/sdn_config  |  11 ++
 .../zones/vxlan/basic/expected_sdn_interfaces |  15 +++
 test/zones/vxlan/basic/interfaces             |   7 +
 test/zones/vxlan/basic/sdn_config             |  11 ++
 .../vlanawarevnet/expected_sdn_interfaces     |  17 +++
 test/zones/vxlan/vlanawarevnet/interfaces     |   7 +
 test/zones/vxlan/vlanawarevnet/sdn_config     |  11 ++
 83 files changed, 1421 insertions(+), 3 deletions(-)
 create mode 100644 test/Makefile
 rename test/{ => debug}/documentation.txt (100%)
 rename test/{ => debug}/generateconfig.pl (100%)
 rename test/{ => debug}/statuscheck.pl (100%)
 create mode 100755 test/run_test_zones.pl
 create mode 100644 test/zones/evpn/ebgp/expected_controller_config
 create mode 100644 test/zones/evpn/ebgp/expected_sdn_interfaces
 create mode 100644 test/zones/evpn/ebgp/interfaces
 create mode 100644 test/zones/evpn/ebgp/sdn_config
 create mode 100644 test/zones/evpn/ebgp_loopback/expected_controller_config
 create mode 100644 test/zones/evpn/ebgp_loopback/expected_sdn_interfaces
 create mode 100644 test/zones/evpn/ebgp_loopback/interfaces
 create mode 100644 test/zones/evpn/ebgp_loopback/sdn_config
 create mode 100644 test/zones/evpn/exitnode/expected_controller_config
 create mode 100644 test/zones/evpn/exitnode/expected_sdn_interfaces
 create mode 100644 test/zones/evpn/exitnode/interfaces
 create mode 100644 test/zones/evpn/exitnode/sdn_config
 create mode 100644 test/zones/evpn/exitnode_snat/expected_controller_config
 create mode 100644 test/zones/evpn/exitnode_snat/expected_sdn_interfaces
 create mode 100644 test/zones/evpn/exitnode_snat/interfaces
 create mode 100644 test/zones/evpn/exitnode_snat/sdn_config
 create mode 100644 test/zones/evpn/ipv4/expected_controller_config
 create mode 100644 test/zones/evpn/ipv4/expected_sdn_interfaces
 create mode 100644 test/zones/evpn/ipv4/interfaces
 create mode 100644 test/zones/evpn/ipv4/sdn_config
 create mode 100644 test/zones/qinq/bridge/expected_sdn_interfaces
 create mode 100644 test/zones/qinq/bridge/interfaces
 create mode 100644 test/zones/qinq/bridge/sdn_config
 create mode 100644 test/zones/qinq/bridge_vlanaware/expected_sdn_interfaces
 create mode 100644 test/zones/qinq/bridge_vlanaware/interfaces
 create mode 100644 test/zones/qinq/bridge_vlanaware/sdn_config
 create mode 100644 test/zones/qinq/bridge_vlanaware_vlanawarevnet/expected_sdn_interfaces
 create mode 100644 test/zones/qinq/bridge_vlanaware_vlanawarevnet/interfaces
 create mode 100644 test/zones/qinq/bridge_vlanaware_vlanawarevnet/sdn_config
 create mode 100644 test/zones/qinq/bridge_vlanaware_vlanprotocol/expected_sdn_interfaces
 create mode 100644 test/zones/qinq/bridge_vlanaware_vlanprotocol/interfaces
 create mode 100644 test/zones/qinq/bridge_vlanaware_vlanprotocol/sdn_config
 create mode 100644 test/zones/qinq/bridge_vlanawarevnet/expected_sdn_interfaces
 create mode 100644 test/zones/qinq/bridge_vlanawarevnet/interfaces
 create mode 100644 test/zones/qinq/bridge_vlanawarevnet/sdn_config
 create mode 100644 test/zones/qinq/bridge_vlanprotocol/expected_sdn_interfaces
 create mode 100644 test/zones/qinq/bridge_vlanprotocol/interfaces
 create mode 100644 test/zones/qinq/bridge_vlanprotocol/sdn_config
 create mode 100644 test/zones/qinq/ovs/expected_sdn_interfaces
 create mode 100644 test/zones/qinq/ovs/interfaces
 create mode 100644 test/zones/qinq/ovs/sdn_config
 create mode 100644 test/zones/qinq/ovs_vlanawarevnet/expected_sdn_interfaces
 create mode 100644 test/zones/qinq/ovs_vlanawarevnet/interfaces
 create mode 100644 test/zones/qinq/ovs_vlanawarevnet/sdn_config
 create mode 100644 test/zones/qinq/ovs_vlanprotocol/expected_sdn_interfaces
 create mode 100644 test/zones/qinq/ovs_vlanprotocol/interfaces
 create mode 100644 test/zones/qinq/ovs_vlanprotocol/sdn_config
 create mode 100644 test/zones/simple/basic/expected_sdn_interfaces
 create mode 100644 test/zones/simple/basic/interfaces
 create mode 100644 test/zones/simple/basic/sdn_config
 create mode 100644 test/zones/simple/ipv4/expected_sdn_interfaces
 create mode 100644 test/zones/simple/ipv4/interfaces
 create mode 100644 test/zones/simple/ipv4/sdn_config
 create mode 100644 test/zones/simple/ipv4snat/expected_sdn_interfaces
 create mode 100644 test/zones/simple/ipv4snat/interfaces
 create mode 100644 test/zones/simple/ipv4snat/sdn_config
 create mode 100644 test/zones/vlan/bridge/expected_sdn_interfaces
 create mode 100644 test/zones/vlan/bridge/interfaces
 create mode 100644 test/zones/vlan/bridge/sdn_config
 create mode 100644 test/zones/vlan/bridge_vlanaware/expected_sdn_interfaces
 create mode 100644 test/zones/vlan/bridge_vlanaware/interfaces
 create mode 100644 test/zones/vlan/bridge_vlanaware/sdn_config
 create mode 100644 test/zones/vlan/bridge_vlanaware_vlanawarevnet/expected_sdn_interfaces
 create mode 100644 test/zones/vlan/bridge_vlanaware_vlanawarevnet/interfaces
 create mode 100644 test/zones/vlan/bridge_vlanaware_vlanawarevnet/sdn_config
 create mode 100644 test/zones/vlan/ovs/expected_sdn_interfaces
 create mode 100644 test/zones/vlan/ovs/interfaces
 create mode 100644 test/zones/vlan/ovs/sdn_config
 create mode 100644 test/zones/vlan/ovs_vlanware_vnet/expected_sdn_interfaces
 create mode 100644 test/zones/vlan/ovs_vlanware_vnet/interfaces
 create mode 100644 test/zones/vlan/ovs_vlanware_vnet/sdn_config
 create mode 100644 test/zones/vxlan/basic/expected_sdn_interfaces
 create mode 100644 test/zones/vxlan/basic/interfaces
 create mode 100644 test/zones/vxlan/basic/sdn_config
 create mode 100644 test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces
 create mode 100644 test/zones/vxlan/vlanawarevnet/interfaces
 create mode 100644 test/zones/vxlan/vlanawarevnet/sdn_config

diff --git a/Makefile b/Makefile
index fb402e5..a162c11 100644
--- a/Makefile
+++ b/Makefile
@@ -37,9 +37,9 @@ distclean: clean
 clean:
 	rm -rf *~ *.deb *.changes ${PACKAGE}-* *.buildinfo *.dsc *.tar.gz
 
-.PHONY: check
-check:
-	$(MAKE) -C test check
+.PHONY: test
+test:
+	$(MAKE) -C test
 
 .PHONY: install
 install:
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..b8e5de1
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,6 @@
+all: test
+
+test: test_zones
+
+test_zones: run_test_zones.pl
+	./run_test_zones.pl
diff --git a/test/documentation.txt b/test/debug/documentation.txt
similarity index 100%
rename from test/documentation.txt
rename to test/debug/documentation.txt
diff --git a/test/generateconfig.pl b/test/debug/generateconfig.pl
similarity index 100%
rename from test/generateconfig.pl
rename to test/debug/generateconfig.pl
diff --git a/test/statuscheck.pl b/test/debug/statuscheck.pl
similarity index 100%
rename from test/statuscheck.pl
rename to test/debug/statuscheck.pl
diff --git a/test/run_test_zones.pl b/test/run_test_zones.pl
new file mode 100755
index 0000000..71ead61
--- /dev/null
+++ b/test/run_test_zones.pl
@@ -0,0 +1,124 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use lib qw(..);
+use File::Slurp;
+
+use Test::More;
+use Test::MockModule;
+
+use PVE::Network::SDN;
+use PVE::Network::SDN::Zones;
+use PVE::Network::SDN::Controllers;
+use PVE::INotify;
+
+sub read_sdn_config {
+    my ($file) = @_;
+
+    # Read structure back in again
+    open my $in, '<', $file or die $!;
+    my $sdn_config;
+    {
+	local $/;    # slurp mode
+	$sdn_config = eval <$in>;
+    }
+    close $in;
+
+    return $sdn_config;
+}
+
+
+my @tests = grep { -d } glob './zones/*/*';
+
+foreach my $test (@tests) {
+
+    my $sdn_config = read_sdn_config ("./$test/sdn_config");
+
+    open my $fh1, '<', "./$test/interfaces" or die "can't read interfaces file";
+    my $interfaces_config = PVE::INotify::__read_etc_network_interfaces($fh1, undef, undef);
+    close $fh1;
+
+    my $pve_common_inotify;
+    $pve_common_inotify = Test::MockModule->new('PVE::INotify');
+    $pve_common_inotify->mock(
+	nodename => sub {
+	    return 'localhost';
+	},
+	read_file => sub {
+	    return $interfaces_config;
+	},
+    );
+
+    my $pve_sdn_subnets;
+    $pve_sdn_subnets = Test::MockModule->new('PVE::Network::SDN::Subnets');
+    $pve_sdn_subnets->mock(
+	config => sub {
+	    return $sdn_config->{subnets};
+	},
+    );
+
+    my $pve_sdn_zones_plugin;
+    $pve_sdn_zones_plugin = Test::MockModule->new('PVE::Network::SDN::Zones::Plugin');
+    $pve_sdn_zones_plugin->mock(
+	get_local_route_ip => sub {
+	    my $outiface = "vmbr0";
+	    my $outip = $interfaces_config->{ifaces}->{$outiface}->{address};
+	    return ($outip, $outiface);
+	},
+	is_vlanaware => sub {
+	    return $interfaces_config->{ifaces}->{vmbr0}->{'bridge_vlan_aware'};
+	},
+	is_ovs => sub {
+	    return 1 if $interfaces_config->{ifaces}->{vmbr0}->{'type'} eq 'OVSBridge';
+	},
+	get_bridge_ifaces => sub {
+	    return ('eth0');
+	},
+	find_bridge => sub {
+	    return;
+	}
+    );
+
+    my $sdn_module = Test::MockModule->new("PVE::Network::SDN");
+    $sdn_module->mock(
+	config => sub {
+	    return $sdn_config;
+	},
+    );
+
+    my $name = $test;
+    my $expected = read_file("./$test/expected_sdn_interfaces");
+
+    my $result = "";
+    eval { 
+	$result = PVE::Network::SDN::Zones::generate_etc_network_config();
+    };
+
+    if (my $err = $@) {
+	fail($name);
+    } else {
+	is ($result, $expected, $name);
+    }
+
+    if ($sdn_config->{controllers}) {
+	my $expected = read_file("./$test/expected_controller_config");
+	my $controller_rawconfig = "";
+
+	eval { 
+	    my $config = PVE::Network::SDN::Controllers::generate_controller_config();
+	    $controller_rawconfig = PVE::Network::SDN::Controllers::generate_controller_rawconfig($config);
+	};
+
+	if (my $err = $@) {
+	    fail($name);
+	} else {
+	    is ($controller_rawconfig, $expected, $name);
+	}
+    }
+}
+
+done_testing();
+
+
diff --git a/test/zones/evpn/ebgp/expected_controller_config b/test/zones/evpn/ebgp/expected_controller_config
new file mode 100644
index 0000000..4c42012
--- /dev/null
+++ b/test/zones/evpn/ebgp/expected_controller_config
@@ -0,0 +1,49 @@
+log syslog informational
+ip forwarding
+ipv6 forwarding
+frr defaults datacenter
+service integrated-vtysh-config
+hostname localhost
+!
+!
+vrf vrf_myzone
+ vni 1000
+exit-vrf
+!
+router bgp 65001
+ bgp router-id 192.168.0.1
+ no bgp default ipv4-unicast
+ coalesce-time 1000
+ neighbor VTEP peer-group
+ neighbor VTEP remote-as external
+ neighbor VTEP bfd
+ neighbor 192.168.0.2 peer-group VTEP
+ neighbor 192.168.0.3 peer-group VTEP
+ no bgp ebgp-requires-policy
+ 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
+  advertise-all-vni
+  autort as 65000
+ exit-address-family
+!
+router bgp 65001 vrf vrf_myzone
+ no bgp ebgp-requires-policy
+ !
+ address-family l2vpn evpn
+  route-target import 65000:1000
+  route-target export 65000:1000
+ exit-address-family
+!
+line vty
+!
\ No newline at end of file
diff --git a/test/zones/evpn/ebgp/expected_sdn_interfaces b/test/zones/evpn/ebgp/expected_sdn_interfaces
new file mode 100644
index 0000000..799dcb7
--- /dev/null
+++ b/test/zones/evpn/ebgp/expected_sdn_interfaces
@@ -0,0 +1,38 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	address 10.0.0.1/24
+	bridge_ports vxlan_myvnet
+	bridge_stp off
+	bridge_fd 0
+	mtu 1450
+	vrf vrf_myzone
+
+auto vrf_myzone
+iface vrf_myzone
+	vrf-table auto
+
+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/test/zones/evpn/ebgp/interfaces b/test/zones/evpn/ebgp/interfaces
new file mode 100644
index 0000000..66bb826
--- /dev/null
+++ b/test/zones/evpn/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/test/zones/evpn/ebgp/sdn_config b/test/zones/evpn/ebgp/sdn_config
new file mode 100644
index 0000000..379dc14
--- /dev/null
+++ b/test/zones/evpn/ebgp/sdn_config
@@ -0,0 +1,29 @@
+{
+  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 => "65001", node => "localhost" },
+		      },
+             },
+
+  subnets => {
+              ids => { 'myzone-10.0.0.0-24' => {
+							'type' => 'subnet',
+							'vnet' => 'myvnet',
+							'gateway' => '10.0.0.1',
+						  }
+		     }
+	     }
+}
+
+
diff --git a/test/zones/evpn/ebgp_loopback/expected_controller_config b/test/zones/evpn/ebgp_loopback/expected_controller_config
new file mode 100644
index 0000000..23be7f9
--- /dev/null
+++ b/test/zones/evpn/ebgp_loopback/expected_controller_config
@@ -0,0 +1,53 @@
+log syslog informational
+ip forwarding
+ipv6 forwarding
+frr defaults datacenter
+service integrated-vtysh-config
+hostname localhost
+!
+!
+vrf vrf_myzone
+ vni 1000
+exit-vrf
+!
+router bgp 65001
+ bgp router-id 192.168.0.1
+ no bgp default ipv4-unicast
+ coalesce-time 1000
+ neighbor VTEP peer-group
+ neighbor VTEP remote-as external
+ neighbor VTEP bfd
+ neighbor VTEP ebgp-multihop 10
+ neighbor VTEP update-source dummy1
+ neighbor 192.168.0.2 peer-group VTEP
+ neighbor 192.168.0.3 peer-group VTEP
+ no bgp ebgp-requires-policy
+ bgp disable-ebgp-connected-route-check
+ neighbor BGP peer-group
+ neighbor BGP remote-as external
+ neighbor BGP bfd
+ neighbor 172.16.0.254 peer-group BGP
+ neighbor 172.17.0.254 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
+  advertise-all-vni
+  autort as 65000
+ exit-address-family
+!
+router bgp 65001 vrf vrf_myzone
+ no bgp ebgp-requires-policy
+ !
+ address-family l2vpn evpn
+  route-target import 65000:1000
+  route-target export 65000:1000
+ exit-address-family
+!
+line vty
+!
\ No newline at end of file
diff --git a/test/zones/evpn/ebgp_loopback/expected_sdn_interfaces b/test/zones/evpn/ebgp_loopback/expected_sdn_interfaces
new file mode 100644
index 0000000..799dcb7
--- /dev/null
+++ b/test/zones/evpn/ebgp_loopback/expected_sdn_interfaces
@@ -0,0 +1,38 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	address 10.0.0.1/24
+	bridge_ports vxlan_myvnet
+	bridge_stp off
+	bridge_fd 0
+	mtu 1450
+	vrf vrf_myzone
+
+auto vrf_myzone
+iface vrf_myzone
+	vrf-table auto
+
+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/test/zones/evpn/ebgp_loopback/interfaces b/test/zones/evpn/ebgp_loopback/interfaces
new file mode 100644
index 0000000..f6bc352
--- /dev/null
+++ b/test/zones/evpn/ebgp_loopback/interfaces
@@ -0,0 +1,13 @@
+auto eth0
+iface eth0 inet static
+	address 172.16.0.1/24
+
+auto eth1
+iface eth1 inet static
+	address 172.17.0.1/24
+
+auto dummy1
+iface dummy1 inet static
+        address 192.168.0.1/32
+        link-type dummy
+
diff --git a/test/zones/evpn/ebgp_loopback/sdn_config b/test/zones/evpn/ebgp_loopback/sdn_config
new file mode 100644
index 0000000..c8bc2e0
--- /dev/null
+++ b/test/zones/evpn/ebgp_loopback/sdn_config
@@ -0,0 +1,29 @@
+{
+  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' => '172.16.0.254,172.17.0.254', ebgp => "1", asn => "65001", loopback => 'dummy1', node => "localhost" },
+		      },
+             },
+
+  subnets => {
+              ids => { 'myzone-10.0.0.0-24' => {
+							'type' => 'subnet',
+							'vnet' => 'myvnet',
+							'gateway' => '10.0.0.1',
+						  }
+		     }
+	     }
+}
+
+
diff --git a/test/zones/evpn/exitnode/expected_controller_config b/test/zones/evpn/exitnode/expected_controller_config
new file mode 100644
index 0000000..57ff6ff
--- /dev/null
+++ b/test/zones/evpn/exitnode/expected_controller_config
@@ -0,0 +1,52 @@
+log syslog informational
+ip forwarding
+ipv6 forwarding
+frr defaults datacenter
+service integrated-vtysh-config
+hostname localhost
+!
+!
+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 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
+  import vrf vrf_myzone
+ exit-address-family
+ !
+ address-family ipv6 unicast
+  import vrf vrf_myzone
+ exit-address-family
+ !
+ address-family l2vpn evpn
+  neighbor VTEP activate
+  advertise-all-vni
+ exit-address-family
+!
+router bgp 65000 vrf vrf_myzone
+ !
+ address-family ipv4 unicast
+  redistribute connected
+ exit-address-family
+ !
+ address-family ipv6 unicast
+  redistribute connected
+ exit-address-family
+ !
+ address-family l2vpn evpn
+  default-originate ipv4
+  default-originate ipv6
+ exit-address-family
+!
+line vty
+!
\ No newline at end of file
diff --git a/test/zones/evpn/exitnode/expected_sdn_interfaces b/test/zones/evpn/exitnode/expected_sdn_interfaces
new file mode 100644
index 0000000..799dcb7
--- /dev/null
+++ b/test/zones/evpn/exitnode/expected_sdn_interfaces
@@ -0,0 +1,38 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	address 10.0.0.1/24
+	bridge_ports vxlan_myvnet
+	bridge_stp off
+	bridge_fd 0
+	mtu 1450
+	vrf vrf_myzone
+
+auto vrf_myzone
+iface vrf_myzone
+	vrf-table auto
+
+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/test/zones/evpn/exitnode/interfaces b/test/zones/evpn/exitnode/interfaces
new file mode 100644
index 0000000..66bb826
--- /dev/null
+++ b/test/zones/evpn/exitnode/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/test/zones/evpn/exitnode/sdn_config b/test/zones/evpn/exitnode/sdn_config
new file mode 100644
index 0000000..fd81817
--- /dev/null
+++ b/test/zones/evpn/exitnode/sdn_config
@@ -0,0 +1,26 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => "100", type => "vnet", zone => "myzone" },
+                      },
+             },
+
+  zones   => {
+               ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, exitnodes => { 'localhost' => 1 } } },
+             },
+  controllers  => {
+               ids => { 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/test/zones/evpn/exitnode_snat/expected_controller_config b/test/zones/evpn/exitnode_snat/expected_controller_config
new file mode 100644
index 0000000..57ff6ff
--- /dev/null
+++ b/test/zones/evpn/exitnode_snat/expected_controller_config
@@ -0,0 +1,52 @@
+log syslog informational
+ip forwarding
+ipv6 forwarding
+frr defaults datacenter
+service integrated-vtysh-config
+hostname localhost
+!
+!
+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 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
+  import vrf vrf_myzone
+ exit-address-family
+ !
+ address-family ipv6 unicast
+  import vrf vrf_myzone
+ exit-address-family
+ !
+ address-family l2vpn evpn
+  neighbor VTEP activate
+  advertise-all-vni
+ exit-address-family
+!
+router bgp 65000 vrf vrf_myzone
+ !
+ address-family ipv4 unicast
+  redistribute connected
+ exit-address-family
+ !
+ address-family ipv6 unicast
+  redistribute connected
+ exit-address-family
+ !
+ address-family l2vpn evpn
+  default-originate ipv4
+  default-originate ipv6
+ exit-address-family
+!
+line vty
+!
\ No newline at end of file
diff --git a/test/zones/evpn/exitnode_snat/expected_sdn_interfaces b/test/zones/evpn/exitnode_snat/expected_sdn_interfaces
new file mode 100644
index 0000000..b364a58
--- /dev/null
+++ b/test/zones/evpn/exitnode_snat/expected_sdn_interfaces
@@ -0,0 +1,42 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	address 10.0.0.1/24
+	post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j SNAT --to-source 192.168.0.1
+	post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j SNAT --to-source 192.168.0.1
+	post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
+	post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
+	bridge_ports vxlan_myvnet
+	bridge_stp off
+	bridge_fd 0
+	mtu 1450
+	vrf vrf_myzone
+
+auto vrf_myzone
+iface vrf_myzone
+	vrf-table auto
+
+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/test/zones/evpn/exitnode_snat/interfaces b/test/zones/evpn/exitnode_snat/interfaces
new file mode 100644
index 0000000..66bb826
--- /dev/null
+++ b/test/zones/evpn/exitnode_snat/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/test/zones/evpn/exitnode_snat/sdn_config b/test/zones/evpn/exitnode_snat/sdn_config
new file mode 100644
index 0000000..f40e8bd
--- /dev/null
+++ b/test/zones/evpn/exitnode_snat/sdn_config
@@ -0,0 +1,27 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => "100", type => "vnet", zone => "myzone" },
+                      },
+             },
+
+  zones   => {
+               ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, exitnodes => { 'localhost' => 1 } } },
+             },
+  controllers  => {
+               ids => { 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',
+							'snat' => 1
+						  }
+		     }
+	     }
+}
+
+
diff --git a/test/zones/evpn/ipv4/expected_controller_config b/test/zones/evpn/ipv4/expected_controller_config
new file mode 100644
index 0000000..c0ca898
--- /dev/null
+++ b/test/zones/evpn/ipv4/expected_controller_config
@@ -0,0 +1,31 @@
+log syslog informational
+ip forwarding
+ipv6 forwarding
+frr defaults datacenter
+service integrated-vtysh-config
+hostname localhost
+!
+!
+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 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 l2vpn evpn
+  neighbor VTEP activate
+  advertise-all-vni
+ exit-address-family
+!
+router bgp 65000 vrf vrf_myzone
+!
+line vty
+!
\ No newline at end of file
diff --git a/test/zones/evpn/ipv4/expected_sdn_interfaces b/test/zones/evpn/ipv4/expected_sdn_interfaces
new file mode 100644
index 0000000..799dcb7
--- /dev/null
+++ b/test/zones/evpn/ipv4/expected_sdn_interfaces
@@ -0,0 +1,38 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	address 10.0.0.1/24
+	bridge_ports vxlan_myvnet
+	bridge_stp off
+	bridge_fd 0
+	mtu 1450
+	vrf vrf_myzone
+
+auto vrf_myzone
+iface vrf_myzone
+	vrf-table auto
+
+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/test/zones/evpn/ipv4/interfaces b/test/zones/evpn/ipv4/interfaces
new file mode 100644
index 0000000..66bb826
--- /dev/null
+++ b/test/zones/evpn/ipv4/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/test/zones/evpn/ipv4/sdn_config b/test/zones/evpn/ipv4/sdn_config
new file mode 100644
index 0000000..4c115a9
--- /dev/null
+++ b/test/zones/evpn/ipv4/sdn_config
@@ -0,0 +1,26 @@
+{
+  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" } },
+             },
+
+  subnets => {
+              ids => { 'myzone-10.0.0.0-24' => {
+							'type' => 'subnet',
+							'vnet' => 'myvnet',
+							'gateway' => '10.0.0.1',
+						  }
+		     }
+	     }
+}
+
+
diff --git a/test/zones/qinq/bridge/expected_sdn_interfaces b/test/zones/qinq/bridge/expected_sdn_interfaces
new file mode 100644
index 0000000..73db5b3
--- /dev/null
+++ b/test/zones/qinq/bridge/expected_sdn_interfaces
@@ -0,0 +1,17 @@
+#version:1
+
+auto cv_myvnet
+iface cv_myvnet
+	vlan-raw-device sv_myvnet
+	vlan-id 100
+
+auto myvnet
+iface myvnet
+	bridge_ports  cv_myvnet
+	bridge_stp off
+	bridge_fd 0
+
+auto sv_myvnet
+iface sv_myvnet
+	vlan-raw-device eth0
+	vlan-id 10
diff --git a/test/zones/qinq/bridge/interfaces b/test/zones/qinq/bridge/interfaces
new file mode 100644
index 0000000..68b6a88
--- /dev/null
+++ b/test/zones/qinq/bridge/interfaces
@@ -0,0 +1,5 @@
+auto vmbr0
+iface vmbr0 inet manual
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
diff --git a/test/zones/qinq/bridge/sdn_config b/test/zones/qinq/bridge/sdn_config
new file mode 100644
index 0000000..1708d4c
--- /dev/null
+++ b/test/zones/qinq/bridge/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" } },
+             },
+}
diff --git a/test/zones/qinq/bridge_vlanaware/expected_sdn_interfaces b/test/zones/qinq/bridge_vlanaware/expected_sdn_interfaces
new file mode 100644
index 0000000..a9ed991
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanaware/expected_sdn_interfaces
@@ -0,0 +1,15 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	bridge_ports z_myzone.100
+	bridge_stp off
+	bridge_fd 0
+
+auto z_myzone
+iface z_myzone
+	bridge-stp off
+	bridge-ports vmbr0.10
+	bridge-fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4094
diff --git a/test/zones/qinq/bridge_vlanaware/interfaces b/test/zones/qinq/bridge_vlanaware/interfaces
new file mode 100644
index 0000000..cfdfafe
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanaware/interfaces
@@ -0,0 +1,7 @@
+auto vmbr0
+iface vmbr0 inet manual
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
+	bridge-vids 2-4094
+	bridge-vlan-aware 1
diff --git a/test/zones/qinq/bridge_vlanaware/sdn_config b/test/zones/qinq/bridge_vlanaware/sdn_config
new file mode 100644
index 0000000..1708d4c
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanaware/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" } },
+             },
+}
diff --git a/test/zones/qinq/bridge_vlanaware_vlanawarevnet/expected_sdn_interfaces b/test/zones/qinq/bridge_vlanaware_vlanawarevnet/expected_sdn_interfaces
new file mode 100644
index 0000000..373eff2
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanaware_vlanawarevnet/expected_sdn_interfaces
@@ -0,0 +1,17 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	bridge_ports z_myzone.100
+	bridge_stp off
+	bridge_fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4094
+
+auto z_myzone
+iface z_myzone
+	bridge-stp off
+	bridge-ports vmbr0.10
+	bridge-fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4094
diff --git a/test/zones/qinq/bridge_vlanaware_vlanawarevnet/interfaces b/test/zones/qinq/bridge_vlanaware_vlanawarevnet/interfaces
new file mode 100644
index 0000000..cfdfafe
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanaware_vlanawarevnet/interfaces
@@ -0,0 +1,7 @@
+auto vmbr0
+iface vmbr0 inet manual
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
+	bridge-vids 2-4094
+	bridge-vlan-aware 1
diff --git a/test/zones/qinq/bridge_vlanaware_vlanawarevnet/sdn_config b/test/zones/qinq/bridge_vlanaware_vlanawarevnet/sdn_config
new file mode 100644
index 0000000..c013176
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanaware_vlanawarevnet/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", vlanaware => "1", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" } },
+             },
+}
diff --git a/test/zones/qinq/bridge_vlanaware_vlanprotocol/expected_sdn_interfaces b/test/zones/qinq/bridge_vlanaware_vlanprotocol/expected_sdn_interfaces
new file mode 100644
index 0000000..6bf2b12
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanaware_vlanprotocol/expected_sdn_interfaces
@@ -0,0 +1,19 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	bridge_ports z_myzone.100
+	bridge_stp off
+	bridge_fd 0
+
+auto vmbr0
+iface vmbr0
+	bridge-vlan-protocol 802.1ad
+
+auto z_myzone
+iface z_myzone
+	bridge-stp off
+	bridge-ports vmbr0.10
+	bridge-fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4094
diff --git a/test/zones/qinq/bridge_vlanaware_vlanprotocol/interfaces b/test/zones/qinq/bridge_vlanaware_vlanprotocol/interfaces
new file mode 100644
index 0000000..cfdfafe
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanaware_vlanprotocol/interfaces
@@ -0,0 +1,7 @@
+auto vmbr0
+iface vmbr0 inet manual
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
+	bridge-vids 2-4094
+	bridge-vlan-aware 1
diff --git a/test/zones/qinq/bridge_vlanaware_vlanprotocol/sdn_config b/test/zones/qinq/bridge_vlanaware_vlanprotocol/sdn_config
new file mode 100644
index 0000000..20a8a51
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanaware_vlanprotocol/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", tag => 10, 'vlan-protocol' => '802.1ad', ipam => "pve", type => "qinq" } },
+             },
+}
diff --git a/test/zones/qinq/bridge_vlanawarevnet/expected_sdn_interfaces b/test/zones/qinq/bridge_vlanawarevnet/expected_sdn_interfaces
new file mode 100644
index 0000000..ab7572e
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanawarevnet/expected_sdn_interfaces
@@ -0,0 +1,19 @@
+#version:1
+
+auto cv_myvnet
+iface cv_myvnet
+	vlan-raw-device sv_myvnet
+	vlan-id 100
+
+auto myvnet
+iface myvnet
+	bridge_ports  cv_myvnet
+	bridge_stp off
+	bridge_fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4094
+
+auto sv_myvnet
+iface sv_myvnet
+	vlan-raw-device eth0
+	vlan-id 10
diff --git a/test/zones/qinq/bridge_vlanawarevnet/interfaces b/test/zones/qinq/bridge_vlanawarevnet/interfaces
new file mode 100644
index 0000000..68b6a88
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanawarevnet/interfaces
@@ -0,0 +1,5 @@
+auto vmbr0
+iface vmbr0 inet manual
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
diff --git a/test/zones/qinq/bridge_vlanawarevnet/sdn_config b/test/zones/qinq/bridge_vlanawarevnet/sdn_config
new file mode 100644
index 0000000..c013176
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanawarevnet/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", vlanaware => "1", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" } },
+             },
+}
diff --git a/test/zones/qinq/bridge_vlanprotocol/expected_sdn_interfaces b/test/zones/qinq/bridge_vlanprotocol/expected_sdn_interfaces
new file mode 100644
index 0000000..460f1a5
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanprotocol/expected_sdn_interfaces
@@ -0,0 +1,18 @@
+#version:1
+
+auto cv_myvnet
+iface cv_myvnet
+	vlan-raw-device sv_myvnet
+	vlan-id 100
+
+auto myvnet
+iface myvnet
+	bridge_ports  cv_myvnet
+	bridge_stp off
+	bridge_fd 0
+
+auto sv_myvnet
+iface sv_myvnet
+	vlan-raw-device eth0
+	vlan-id 10
+	vlan-protocol 802.1ad
diff --git a/test/zones/qinq/bridge_vlanprotocol/interfaces b/test/zones/qinq/bridge_vlanprotocol/interfaces
new file mode 100644
index 0000000..68b6a88
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanprotocol/interfaces
@@ -0,0 +1,5 @@
+auto vmbr0
+iface vmbr0 inet manual
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
diff --git a/test/zones/qinq/bridge_vlanprotocol/sdn_config b/test/zones/qinq/bridge_vlanprotocol/sdn_config
new file mode 100644
index 0000000..20a8a51
--- /dev/null
+++ b/test/zones/qinq/bridge_vlanprotocol/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", tag => 10, 'vlan-protocol' => '802.1ad', ipam => "pve", type => "qinq" } },
+             },
+}
diff --git a/test/zones/qinq/ovs/expected_sdn_interfaces b/test/zones/qinq/ovs/expected_sdn_interfaces
new file mode 100644
index 0000000..71c7aa3
--- /dev/null
+++ b/test/zones/qinq/ovs/expected_sdn_interfaces
@@ -0,0 +1,25 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	bridge_ports z_myzone.100
+	bridge_stp off
+	bridge_fd 0
+
+auto sv_myzone
+iface sv_myzone
+	ovs_type OVSIntPort
+	ovs_bridge vmbr0
+	ovs_options vlan_mode=dot1q-tunnel tag=10 other_config:qinq-ethtype=802.1q
+
+auto vmbr0
+iface vmbr0
+	ovs_ports sv_myzone
+
+auto z_myzone
+iface z_myzone
+	bridge-stp off
+	bridge-ports sv_myzone
+	bridge-fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4094
diff --git a/test/zones/qinq/ovs/interfaces b/test/zones/qinq/ovs/interfaces
new file mode 100644
index 0000000..14d2f1e
--- /dev/null
+++ b/test/zones/qinq/ovs/interfaces
@@ -0,0 +1,9 @@
+auto eth0
+iface eth0 inet manual
+        ovs_type OVSPort
+        ovs_bridge vmbr0
+
+auto vmbr0
+iface vmbr0 inet manual
+        ovs_type OVSBridge
+        ovs_ports eth0
diff --git a/test/zones/qinq/ovs/sdn_config b/test/zones/qinq/ovs/sdn_config
new file mode 100644
index 0000000..1708d4c
--- /dev/null
+++ b/test/zones/qinq/ovs/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" } },
+             },
+}
diff --git a/test/zones/qinq/ovs_vlanawarevnet/expected_sdn_interfaces b/test/zones/qinq/ovs_vlanawarevnet/expected_sdn_interfaces
new file mode 100644
index 0000000..cf87ad1
--- /dev/null
+++ b/test/zones/qinq/ovs_vlanawarevnet/expected_sdn_interfaces
@@ -0,0 +1,27 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	bridge_ports z_myzone.100
+	bridge_stp off
+	bridge_fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4094
+
+auto sv_myzone
+iface sv_myzone
+	ovs_type OVSIntPort
+	ovs_bridge vmbr0
+	ovs_options vlan_mode=dot1q-tunnel tag=10 other_config:qinq-ethtype=802.1q
+
+auto vmbr0
+iface vmbr0
+	ovs_ports sv_myzone
+
+auto z_myzone
+iface z_myzone
+	bridge-stp off
+	bridge-ports sv_myzone
+	bridge-fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4094
diff --git a/test/zones/qinq/ovs_vlanawarevnet/interfaces b/test/zones/qinq/ovs_vlanawarevnet/interfaces
new file mode 100644
index 0000000..14d2f1e
--- /dev/null
+++ b/test/zones/qinq/ovs_vlanawarevnet/interfaces
@@ -0,0 +1,9 @@
+auto eth0
+iface eth0 inet manual
+        ovs_type OVSPort
+        ovs_bridge vmbr0
+
+auto vmbr0
+iface vmbr0 inet manual
+        ovs_type OVSBridge
+        ovs_ports eth0
diff --git a/test/zones/qinq/ovs_vlanawarevnet/sdn_config b/test/zones/qinq/ovs_vlanawarevnet/sdn_config
new file mode 100644
index 0000000..c013176
--- /dev/null
+++ b/test/zones/qinq/ovs_vlanawarevnet/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", vlanaware => "1", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" } },
+             },
+}
diff --git a/test/zones/qinq/ovs_vlanprotocol/expected_sdn_interfaces b/test/zones/qinq/ovs_vlanprotocol/expected_sdn_interfaces
new file mode 100644
index 0000000..10b59f8
--- /dev/null
+++ b/test/zones/qinq/ovs_vlanprotocol/expected_sdn_interfaces
@@ -0,0 +1,25 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	bridge_ports z_myzone.100
+	bridge_stp off
+	bridge_fd 0
+
+auto sv_myzone
+iface sv_myzone
+	ovs_type OVSIntPort
+	ovs_bridge vmbr0
+	ovs_options vlan_mode=dot1q-tunnel tag=10 other_config:qinq-ethtype=802.1ad
+
+auto vmbr0
+iface vmbr0
+	ovs_ports sv_myzone
+
+auto z_myzone
+iface z_myzone
+	bridge-stp off
+	bridge-ports sv_myzone
+	bridge-fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4094
diff --git a/test/zones/qinq/ovs_vlanprotocol/interfaces b/test/zones/qinq/ovs_vlanprotocol/interfaces
new file mode 100644
index 0000000..14d2f1e
--- /dev/null
+++ b/test/zones/qinq/ovs_vlanprotocol/interfaces
@@ -0,0 +1,9 @@
+auto eth0
+iface eth0 inet manual
+        ovs_type OVSPort
+        ovs_bridge vmbr0
+
+auto vmbr0
+iface vmbr0 inet manual
+        ovs_type OVSBridge
+        ovs_ports eth0
diff --git a/test/zones/qinq/ovs_vlanprotocol/sdn_config b/test/zones/qinq/ovs_vlanprotocol/sdn_config
new file mode 100644
index 0000000..20a8a51
--- /dev/null
+++ b/test/zones/qinq/ovs_vlanprotocol/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", tag => 10, 'vlan-protocol' => '802.1ad', ipam => "pve", type => "qinq" } },
+             },
+}
diff --git a/test/zones/simple/basic/expected_sdn_interfaces b/test/zones/simple/basic/expected_sdn_interfaces
new file mode 100644
index 0000000..1e0c2c7
--- /dev/null
+++ b/test/zones/simple/basic/expected_sdn_interfaces
@@ -0,0 +1,7 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	bridge_ports none
+	bridge_stp off
+	bridge_fd 0
diff --git a/test/zones/simple/basic/interfaces b/test/zones/simple/basic/interfaces
new file mode 100644
index 0000000..68b6a88
--- /dev/null
+++ b/test/zones/simple/basic/interfaces
@@ -0,0 +1,5 @@
+auto vmbr0
+iface vmbr0 inet manual
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
diff --git a/test/zones/simple/basic/sdn_config b/test/zones/simple/basic/sdn_config
new file mode 100644
index 0000000..527dcba
--- /dev/null
+++ b/test/zones/simple/basic/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { ipam => "pve", type => "simple" } },
+             },
+}
diff --git a/test/zones/simple/ipv4/expected_sdn_interfaces b/test/zones/simple/ipv4/expected_sdn_interfaces
new file mode 100644
index 0000000..d84075d
--- /dev/null
+++ b/test/zones/simple/ipv4/expected_sdn_interfaces
@@ -0,0 +1,8 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	address 192.168.0.1/24
+	bridge_ports none
+	bridge_stp off
+	bridge_fd 0
diff --git a/test/zones/simple/ipv4/interfaces b/test/zones/simple/ipv4/interfaces
new file mode 100644
index 0000000..68b6a88
--- /dev/null
+++ b/test/zones/simple/ipv4/interfaces
@@ -0,0 +1,5 @@
+auto vmbr0
+iface vmbr0 inet manual
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
diff --git a/test/zones/simple/ipv4/sdn_config b/test/zones/simple/ipv4/sdn_config
new file mode 100644
index 0000000..dd77b75
--- /dev/null
+++ b/test/zones/simple/ipv4/sdn_config
@@ -0,0 +1,22 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { ipam => "pve", type => "simple" } },
+             },
+
+  subnets => {
+              ids => { 'myzone-192.168.0.0-24' => {
+							'type' => 'subnet',
+							'vnet' => 'myvnet',
+							'gateway' => '192.168.0.1',
+						  }
+		     }
+	     }
+}
+
+
diff --git a/test/zones/simple/ipv4snat/expected_sdn_interfaces b/test/zones/simple/ipv4snat/expected_sdn_interfaces
new file mode 100644
index 0000000..c822af1
--- /dev/null
+++ b/test/zones/simple/ipv4snat/expected_sdn_interfaces
@@ -0,0 +1,12 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	address 10.0.0.1/24
+	post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j SNAT --to-source 192.168.0.1
+	post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j SNAT --to-source 192.168.0.1
+	post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
+	post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
+	bridge_ports none
+	bridge_stp off
+	bridge_fd 0
diff --git a/test/zones/simple/ipv4snat/interfaces b/test/zones/simple/ipv4snat/interfaces
new file mode 100644
index 0000000..66bb826
--- /dev/null
+++ b/test/zones/simple/ipv4snat/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/test/zones/simple/ipv4snat/sdn_config b/test/zones/simple/ipv4snat/sdn_config
new file mode 100644
index 0000000..5936d7d
--- /dev/null
+++ b/test/zones/simple/ipv4snat/sdn_config
@@ -0,0 +1,23 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { ipam => "pve", type => "simple" } },
+             },
+
+  subnets => {
+              ids => { 'myzone-10.0.0.0-24' => {
+							'type' => 'subnet',
+							'vnet' => 'myvnet',
+							'gateway' => '10.0.0.1',
+							'snat' => 1
+						  }
+		     }
+	     }
+}
+
+
diff --git a/test/zones/vlan/bridge/expected_sdn_interfaces b/test/zones/vlan/bridge/expected_sdn_interfaces
new file mode 100644
index 0000000..f9e96d1
--- /dev/null
+++ b/test/zones/vlan/bridge/expected_sdn_interfaces
@@ -0,0 +1,23 @@
+#version:1
+
+auto ln_myvnet
+iface ln_myvnet
+	link-type veth
+	veth-peer-name pr_myvnet
+
+auto myvnet
+iface myvnet
+	bridge_ports ln_myvnet
+	bridge_stp off
+	bridge_fd 0
+
+auto pr_myvnet
+iface pr_myvnet
+	link-type veth
+	veth-peer-name ln_myvnet
+
+auto vmbr0v100
+iface vmbr0v100
+	bridge_ports  eth0.100 pr_myvnet
+	bridge_stp off
+	bridge_fd 0
diff --git a/test/zones/vlan/bridge/interfaces b/test/zones/vlan/bridge/interfaces
new file mode 100644
index 0000000..68b6a88
--- /dev/null
+++ b/test/zones/vlan/bridge/interfaces
@@ -0,0 +1,5 @@
+auto vmbr0
+iface vmbr0 inet manual
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
diff --git a/test/zones/vlan/bridge/sdn_config b/test/zones/vlan/bridge/sdn_config
new file mode 100644
index 0000000..c6cfaaa
--- /dev/null
+++ b/test/zones/vlan/bridge/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } },
+             },
+}
diff --git a/test/zones/vlan/bridge_vlanaware/expected_sdn_interfaces b/test/zones/vlan/bridge_vlanaware/expected_sdn_interfaces
new file mode 100644
index 0000000..a318c7a
--- /dev/null
+++ b/test/zones/vlan/bridge_vlanaware/expected_sdn_interfaces
@@ -0,0 +1,7 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	bridge_ports vmbr0.100
+	bridge_stp off
+	bridge_fd 0
diff --git a/test/zones/vlan/bridge_vlanaware/interfaces b/test/zones/vlan/bridge_vlanaware/interfaces
new file mode 100644
index 0000000..cfdfafe
--- /dev/null
+++ b/test/zones/vlan/bridge_vlanaware/interfaces
@@ -0,0 +1,7 @@
+auto vmbr0
+iface vmbr0 inet manual
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
+	bridge-vids 2-4094
+	bridge-vlan-aware 1
diff --git a/test/zones/vlan/bridge_vlanaware/sdn_config b/test/zones/vlan/bridge_vlanaware/sdn_config
new file mode 100644
index 0000000..c6cfaaa
--- /dev/null
+++ b/test/zones/vlan/bridge_vlanaware/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } },
+             },
+}
diff --git a/test/zones/vlan/bridge_vlanaware_vlanawarevnet/expected_sdn_interfaces b/test/zones/vlan/bridge_vlanaware_vlanawarevnet/expected_sdn_interfaces
new file mode 100644
index 0000000..ebf9d2e
--- /dev/null
+++ b/test/zones/vlan/bridge_vlanaware_vlanawarevnet/expected_sdn_interfaces
@@ -0,0 +1,9 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	bridge_ports vmbr0.100
+	bridge_stp off
+	bridge_fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4094
diff --git a/test/zones/vlan/bridge_vlanaware_vlanawarevnet/interfaces b/test/zones/vlan/bridge_vlanaware_vlanawarevnet/interfaces
new file mode 100644
index 0000000..64eec9e
--- /dev/null
+++ b/test/zones/vlan/bridge_vlanaware_vlanawarevnet/interfaces
@@ -0,0 +1,7 @@
+auto vmbr0
+iface vmbr0 inet manual
+        bridge-ports eth0
+        bridge-stp off
+        bridge-fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4096
diff --git a/test/zones/vlan/bridge_vlanaware_vlanawarevnet/sdn_config b/test/zones/vlan/bridge_vlanaware_vlanawarevnet/sdn_config
new file mode 100644
index 0000000..67068f9
--- /dev/null
+++ b/test/zones/vlan/bridge_vlanaware_vlanawarevnet/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => "100", type => "vnet", vlanaware => 1, zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } },
+             },
+}
diff --git a/test/zones/vlan/ovs/expected_sdn_interfaces b/test/zones/vlan/ovs/expected_sdn_interfaces
new file mode 100644
index 0000000..044559e
--- /dev/null
+++ b/test/zones/vlan/ovs/expected_sdn_interfaces
@@ -0,0 +1,17 @@
+#version:1
+
+auto ln_myvnet
+iface ln_myvnet
+	ovs_type OVSIntPort
+	ovs_bridge vmbr0
+	ovs_options tag=100
+
+auto myvnet
+iface myvnet
+	bridge_ports ln_myvnet
+	bridge_stp off
+	bridge_fd 0
+
+auto vmbr0
+iface vmbr0
+	ovs_ports ln_myvnet
diff --git a/test/zones/vlan/ovs/interfaces b/test/zones/vlan/ovs/interfaces
new file mode 100644
index 0000000..14d2f1e
--- /dev/null
+++ b/test/zones/vlan/ovs/interfaces
@@ -0,0 +1,9 @@
+auto eth0
+iface eth0 inet manual
+        ovs_type OVSPort
+        ovs_bridge vmbr0
+
+auto vmbr0
+iface vmbr0 inet manual
+        ovs_type OVSBridge
+        ovs_ports eth0
diff --git a/test/zones/vlan/ovs/sdn_config b/test/zones/vlan/ovs/sdn_config
new file mode 100644
index 0000000..c6cfaaa
--- /dev/null
+++ b/test/zones/vlan/ovs/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } },
+             },
+}
diff --git a/test/zones/vlan/ovs_vlanware_vnet/expected_sdn_interfaces b/test/zones/vlan/ovs_vlanware_vnet/expected_sdn_interfaces
new file mode 100644
index 0000000..7bb73b6
--- /dev/null
+++ b/test/zones/vlan/ovs_vlanware_vnet/expected_sdn_interfaces
@@ -0,0 +1,19 @@
+#version:1
+
+auto ln_myvnet
+iface ln_myvnet
+	ovs_type OVSIntPort
+	ovs_bridge vmbr0
+	ovs_options vlan_mode=dot1q-tunnel other_config:qinq-ethtype=802.1q tag=100
+
+auto myvnet
+iface myvnet
+	bridge_ports ln_myvnet
+	bridge_stp off
+	bridge_fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4094
+
+auto vmbr0
+iface vmbr0
+	ovs_ports ln_myvnet
diff --git a/test/zones/vlan/ovs_vlanware_vnet/interfaces b/test/zones/vlan/ovs_vlanware_vnet/interfaces
new file mode 100644
index 0000000..14d2f1e
--- /dev/null
+++ b/test/zones/vlan/ovs_vlanware_vnet/interfaces
@@ -0,0 +1,9 @@
+auto eth0
+iface eth0 inet manual
+        ovs_type OVSPort
+        ovs_bridge vmbr0
+
+auto vmbr0
+iface vmbr0 inet manual
+        ovs_type OVSBridge
+        ovs_ports eth0
diff --git a/test/zones/vlan/ovs_vlanware_vnet/sdn_config b/test/zones/vlan/ovs_vlanware_vnet/sdn_config
new file mode 100644
index 0000000..9cfdb52
--- /dev/null
+++ b/test/zones/vlan/ovs_vlanware_vnet/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", vlanaware => "1", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } },
+             },
+}
diff --git a/test/zones/vxlan/basic/expected_sdn_interfaces b/test/zones/vxlan/basic/expected_sdn_interfaces
new file mode 100644
index 0000000..7b73c3e
--- /dev/null
+++ b/test/zones/vxlan/basic/expected_sdn_interfaces
@@ -0,0 +1,15 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	bridge_ports vxlan_myvnet
+	bridge_stp off
+	bridge_fd 0
+	mtu 1450
+
+auto vxlan_myvnet
+iface vxlan_myvnet
+	vxlan-id 100
+	vxlan_remoteip 192.168.0.2
+	vxlan_remoteip 192.168.0.3
+	mtu 1450
diff --git a/test/zones/vxlan/basic/interfaces b/test/zones/vxlan/basic/interfaces
new file mode 100644
index 0000000..66bb826
--- /dev/null
+++ b/test/zones/vxlan/basic/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/test/zones/vxlan/basic/sdn_config b/test/zones/vxlan/basic/sdn_config
new file mode 100644
index 0000000..f929304
--- /dev/null
+++ b/test/zones/vxlan/basic/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { ipam => "pve", type => "vxlan", peers => "192.168.0.1,192.168.0.2,192.168.0.3" } },
+             },
+}
diff --git a/test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces b/test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces
new file mode 100644
index 0000000..55cdf9c
--- /dev/null
+++ b/test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces
@@ -0,0 +1,17 @@
+#version:1
+
+auto myvnet
+iface myvnet
+	bridge_ports vxlan_myvnet
+	bridge_stp off
+	bridge_fd 0
+	bridge-vlan-aware yes
+	bridge-vids 2-4094
+	mtu 1450
+
+auto vxlan_myvnet
+iface vxlan_myvnet
+	vxlan-id 100
+	vxlan_remoteip 192.168.0.2
+	vxlan_remoteip 192.168.0.3
+	mtu 1450
diff --git a/test/zones/vxlan/vlanawarevnet/interfaces b/test/zones/vxlan/vlanawarevnet/interfaces
new file mode 100644
index 0000000..66bb826
--- /dev/null
+++ b/test/zones/vxlan/vlanawarevnet/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/test/zones/vxlan/vlanawarevnet/sdn_config b/test/zones/vxlan/vlanawarevnet/sdn_config
new file mode 100644
index 0000000..23fb557
--- /dev/null
+++ b/test/zones/vxlan/vlanawarevnet/sdn_config
@@ -0,0 +1,11 @@
+{
+  version => 1,
+  vnets   => {
+               ids => {
+                        myvnet => { tag => 100, type => "vnet", vlanaware => "1", zone => "myzone" },
+                      },
+             },
+  zones   => {
+               ids => { myzone => { ipam => "pve", type => "vxlan", peers => "192.168.0.1,192.168.0.2,192.168.0.3" } },
+             },
+}
-- 
2.20.1





More information about the pve-devel mailing list