]>
git.proxmox.com Git - pve-common.git/blob - test/etc_network_interfaces/t.ovs_bridge_allow.pl
3 my $ip = '192.168.0.100/24';
4 my $gw = '192.168.0.1';
6 # replace proc_net_dev with one with a bunch of interfaces
7 save
('proc_net_dev', <<'/proc/net/dev');
16 new_iface
('vmbr0', 'OVSBridge',
22 update_iface
('eth0', [], autostart
=> 1);
23 update_iface
('eth1', [], autostart
=> 1);
24 update_iface
('eth2', [], autostart
=> 1);
25 #update_iface('eth3', [], autostart => 1);
27 # Check the bridge and eth interfaces
28 expect load
('loopback') . <<"/etc/network/interfaces";
30 iface eth0 inet manual
33 iface eth1 inet manual
36 iface eth2 inet manual
38 iface eth3 inet manual
41 iface vmbr0 inet static
46 /etc/network
/interfaces
48 # Adding an interface to the bridge needs to add allow- lines and remove
49 # its autostart property.
50 update_iface
('vmbr0', [], ovs_ports
=> 'eth1 eth2');
51 expect load
('loopback') . <<"/etc/network/interfaces";
53 iface eth0 inet manual
56 iface eth1 inet manual
61 iface eth2 inet manual
65 iface eth3 inet manual
68 iface vmbr0 inet static
74 /etc/network
/interfaces
76 # Idempotency - make sure "allow-$BRIDGE $IFACE" don't get duplicated
77 # they're stripped from $config->{options} at load-time since they're
78 # auto-generated when writing OVSPorts.
83 # Removing an ovs_port also has to remove the corresponding allow- line!
84 # Also remember that adding interfaces to the ovs bridge removed their
85 # autostart property, so eth2 is now without an autostart!
86 update_iface
('vmbr0', [], ovs_ports
=> 'eth1');
87 # eth2 is now autoremoved and thus loses its priority, so it appears after eth3
88 expect load
('loopback') . <<"/etc/network/interfaces";
90 iface eth0 inet manual
93 iface eth1 inet manual
97 iface eth3 inet manual
99 iface eth2 inet manual
102 iface vmbr0 inet static
108 /etc/network
/interfaces