]> git.proxmox.com Git - pve-common.git/blob - test/etc_network_interfaces/t.create_network.pl
Inotify : add vxlan interface support
[pve-common.git] / test / etc_network_interfaces / t.create_network.pl
1 save('proc_net_dev', <<'/proc/net/dev');
2 eth0:
3 eth1:
4 /proc/net/dev
5
6 r(load('brbase'));
7
8 my $ip = '192.168.0.2';
9 my $nm = '255.255.255.0';
10 my $gw = '192.168.0.1';
11 my $svcnodeip = '239.192.105.237';
12 my $physdev = 'eth0';
13 my $remoteip1 = '192.168.0.3';
14 my $remoteip2 = '192.168.0.4';
15
16
17 $config->{ifaces}->{eth1} = {
18 type => 'eth',
19 method => 'static',
20 address => $ip,
21 netmask => $nm,
22 gateway => $gw,
23 families => ['inet'],
24 autostart => 1
25 };
26
27 $config->{ifaces}->{vxlan1} = {
28 type => 'vxlan',
29 method => 'manual',
30 families => ['inet'],
31 'vxlan-id' => 1,
32 'vxlan-svcnodeip' => $svcnodeip,
33 'vxlan-physdev' => $physdev,
34 autostart => 1
35 };
36
37 $config->{ifaces}->{vxlan2} = {
38 type => 'vxlan',
39 method => 'manual',
40 families => ['inet'],
41 'vxlan-id' => 2,
42 'vxlan-local-tunnelip' => $ip,
43 autostart => 1
44 };
45
46 $config->{ifaces}->{vxlan3} = {
47 type => 'vxlan',
48 method => 'manual',
49 families => ['inet'],
50 'vxlan-id' => 3,
51 'vxlan-remoteip' => [$remoteip1, $remoteip2],
52 autostart => 1
53 };
54
55
56 expect load('loopback') . <<"CHECK";
57 source-directory interfaces.d
58
59 iface eth0 inet manual
60
61 auto eth1
62 iface eth1 inet static
63 address $ip
64 netmask $nm
65 gateway $gw
66
67 auto vmbr0
68 iface vmbr0 inet static
69 address 10.0.0.2
70 netmask 255.255.255.0
71 gateway 10.0.0.1
72 bridge-ports eth0
73 bridge-stp off
74 bridge-fd 0
75
76 auto vxlan1
77 iface vxlan1 inet manual
78 vxlan-id 1
79 vxlan-svcnodeip $svcnodeip
80 vxlan-physdev $physdev
81
82 auto vxlan2
83 iface vxlan2 inet manual
84 vxlan-id 2
85 vxlan-local-tunnelip $ip
86
87 auto vxlan3
88 iface vxlan3 inet manual
89 vxlan-id 3
90 vxlan-remoteip $remoteip1
91 vxlan-remoteip $remoteip2
92
93 CHECK
94
95 save('if', w());
96 r(load('if'));
97 expect load('if');
98
99 r(load('brbase'));
100
101 my $ip = 'fc05::2';
102 my $nm = '112';
103 my $gw = 'fc05::1';
104
105 $config->{ifaces}->{eth1} = {
106 type => 'eth',
107 method6 => 'static',
108 address6 => $ip,
109 netmask6 => $nm,
110 gateway6 => $gw,
111 families => ['inet6'],
112 autostart => 1
113 };
114
115
116 expect load('loopback') . <<"CHECK";
117 source-directory interfaces.d
118
119 iface eth0 inet manual
120
121 auto eth1
122 iface eth1 inet6 static
123 address $ip
124 netmask $nm
125 gateway $gw
126
127 auto vmbr0
128 iface vmbr0 inet static
129 address 10.0.0.2
130 netmask 255.255.255.0
131 gateway 10.0.0.1
132 bridge-ports eth0
133 bridge-stp off
134 bridge-fd 0
135
136 CHECK
137
138 save('if', w());
139 r(load('if'));
140 expect load('if');
141
142 1;