fa019eef97cbb419169971f64fbe0918271173c4
[cascardo/ovs.git] / tests / tunnel.at
1 AT_BANNER([tunnel])
2
3 AT_SETUP([tunnel - input])
4 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
5                     options:remote_ip=1.1.1.1 ofport_request=1\
6                     -- add-port br0 p2 -- set Interface p2 type=gre \
7                     options:local_ip=2.2.2.2 options:remote_ip=1.1.1.1 \
8                     ofport_request=2 \
9                     -- add-port br0 p3 -- set Interface p3 type=gre \
10                     options:remote_ip=2.2.2.2 ofport_request=3])
11 AT_DATA([flows.txt], [dnl
12 actions=IN_PORT
13 ])
14
15 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
16
17 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
18 br0 (dummy@ovs-dummy):
19         lookups: hit:0 missed:0 lost:0
20         flows: 0
21         br0 65534/100: (dummy)
22         p1 1/1: (gre: remote_ip=1.1.1.1)
23         p2 2/1: (gre: local_ip=2.2.2.2, remote_ip=1.1.1.1)
24         p3 3/1: (gre: remote_ip=2.2.2.2)
25 ])
26
27 dnl remote_ip
28 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=1.2.3.4,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
29 AT_CHECK([tail -1 stdout], [0],
30   [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1
31 ])
32
33 dnl local_ip, remote_ip
34 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
35 AT_CHECK([tail -1 stdout], [0],
36   [Datapath actions: set(tunnel(tun_id=0x0,src=2.2.2.2,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1
37 ])
38
39 dnl reconfigure, local_ip, remote_ip
40 AT_CHECK([ovs-vsctl set Interface p2 type=gre options:local_ip=2.2.2.3 \
41           options:df_default=false options:ttl=1 options:csum=true \
42           -- set Interface p3 type=gre64])
43 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
44 br0 (dummy@ovs-dummy):
45         lookups: hit:0 missed:0 lost:0
46         flows: 0
47         br0 65534/100: (dummy)
48         p1 1/1: (gre: remote_ip=1.1.1.1)
49         p2 2/1: (gre: csum=true, df_default=false, local_ip=2.2.2.3, remote_ip=1.1.1.1, ttl=1)
50         p3 3/64: (gre64: remote_ip=2.2.2.2)
51 ])
52 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
53 AT_CHECK([tail -1 stdout], [0],
54   [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1
55 ])
56 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.3,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
57 AT_CHECK([tail -1 stdout], [0],
58   [Datapath actions: set(tunnel(tun_id=0x0,src=2.2.2.3,dst=1.1.1.1,tos=0x0,ttl=1,flags(csum))),1
59 ])
60
61 dnl nonexistent tunnel
62 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=5.5.5.5,dst=6.6.6.6,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [2], [ignore], [dnl
63 Invalid flow
64 ovs-appctl: ovs-vswitchd: server returned an error
65 ])
66
67 OVS_VSWITCHD_STOP
68 AT_CLEANUP
69
70 AT_SETUP([tunnel - ECN decapsulation])
71 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
72                     options:remote_ip=1.1.1.1 ofport_request=1 \
73                     -- add-port br0 p2 -- set Interface p2 type=dummy \
74                     ofport_request=2])
75 AT_DATA([flows.txt], [dnl
76 actions=2
77 ])
78
79 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
80
81 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
82 br0 (dummy@ovs-dummy):
83         lookups: hit:0 missed:0 lost:0
84         flows: 0
85         br0 65534/100: (dummy)
86         p1 1/1: (gre: remote_ip=1.1.1.1)
87         p2 2/2: (dummy)
88 ])
89
90 dnl Tunnel CE and encapsulated packet CE
91 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=3,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
92 AT_CHECK([tail -1 stdout], [0],
93   [Datapath actions: 2
94 ])
95
96 dnl Tunnel CE and encapsulated packet ECT(1)
97 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=1,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
98 AT_CHECK([tail -1 stdout], [0],
99   [Datapath actions: 2
100 ])
101
102 dnl Tunnel CE and encapsulated packet ECT(2)
103 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=2,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
104 AT_CHECK([tail -1 stdout], [0],
105   [Datapath actions: 2
106 ])
107
108 dnl Tunnel CE and encapsulated packet Non-ECT
109 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
110 AT_CHECK([tail -1 stdout], [0],
111   [Datapath actions: drop
112 ])
113 OVS_VSWITCHD_STOP(["/dropping tunnel packet marked ECN CE but is not ECN capable/d"])
114 AT_CLEANUP
115
116 AT_SETUP([tunnel - output])
117 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
118                     options:remote_ip=1.1.1.1 options:local_ip=2.2.2.2 \
119                     options:key=5 ofport_request=1\
120                     -- add-port br0 p2 -- set Interface p2 type=dummy \
121                     ofport_request=2 ofport_request=2])
122 AT_DATA([flows.txt], [dnl
123 actions=output:1
124 ])
125
126 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
127
128 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
129 br0 (dummy@ovs-dummy):
130         lookups: hit:0 missed:0 lost:0
131         flows: 0
132         br0 65534/100: (dummy)
133         p1 1/1: (gre: key=5, local_ip=2.2.2.2, remote_ip=1.1.1.1)
134         p2 2/2: (dummy)
135 ])
136
137 dnl Basic
138 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
139 AT_CHECK([tail -1 stdout], [0],
140   [Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1
141 ])
142
143 dnl ECN
144 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=1,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
145 AT_CHECK([tail -1 stdout], [0],
146   [Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df,key))),1
147 ])
148 OVS_VSWITCHD_STOP
149 AT_CLEANUP
150
151 AT_SETUP([tunnel - ToS and TTL inheritance])
152 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
153                     options:remote_ip=1.1.1.1 options:tos=inherit \
154                     options:ttl=inherit ofport_request=1 \
155                     -- add-port br0 p2 -- set Interface p2 type=dummy \
156                     ofport_request=2 ofport_request=2])
157 AT_DATA([flows.txt], [dnl
158 actions=output:1
159 ])
160
161 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
162
163 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
164 br0 (dummy@ovs-dummy):
165         lookups: hit:0 missed:0 lost:0
166         flows: 0
167         br0 65534/100: (dummy)
168         p1 1/1: (gre: remote_ip=1.1.1.1, tos=inherit, ttl=inherit)
169         p2 2/2: (dummy)
170 ])
171
172 dnl Basic
173 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
174 AT_CHECK([tail -1 stdout], [0],
175   [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x4,ttl=128,flags(df))),1
176 ])
177
178 dnl ECN
179 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=5,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
180 AT_CHECK([tail -1 stdout], [0],
181   [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x5,ttl=128,flags(df))),1
182 ])
183
184 dnl non-IP
185 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0806),arp(sip=1.2.3.4,tip=5.6.7.8,op=1,sha=00:0f:10:11:12:13,tha=00:14:15:16:17:18)'], [0], [stdout])
186 AT_CHECK([tail -1 stdout], [0],
187   [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1
188 ])
189 OVS_VSWITCHD_STOP
190 AT_CLEANUP
191
192 AT_SETUP([tunnel - set_tunnel])
193 OVS_VSWITCHD_START([dnl
194     add-port br0 p1 -- set Interface p1 type=gre options:key=flow \
195         options:remote_ip=1.1.1.1 ofport_request=1 \
196     -- add-port br0 p2 -- set Interface p2 type=gre options:key=flow \
197         options:remote_ip=2.2.2.2 ofport_request=2 \
198     -- add-port br0 p3 -- set Interface p3 type=gre options:key=flow \
199         options:remote_ip=3.3.3.3 ofport_request=3 \
200     -- add-port br0 p4 -- set Interface p4 type=gre options:key=flow \
201         options:remote_ip=4.4.4.4 ofport_request=4])
202 AT_DATA([flows.txt], [dnl
203 actions=set_tunnel:1,output:1,set_tunnel:2,output:2,set_tunnel:3,output:3,set_tunnel:5,output:4
204 ])
205
206 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
207
208 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
209 br0 (dummy@ovs-dummy):
210         lookups: hit:0 missed:0 lost:0
211         flows: 0
212         br0 65534/100: (dummy)
213         p1 1/1: (gre: key=flow, remote_ip=1.1.1.1)
214         p2 2/1: (gre: key=flow, remote_ip=2.2.2.2)
215         p3 3/1: (gre: key=flow, remote_ip=3.3.3.3)
216         p4 4/1: (gre: key=flow, remote_ip=4.4.4.4)
217 ])
218
219 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(100),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
220 AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl
221 set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
222 set(tunnel(tun_id=0x2,src=0.0.0.0,dst=2.2.2.2,tos=0x0,ttl=64,flags(df,key))),1,dnl
223 set(tunnel(tun_id=0x3,src=0.0.0.0,dst=3.3.3.3,tos=0x0,ttl=64,flags(df,key))),1,dnl
224 set(tunnel(tun_id=0x5,src=0.0.0.0,dst=4.4.4.4,tos=0x0,ttl=64,flags(df,key))),1
225 ])
226 OVS_VSWITCHD_STOP
227 AT_CLEANUP
228
229 AT_SETUP([tunnel - key])
230 OVS_VSWITCHD_START([dnl
231     add-port br0 p1 -- set Interface p1 type=gre options:key=1 \
232         options:remote_ip=1.1.1.1 ofport_request=1 \
233     -- add-port br0 p2 -- set Interface p2 type=gre options:in_key=2 \
234         options:out_key=3 options:remote_ip=1.1.1.1 ofport_request=2 \
235     -- add-port br0 p3 -- set Interface p3 type=gre options:out_key=5 \
236         options:remote_ip=1.1.1.1 ofport_request=3])
237 AT_DATA([flows.txt], [dnl
238 actions=IN_PORT,output:1,output:2,output:3
239 ])
240
241 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
242
243 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
244 br0 (dummy@ovs-dummy):
245         lookups: hit:0 missed:0 lost:0
246         flows: 0
247         br0 65534/100: (dummy)
248         p1 1/1: (gre: key=1, remote_ip=1.1.1.1)
249         p2 2/1: (gre: in_key=2, out_key=3, remote_ip=1.1.1.1)
250         p3 3/1: (gre: out_key=5, remote_ip=1.1.1.1)
251 ])
252
253 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x1,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
254 AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl
255 set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
256 set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
257 set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1
258 ])
259
260 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
261 AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl
262 set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
263 set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
264 set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1
265 ])
266
267 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
268 AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl
269 set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
270 set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
271 set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1
272 ])
273
274 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0xf,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [2], [ignore], [dnl
275 Invalid flow
276 ovs-appctl: ovs-vswitchd: server returned an error
277 ])
278 OVS_VSWITCHD_STOP
279 AT_CLEANUP
280
281 AT_SETUP([tunnel - key match])
282 OVS_VSWITCHD_START([dnl
283     add-port br0 p1 -- set Interface p1 type=gre options:key=flow \
284         options:remote_ip=1.1.1.1 ofport_request=1 \
285     -- add-port br0 p2 -- set Interface p2 type=gre options:key=3 \
286         options:remote_ip=3.3.3.3 ofport_request=2 \
287     -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 \
288     -- add-port br0 p4 -- set Interface p4 type=dummy ofport_request=4 \
289     -- add-port br0 p5 -- set Interface p5 type=dummy ofport_request=5])
290 AT_DATA([flows.txt], [dnl
291 tun_id=2,actions=output:3
292 tun_id=3,actions=output:4,set_tunnel:2,resubmit:99,set_tunnel:4,output:2,resubmit:99
293 tun_id=4,actions=output:5
294 ])
295
296 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
297
298 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
299 br0 (dummy@ovs-dummy):
300         lookups: hit:0 missed:0 lost:0
301         flows: 0
302         br0 65534/100: (dummy)
303         p1 1/1: (gre: key=flow, remote_ip=1.1.1.1)
304         p2 2/1: (gre: key=3, remote_ip=3.3.3.3)
305         p3 3/3: (dummy)
306         p4 4/4: (dummy)
307         p5 5/5: (dummy)
308 ])
309
310 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
311 AT_CHECK([tail -1 stdout], [0], [dnl
312 Datapath actions: 3
313 ])
314
315 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x3,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
316 AT_CHECK([tail -1 stdout], [0], [dnl
317 Datapath actions: 4,3,set(tunnel(tun_id=0x3,src=0.0.0.0,dst=3.3.3.3,tos=0x0,ttl=64,flags(df,key))),1,5
318 ])
319
320 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x3,src=3.3.3.3,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
321 AT_CHECK([tail -1 stdout], [0], [dnl
322 Datapath actions: 4,3,5
323 ])
324
325 AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
326 AT_CHECK([tail -1 stdout], [0], [dnl
327         - Sends "packet-in" messages to the OpenFlow controller.
328 ])
329
330 OVS_VSWITCHD_STOP
331 AT_CLEANUP
332
333 AT_SETUP([tunnel - VXLAN])
334 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=vxlan \
335                     options:remote_ip=1.1.1.1 ofport_request=1])
336
337 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
338 br0 (dummy@ovs-dummy):
339         lookups: hit:0 missed:0 lost:0
340         flows: 0
341         br0 65534/100: (dummy)
342         p1 1/1: (vxlan: remote_ip=1.1.1.1)
343 ])
344
345 OVS_VSWITCHD_STOP
346 AT_CLEANUP
347
348 AT_SETUP([tunnel - different VXLAN UDP port])
349 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=vxlan \
350                     options:remote_ip=1.1.1.1 ofport_request=1 options:dst_port=4341])
351
352 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
353 br0 (dummy@ovs-dummy):
354         lookups: hit:0 missed:0 lost:0
355         flows: 0
356         br0 65534/100: (dummy)
357         p1 1/1: (vxlan: dst_port=4341, remote_ip=1.1.1.1)
358 ])
359
360 dnl change UDP port
361
362 AT_CHECK([ovs-vsctl -- set Interface p1 options:dst_port=5000])
363
364 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
365 br0 (dummy@ovs-dummy):
366         lookups: hit:0 missed:0 lost:0
367         flows: 0
368         br0 65534/100: (dummy)
369         p1 1/2: (vxlan: dst_port=5000, remote_ip=1.1.1.1)
370 ])
371
372 dnl change UDP port to default
373
374 AT_CHECK([ovs-vsctl -- set Interface p1 options:dst_port=8472])
375
376 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
377 br0 (dummy@ovs-dummy):
378         lookups: hit:0 missed:0 lost:0
379         flows: 0
380         br0 65534/100: (dummy)
381         p1 1/1: (vxlan: remote_ip=1.1.1.1)
382 ])
383
384 OVS_VSWITCHD_STOP
385 AT_CLEANUP