[pve-devel] [PATCH pve-common 1/2] INotify : fix OVSBond && OvsintPort order + tests

Alexandre Derumier aderumier at odiso.com
Tue Feb 18 06:33:46 CET 2020


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 55ff969..6e6ab53 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -1617,12 +1617,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 700eeef..4dca801 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'));
@@ -70,6 +72,10 @@ iface eth2 inet manual
 
 iface eth3 inet manual
 
+iface eth4 inet manual
+
+iface eth5 inet manual
+
 $vmbr0_part
 
 CHECK
@@ -111,6 +117,10 @@ iface eth2 inet manual
 
 iface eth3 inet manual
 
+iface eth4 inet manual
+
+iface eth5 inet manual
+
 $bond0_part
 
 $vmbr0_part
@@ -165,6 +175,10 @@ iface eth2 inet manual
 
 iface eth3 inet manual
 
+iface eth4 inet manual
+
+iface eth5 inet manual
+
 $bond0_part
 
 $vmbr0_part
@@ -278,6 +292,10 @@ iface eth2 inet manual
 
 iface eth3 inet manual
 
+iface eth4 inet manual
+
+iface eth5 inet manual
+
 $bond0_part
 
 $vmbr0_part
@@ -347,6 +365,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
 
@@ -358,12 +406,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
@@ -391,6 +458,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
@@ -442,6 +515,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
-- 
2.20.1



More information about the pve-devel mailing list