]>
Commit | Line | Data |
---|---|---|
1 | use strict; | |
2 | ||
3 | # access to the current config | |
4 | our $config; | |
5 | ||
6 | # replace proc_net_dev with one with a bunch of interfaces | |
7 | save('proc_net_dev', <<'/proc/net/dev'); | |
8 | eth0: | |
9 | eth1: | |
10 | /proc/net/dev | |
11 | ||
12 | r(''); | |
13 | update_iface('eth0', [], autostart => 1); | |
14 | update_iface('eth1', [], autostart => 1); | |
15 | r(w()); | |
16 | die "autostart lost" if !$config->{ifaces}->{eth0}->{autostart}; | |
17 | die "autostart lost" if !$config->{ifaces}->{eth1}->{autostart}; | |
18 | new_iface("vmbr0", 'bridge', [{ family => 'inet' }], bridge_ports => 'eth0'); | |
19 | new_iface("vmbr1", 'OVSBridge', [{ family => 'inet' }], ovs_ports => 'eth1'); | |
20 | r(w()); | |
21 | die "autostart wrongly removed for linux bridge port" if !$config->{ifaces}->{eth0}->{autostart}; | |
22 | die "autostart not removed for ovs bridge port" if $config->{ifaces}->{eth1}->{autostart}; | |
23 | ||
24 | 1; |