]>
git.proxmox.com Git - pve-common.git/blob - test/etc_network_interfaces/t.ovs_bridge_allow.pl
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 and remove
52 # its autostart property.
53 update_iface
('vmbr0', [], ovs_ports
=> 'eth1 eth2');
54 expect load
('loopback') . <<"/etc/network/interfaces";
56 iface eth0 inet manual
59 iface eth1 inet manual
64 iface eth2 inet manual
68 iface eth3 inet manual
71 iface vmbr0 inet static
78 /etc/network
/interfaces
80 # Idempotency - make sure "allow-$BRIDGE $IFACE" don't get duplicated
81 # they're stripped from $config->{options} at load-time since they're
82 # auto-generated when writing OVSPorts.
87 # Removing an ovs_port also has to remove the corresponding allow- line!
88 # Also remember that adding interfaces to the ovs bridge removed their
89 # autostart property, so eth2 is now without an autostart!
90 update_iface
('vmbr0', [], ovs_ports
=> 'eth1');
91 # eth2 is now autoremoved and thus loses its priority, so it appears after eth3
92 expect load
('loopback') . <<"/etc/network/interfaces";
94 iface eth0 inet manual
97 iface eth1 inet manual
101 iface eth3 inet manual
103 iface eth2 inet manual
106 iface vmbr0 inet static
113 /etc/network
/interfaces