]> git.proxmox.com Git - pve-common.git/blame - test/etc_network_interfaces/t.create_network.pl
runtest.pl: use lib '.' - because newer perl does not have that by default
[pve-common.git] / test / etc_network_interfaces / t.create_network.pl
CommitLineData
c7c4208a
WB
1save('proc_net_dev', <<'/proc/net/dev');
2eth0:
3eth1:
4/proc/net/dev
5
6r(load('brbase'));
7
8my $ip = '192.168.0.2';
9my $nm = '255.255.255.0';
10my $gw = '192.168.0.1';
11
12$config->{ifaces}->{eth1} = {
13 type => 'eth',
14 method => 'static',
15 address => $ip,
16 netmask => $nm,
17 gateway => $gw,
18 families => ['inet'],
19 autostart => 1
20};
21
22expect load('loopback') . <<"CHECK";
23source-directory interfaces.d
24
25iface eth0 inet manual
26
27auto eth1
28iface eth1 inet static
29 address $ip
30 netmask $nm
31 gateway $gw
32
33auto vmbr0
34iface vmbr0 inet static
35 address 10.0.0.2
36 netmask 255.255.255.0
37 gateway 10.0.0.1
38 bridge_ports eth0
39 bridge_stp off
40 bridge_fd 0
41
42CHECK
43
44save('if', w());
45r(load('if'));
46expect load('if');
47
48r(load('brbase'));
49
50my $ip = 'fc05::2';
51my $nm = '112';
52my $gw = 'fc05::1';
53
54$config->{ifaces}->{eth1} = {
55 type => 'eth',
56 method6 => 'static',
57 address6 => $ip,
58 netmask6 => $nm,
59 gateway6 => $gw,
60 families => ['inet6'],
61 autostart => 1
62};
63
64
65expect load('loopback') . <<"CHECK";
66source-directory interfaces.d
67
68iface eth0 inet manual
69
70auto eth1
71iface eth1 inet6 static
72 address $ip
73 netmask $nm
74 gateway $gw
75
76auto vmbr0
77iface vmbr0 inet static
78 address 10.0.0.2
79 netmask 255.255.255.0
80 gateway 10.0.0.1
81 bridge_ports eth0
82 bridge_stp off
83 bridge_fd 0
84
85CHECK
86
87save('if', w());
88r(load('if'));
89expect load('if');
90
911;