mirror of
https://git.proxmox.com/git/pve-network
synced 2025-04-28 16:31:16 +00:00
add zones && controllers unit tests
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
9cef13e929
commit
82f6b09f93
6
Makefile
6
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:
|
||||
|
6
test/Makefile
Normal file
6
test/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
all: test
|
||||
|
||||
test: test_zones
|
||||
|
||||
test_zones: run_test_zones.pl
|
||||
./run_test_zones.pl
|
124
test/run_test_zones.pl
Executable file
124
test/run_test_zones.pl
Executable file
@ -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();
|
||||
|
||||
|
49
test/zones/evpn/ebgp/expected_controller_config
Normal file
49
test/zones/evpn/ebgp/expected_controller_config
Normal file
@ -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
|
||||
!
|
38
test/zones/evpn/ebgp/expected_sdn_interfaces
Normal file
38
test/zones/evpn/ebgp/expected_sdn_interfaces
Normal file
@ -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
|
7
test/zones/evpn/ebgp/interfaces
Normal file
7
test/zones/evpn/ebgp/interfaces
Normal file
@ -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
|
29
test/zones/evpn/ebgp/sdn_config
Normal file
29
test/zones/evpn/ebgp/sdn_config
Normal file
@ -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',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
53
test/zones/evpn/ebgp_loopback/expected_controller_config
Normal file
53
test/zones/evpn/ebgp_loopback/expected_controller_config
Normal file
@ -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
|
||||
!
|
38
test/zones/evpn/ebgp_loopback/expected_sdn_interfaces
Normal file
38
test/zones/evpn/ebgp_loopback/expected_sdn_interfaces
Normal file
@ -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
|
13
test/zones/evpn/ebgp_loopback/interfaces
Normal file
13
test/zones/evpn/ebgp_loopback/interfaces
Normal file
@ -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
|
||||
|
29
test/zones/evpn/ebgp_loopback/sdn_config
Normal file
29
test/zones/evpn/ebgp_loopback/sdn_config
Normal file
@ -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',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
52
test/zones/evpn/exitnode/expected_controller_config
Normal file
52
test/zones/evpn/exitnode/expected_controller_config
Normal file
@ -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
|
||||
!
|
38
test/zones/evpn/exitnode/expected_sdn_interfaces
Normal file
38
test/zones/evpn/exitnode/expected_sdn_interfaces
Normal file
@ -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
|
7
test/zones/evpn/exitnode/interfaces
Normal file
7
test/zones/evpn/exitnode/interfaces
Normal file
@ -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
|
26
test/zones/evpn/exitnode/sdn_config
Normal file
26
test/zones/evpn/exitnode/sdn_config
Normal file
@ -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',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
52
test/zones/evpn/exitnode_snat/expected_controller_config
Normal file
52
test/zones/evpn/exitnode_snat/expected_controller_config
Normal file
@ -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
|
||||
!
|
42
test/zones/evpn/exitnode_snat/expected_sdn_interfaces
Normal file
42
test/zones/evpn/exitnode_snat/expected_sdn_interfaces
Normal file
@ -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
|
7
test/zones/evpn/exitnode_snat/interfaces
Normal file
7
test/zones/evpn/exitnode_snat/interfaces
Normal file
@ -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
|
27
test/zones/evpn/exitnode_snat/sdn_config
Normal file
27
test/zones/evpn/exitnode_snat/sdn_config
Normal file
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
31
test/zones/evpn/ipv4/expected_controller_config
Normal file
31
test/zones/evpn/ipv4/expected_controller_config
Normal file
@ -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
|
||||
!
|
38
test/zones/evpn/ipv4/expected_sdn_interfaces
Normal file
38
test/zones/evpn/ipv4/expected_sdn_interfaces
Normal file
@ -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
|
7
test/zones/evpn/ipv4/interfaces
Normal file
7
test/zones/evpn/ipv4/interfaces
Normal file
@ -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
|
26
test/zones/evpn/ipv4/sdn_config
Normal file
26
test/zones/evpn/ipv4/sdn_config
Normal file
@ -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',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
17
test/zones/qinq/bridge/expected_sdn_interfaces
Normal file
17
test/zones/qinq/bridge/expected_sdn_interfaces
Normal file
@ -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
|
5
test/zones/qinq/bridge/interfaces
Normal file
5
test/zones/qinq/bridge/interfaces
Normal file
@ -0,0 +1,5 @@
|
||||
auto vmbr0
|
||||
iface vmbr0 inet manual
|
||||
bridge-ports eth0
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
11
test/zones/qinq/bridge/sdn_config
Normal file
11
test/zones/qinq/bridge/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
15
test/zones/qinq/bridge_vlanaware/expected_sdn_interfaces
Normal file
15
test/zones/qinq/bridge_vlanaware/expected_sdn_interfaces
Normal file
@ -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
|
7
test/zones/qinq/bridge_vlanaware/interfaces
Normal file
7
test/zones/qinq/bridge_vlanaware/interfaces
Normal file
@ -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
|
11
test/zones/qinq/bridge_vlanaware/sdn_config
Normal file
11
test/zones/qinq/bridge_vlanaware/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
@ -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
|
@ -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
|
11
test/zones/qinq/bridge_vlanaware_vlanawarevnet/sdn_config
Normal file
11
test/zones/qinq/bridge_vlanaware_vlanawarevnet/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
@ -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
|
7
test/zones/qinq/bridge_vlanaware_vlanprotocol/interfaces
Normal file
7
test/zones/qinq/bridge_vlanaware_vlanprotocol/interfaces
Normal file
@ -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
|
11
test/zones/qinq/bridge_vlanaware_vlanprotocol/sdn_config
Normal file
11
test/zones/qinq/bridge_vlanaware_vlanprotocol/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
19
test/zones/qinq/bridge_vlanawarevnet/expected_sdn_interfaces
Normal file
19
test/zones/qinq/bridge_vlanawarevnet/expected_sdn_interfaces
Normal file
@ -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
|
5
test/zones/qinq/bridge_vlanawarevnet/interfaces
Normal file
5
test/zones/qinq/bridge_vlanawarevnet/interfaces
Normal file
@ -0,0 +1,5 @@
|
||||
auto vmbr0
|
||||
iface vmbr0 inet manual
|
||||
bridge-ports eth0
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
11
test/zones/qinq/bridge_vlanawarevnet/sdn_config
Normal file
11
test/zones/qinq/bridge_vlanawarevnet/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
18
test/zones/qinq/bridge_vlanprotocol/expected_sdn_interfaces
Normal file
18
test/zones/qinq/bridge_vlanprotocol/expected_sdn_interfaces
Normal file
@ -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
|
5
test/zones/qinq/bridge_vlanprotocol/interfaces
Normal file
5
test/zones/qinq/bridge_vlanprotocol/interfaces
Normal file
@ -0,0 +1,5 @@
|
||||
auto vmbr0
|
||||
iface vmbr0 inet manual
|
||||
bridge-ports eth0
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
11
test/zones/qinq/bridge_vlanprotocol/sdn_config
Normal file
11
test/zones/qinq/bridge_vlanprotocol/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
25
test/zones/qinq/ovs/expected_sdn_interfaces
Normal file
25
test/zones/qinq/ovs/expected_sdn_interfaces
Normal file
@ -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
|
9
test/zones/qinq/ovs/interfaces
Normal file
9
test/zones/qinq/ovs/interfaces
Normal file
@ -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
|
11
test/zones/qinq/ovs/sdn_config
Normal file
11
test/zones/qinq/ovs/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
27
test/zones/qinq/ovs_vlanawarevnet/expected_sdn_interfaces
Normal file
27
test/zones/qinq/ovs_vlanawarevnet/expected_sdn_interfaces
Normal file
@ -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
|
9
test/zones/qinq/ovs_vlanawarevnet/interfaces
Normal file
9
test/zones/qinq/ovs_vlanawarevnet/interfaces
Normal file
@ -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
|
11
test/zones/qinq/ovs_vlanawarevnet/sdn_config
Normal file
11
test/zones/qinq/ovs_vlanawarevnet/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
25
test/zones/qinq/ovs_vlanprotocol/expected_sdn_interfaces
Normal file
25
test/zones/qinq/ovs_vlanprotocol/expected_sdn_interfaces
Normal file
@ -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
|
9
test/zones/qinq/ovs_vlanprotocol/interfaces
Normal file
9
test/zones/qinq/ovs_vlanprotocol/interfaces
Normal file
@ -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
|
11
test/zones/qinq/ovs_vlanprotocol/sdn_config
Normal file
11
test/zones/qinq/ovs_vlanprotocol/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
7
test/zones/simple/basic/expected_sdn_interfaces
Normal file
7
test/zones/simple/basic/expected_sdn_interfaces
Normal file
@ -0,0 +1,7 @@
|
||||
#version:1
|
||||
|
||||
auto myvnet
|
||||
iface myvnet
|
||||
bridge_ports none
|
||||
bridge_stp off
|
||||
bridge_fd 0
|
5
test/zones/simple/basic/interfaces
Normal file
5
test/zones/simple/basic/interfaces
Normal file
@ -0,0 +1,5 @@
|
||||
auto vmbr0
|
||||
iface vmbr0 inet manual
|
||||
bridge-ports eth0
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
11
test/zones/simple/basic/sdn_config
Normal file
11
test/zones/simple/basic/sdn_config
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
version => 1,
|
||||
vnets => {
|
||||
ids => {
|
||||
myvnet => { type => "vnet", zone => "myzone" },
|
||||
},
|
||||
},
|
||||
zones => {
|
||||
ids => { myzone => { ipam => "pve", type => "simple" } },
|
||||
},
|
||||
}
|
8
test/zones/simple/ipv4/expected_sdn_interfaces
Normal file
8
test/zones/simple/ipv4/expected_sdn_interfaces
Normal file
@ -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
|
5
test/zones/simple/ipv4/interfaces
Normal file
5
test/zones/simple/ipv4/interfaces
Normal file
@ -0,0 +1,5 @@
|
||||
auto vmbr0
|
||||
iface vmbr0 inet manual
|
||||
bridge-ports eth0
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
22
test/zones/simple/ipv4/sdn_config
Normal file
22
test/zones/simple/ipv4/sdn_config
Normal file
@ -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',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
12
test/zones/simple/ipv4snat/expected_sdn_interfaces
Normal file
12
test/zones/simple/ipv4snat/expected_sdn_interfaces
Normal file
@ -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
|
7
test/zones/simple/ipv4snat/interfaces
Normal file
7
test/zones/simple/ipv4snat/interfaces
Normal file
@ -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
|
23
test/zones/simple/ipv4snat/sdn_config
Normal file
23
test/zones/simple/ipv4snat/sdn_config
Normal file
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
23
test/zones/vlan/bridge/expected_sdn_interfaces
Normal file
23
test/zones/vlan/bridge/expected_sdn_interfaces
Normal file
@ -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
|
5
test/zones/vlan/bridge/interfaces
Normal file
5
test/zones/vlan/bridge/interfaces
Normal file
@ -0,0 +1,5 @@
|
||||
auto vmbr0
|
||||
iface vmbr0 inet manual
|
||||
bridge-ports eth0
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
11
test/zones/vlan/bridge/sdn_config
Normal file
11
test/zones/vlan/bridge/sdn_config
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
version => 1,
|
||||
vnets => {
|
||||
ids => {
|
||||
myvnet => { tag => 100, type => "vnet", zone => "myzone" },
|
||||
},
|
||||
},
|
||||
zones => {
|
||||
ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } },
|
||||
},
|
||||
}
|
7
test/zones/vlan/bridge_vlanaware/expected_sdn_interfaces
Normal file
7
test/zones/vlan/bridge_vlanaware/expected_sdn_interfaces
Normal file
@ -0,0 +1,7 @@
|
||||
#version:1
|
||||
|
||||
auto myvnet
|
||||
iface myvnet
|
||||
bridge_ports vmbr0.100
|
||||
bridge_stp off
|
||||
bridge_fd 0
|
7
test/zones/vlan/bridge_vlanaware/interfaces
Normal file
7
test/zones/vlan/bridge_vlanaware/interfaces
Normal file
@ -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
|
11
test/zones/vlan/bridge_vlanaware/sdn_config
Normal file
11
test/zones/vlan/bridge_vlanaware/sdn_config
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
version => 1,
|
||||
vnets => {
|
||||
ids => {
|
||||
myvnet => { tag => 100, type => "vnet", zone => "myzone" },
|
||||
},
|
||||
},
|
||||
zones => {
|
||||
ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } },
|
||||
},
|
||||
}
|
@ -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
|
@ -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
|
11
test/zones/vlan/bridge_vlanaware_vlanawarevnet/sdn_config
Normal file
11
test/zones/vlan/bridge_vlanaware_vlanawarevnet/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
17
test/zones/vlan/ovs/expected_sdn_interfaces
Normal file
17
test/zones/vlan/ovs/expected_sdn_interfaces
Normal file
@ -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
|
9
test/zones/vlan/ovs/interfaces
Normal file
9
test/zones/vlan/ovs/interfaces
Normal file
@ -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
|
11
test/zones/vlan/ovs/sdn_config
Normal file
11
test/zones/vlan/ovs/sdn_config
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
version => 1,
|
||||
vnets => {
|
||||
ids => {
|
||||
myvnet => { tag => 100, type => "vnet", zone => "myzone" },
|
||||
},
|
||||
},
|
||||
zones => {
|
||||
ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } },
|
||||
},
|
||||
}
|
19
test/zones/vlan/ovs_vlanware_vnet/expected_sdn_interfaces
Normal file
19
test/zones/vlan/ovs_vlanware_vnet/expected_sdn_interfaces
Normal file
@ -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
|
9
test/zones/vlan/ovs_vlanware_vnet/interfaces
Normal file
9
test/zones/vlan/ovs_vlanware_vnet/interfaces
Normal file
@ -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
|
11
test/zones/vlan/ovs_vlanware_vnet/sdn_config
Normal file
11
test/zones/vlan/ovs_vlanware_vnet/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
15
test/zones/vxlan/basic/expected_sdn_interfaces
Normal file
15
test/zones/vxlan/basic/expected_sdn_interfaces
Normal file
@ -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
|
7
test/zones/vxlan/basic/interfaces
Normal file
7
test/zones/vxlan/basic/interfaces
Normal file
@ -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
|
11
test/zones/vxlan/basic/sdn_config
Normal file
11
test/zones/vxlan/basic/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
17
test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces
Normal file
17
test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces
Normal file
@ -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
|
7
test/zones/vxlan/vlanawarevnet/interfaces
Normal file
7
test/zones/vxlan/vlanawarevnet/interfaces
Normal file
@ -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
|
11
test/zones/vxlan/vlanawarevnet/sdn_config
Normal file
11
test/zones/vxlan/vlanawarevnet/sdn_config
Normal file
@ -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" } },
|
||||
},
|
||||
}
|
Loading…
Reference in New Issue
Block a user