]> git.proxmox.com Git - pve-common.git/commitdiff
network tests: switch to ifupdown2
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 21 Dec 2023 15:30:22 +0000 (16:30 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 3 Jan 2024 11:14:43 +0000 (12:14 +0100)
adapt allow-* to auto, and drop the one test where behaviour is not testable
anymore.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
test/etc_network_interfaces/runtest.pl
test/etc_network_interfaces/t.bridge_eth_remove_auto.pl [deleted file]
test/etc_network_interfaces/t.create_network.pl
test/etc_network_interfaces/t.ovs_bridge_allow.pl

index f92f5aeb2d4f5488f980d69817cdee2d4e107b43..10fafae15fcdbdbf0ff51c0a8685b1ac87075373 100755 (executable)
@@ -78,7 +78,7 @@ sub r($;$$) {
 sub w() {
     # write shouldn't be able to change a previously parsed config
     my $config_clone = dclone($config);
-    return PVE::INotify::__write_etc_network_interfaces($config_clone);
+    return PVE::INotify::__write_etc_network_interfaces($config_clone, 1);
 }
 
 ##
diff --git a/test/etc_network_interfaces/t.bridge_eth_remove_auto.pl b/test/etc_network_interfaces/t.bridge_eth_remove_auto.pl
deleted file mode 100644 (file)
index 98f5df8..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-use strict;
-
-# access to the current config
-our $config;
-
-# replace proc_net_dev with one with a bunch of interfaces
-save('proc_net_dev', <<'/proc/net/dev');
-eth0:
-eth1:
-/proc/net/dev
-
-r('');
-update_iface('eth0', [], autostart => 1);
-update_iface('eth1', [], autostart => 1);
-r(w());
-die "autostart lost" if !$config->{ifaces}->{eth0}->{autostart};
-die "autostart lost" if !$config->{ifaces}->{eth1}->{autostart};
-new_iface("vmbr0", 'bridge', [{ family => 'inet' }], bridge_ports => 'eth0');
-new_iface("vmbr1", 'OVSBridge', [{ family => 'inet' }], ovs_ports => 'eth1');
-r(w());
-die "autostart wrongly removed for linux bridge port" if !$config->{ifaces}->{eth0}->{autostart};
-die "autostart not removed for ovs bridge port" if $config->{ifaces}->{eth1}->{autostart};
-
-1;
index b8da5137bba162526fce2ceb66e02a4020851df9..6aad74c26b0b3835f56ac88ce1178f8b1bd2ff79 100644 (file)
@@ -420,7 +420,7 @@ auto eth1.100
 iface eth1.100 inet manual
        mtu 1400
 
-allow-vmbr6 ovsintvlan
+auto ovsintvlan
 iface ovsintvlan inet manual
        ovs_type OVSIntPort
        ovs_bridge vmbr6
@@ -429,7 +429,7 @@ iface ovsintvlan inet manual
 
 $bond0_part
 
-allow-vmbr6 bond1
+auto bond1
 iface bond1 inet manual
        ovs_bonds eth4 eth5
        ovs_type OVSBond
@@ -464,7 +464,7 @@ iface vmbr5 inet manual
        bridge-fd 0
        mtu 1100
 
-allow-ovs vmbr6
+auto vmbr6
 iface vmbr6 inet manual
        ovs_type OVSBridge
        ovs_ports bond1 ovsintvlan
index 9479ff5af1862d0139ae351f76cb13a91ddf3b09..742c9efa3d50355ea2ef5dfa14b1ce18534f3e87 100644 (file)
@@ -37,7 +37,7 @@ iface eth2 inet manual
 
 iface eth3 inet manual
 
-allow-ovs vmbr0
+auto vmbr0
 iface vmbr0 inet static
        address $ip
        gateway $gw
@@ -52,19 +52,19 @@ expect load('loopback') . <<"/etc/network/interfaces";
 auto eth0
 iface eth0 inet manual
 
-allow-vmbr0 eth1
+auto eth1
 iface eth1 inet manual
        ovs_type OVSPort
        ovs_bridge vmbr0
 
-allow-vmbr0 eth2
+auto eth2
 iface eth2 inet manual
        ovs_type OVSPort
        ovs_bridge vmbr0
 
 iface eth3 inet manual
 
-allow-ovs vmbr0
+auto vmbr0
 iface vmbr0 inet static
        address $ip
        gateway $gw
@@ -89,7 +89,7 @@ expect load('loopback') . <<"/etc/network/interfaces";
 auto eth0
 iface eth0 inet manual
 
-allow-vmbr0 eth1
+auto eth1
 iface eth1 inet manual
        ovs_type OVSPort
        ovs_bridge vmbr0
@@ -98,7 +98,7 @@ iface eth3 inet manual
 
 iface eth2 inet manual
 
-allow-ovs vmbr0
+auto vmbr0
 iface vmbr0 inet static
        address $ip
        gateway $gw