From 36bbe29db8a6997ac7877f0b9bdb331e71a51309 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Tue, 18 Feb 2020 06:33:46 +0100 Subject: [PATCH] INotify : fix OVSBond && OvsintPort order + tests OVSBond was missing OvsintPort under ethx interfaces --- src/PVE/INotify.pm | 13 ++-- .../t.create_network.pl | 77 +++++++++++++++++++ 2 files changed, 84 insertions(+), 6 deletions(-) diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm index 5fdd050..d0d9ba6 100644 --- a/src/PVE/INotify.pm +++ b/src/PVE/INotify.pm @@ -1601,12 +1601,13 @@ NETWORKDOC loopback => 100000, eth => 200000, OVSPort => 200000, - OVSIntPort => 200000, - bond => 300000, - bridge => 400000, - OVSBridge => 400000, - vlan => 500000, - vxlan => 500000, + OVSIntPort => 300000, + OVSBond => 400000, + bond => 400000, + bridge => 500000, + OVSBridge => 500000, + vlan => 600000, + vxlan => 600000, }; my $lookup_type_prio = sub { diff --git a/test/etc_network_interfaces/t.create_network.pl b/test/etc_network_interfaces/t.create_network.pl index 7705070..9bb26bd 100644 --- a/test/etc_network_interfaces/t.create_network.pl +++ b/test/etc_network_interfaces/t.create_network.pl @@ -3,6 +3,8 @@ eth0: eth1: eth2: eth3: +eth4: +eth5: /proc/net/dev r(load('brbase')); @@ -66,6 +68,10 @@ iface eth2 inet manual iface eth3 inet manual +iface eth4 inet manual + +iface eth5 inet manual + $vmbr0_part CHECK @@ -107,6 +113,10 @@ iface eth2 inet manual iface eth3 inet manual +iface eth4 inet manual + +iface eth5 inet manual + $bond0_part $vmbr0_part @@ -161,6 +171,10 @@ iface eth2 inet manual iface eth3 inet manual +iface eth4 inet manual + +iface eth5 inet manual + $bond0_part $vmbr0_part @@ -274,6 +288,10 @@ iface eth2 inet manual iface eth3 inet manual +iface eth4 inet manual + +iface eth5 inet manual + $bond0_part $vmbr0_part @@ -343,6 +361,36 @@ $config->{ifaces}->{'vmbr5'} = { autostart => 1 }; +$config->{ifaces}->{vmbr6} = { + ovs_mtu => 1400, + type => 'OVSBridge', + ovs_ports => 'bond1 ovsintvlan', + method => 'manual', + families => ['inet'], + autostart => 1 +}; + +$config->{ifaces}->{bond1} = { + ovs_mtu => 1300, + type => 'OVSBond', + ovs_bridge => 'vmbr6', + ovs_bonds => 'eth4 eth5', + ovs_options => 'bond_mode=active-backup', + method => 'manual', + families => ['inet'], + autostart => 1 +}; + +$config->{ifaces}->{ovsintvlan} = { + ovs_mtu => 1300, + type => 'OVSIntPort', + ovs_bridge => 'vmbr6', + ovs_options => 'tag=14', + method => 'manual', + families => ['inet'], + autostart => 1 +}; + expect load('loopback') . <<"CHECK"; source-directory interfaces.d @@ -354,12 +402,31 @@ iface eth2 inet manual iface eth3 inet manual +iface eth4 inet manual + +iface eth5 inet manual + auto eth1.100 iface eth1.100 inet manual mtu 1400 +allow-vmbr6 ovsintvlan +iface ovsintvlan inet manual + ovs_type OVSIntPort + ovs_bridge vmbr6 + ovs_mtu 1300 + ovs_options tag=14 + $bond0_part +allow-vmbr6 bond1 +iface bond1 inet manual + ovs_bonds eth4 eth5 + ovs_type OVSBond + ovs_bridge vmbr6 + ovs_mtu 1300 + ovs_options bond_mode=active-backup + auto bond0.100 iface bond0.100 inet manual mtu 1300 @@ -387,6 +454,12 @@ iface vmbr5 inet manual bridge-fd 0 mtu 1100 +allow-ovs vmbr6 +iface vmbr6 inet manual + ovs_type OVSBridge + ovs_ports bond1 ovsintvlan + ovs_mtu 1400 + auto vmbr1.100 iface vmbr1.100 inet manual mtu 1300 @@ -437,6 +510,10 @@ iface eth2 inet manual iface eth3 inet manual +iface eth4 inet manual + +iface eth5 inet manual + auto vmbr0 iface vmbr0 inet static address 10.0.0.2/24 -- 2.39.2