]>
git.proxmox.com Git - pve-common.git/blob - test/etc_network_interfaces/t.ovs_bridge_allow.pl
7a0b8cec7103d42b52220079703d321da16933b5
3 my $ip = '192.168.0.100';
4 my $nm = '255.255.255.0';
5 my $gw = '192.168.0.1';
7 # replace proc_net_dev with one with a bunch of interfaces
8 save
('proc_net_dev', <<'/proc/net/dev');
17 new_iface
('vmbr0', 'OVSBridge',
24 update_iface
('eth0', [], autostart
=> 1);
25 update_iface
('eth1', [], autostart
=> 1);
26 update_iface
('eth2', [], autostart
=> 1);
27 #update_iface('eth3', [], autostart => 1);
29 # Check the bridge and eth interfaces
30 expect load
('loopback') . <<"/etc/network/interfaces";
32 iface eth0 inet manual
35 iface eth1 inet manual
38 iface eth2 inet manual
40 iface eth3 inet manual
43 iface vmbr0 inet static
49 /etc/network
/interfaces
51 # Adding an interface to the bridge needs to add allow- lines:
52 update_iface
('vmbr0', [], ovs_ports
=> 'eth1 eth2');
53 expect load
('loopback') . <<"/etc/network/interfaces";
55 iface eth0 inet manual
59 iface eth1 inet manual
65 iface eth2 inet manual
69 iface eth3 inet manual
72 iface vmbr0 inet static
79 /etc/network
/interfaces
81 # Idempotency - make sure "allow-$BRIDGE $IFACE" don't get duplicated
82 # they're stripped from $config->{options} at load-time since they're
83 # auto-generated when writing OVSPorts.
88 # Removing an ovs_port also has to remove the corresponding allow- line!
89 # Also remember that adding interfaces to the ovs bridge removed their
90 # autostart property, so eth2 is now without an autostart!
91 update_iface
('vmbr0', [], ovs_ports
=> 'eth1');
92 # eth2 is now autoremoved and thus loses its priority, so it appears after eth3
93 expect load
('loopback') . <<"/etc/network/interfaces";
95 iface eth0 inet manual
98 iface eth1 inet manual
102 iface eth3 inet manual
104 iface eth2 inet manual
107 iface vmbr0 inet static
114 /etc/network
/interfaces