]> git.proxmox.com Git - mirror_ovs.git/blob - tests/tunnel-push-pop-ipv6.at
tests: Refactor the iptables accept rule.
[mirror_ovs.git] / tests / tunnel-push-pop-ipv6.at
1 AT_BANNER([tunnel_push_pop_ipv6])
2
3 AT_SETUP([tunnel_push_pop_ipv6 - ip6gre])
4
5 OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 other-config:hwaddr=aa:55:aa:55:00:00])
6 AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
7 AT_CHECK([ovs-vsctl add-port int-br t2 -- set Interface t2 type=ip6gre \
8 options:remote_ip=2001:cafe::92 ofport_request=2\
9 options:packet_type=legacy_l2
10 ], [0])
11
12 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
13 dummy@ovs-dummy: hit:0 missed:0
14 br0:
15 br0 65534/100: (dummy-internal)
16 p0 1/1: (dummy)
17 int-br:
18 int-br 65534/2: (dummy-internal)
19 t2 2/6: (ip6gre: remote_ip=2001:cafe::92)
20 ])
21
22 dnl First setup dummy interface IP address, then add the route
23 dnl so that tnl-port table can get valid IP address for the device.
24 AT_CHECK([ovs-appctl netdev-dummy/ip6addr br0 2001:cafe::88/24], [0], [OK
25 ])
26 AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
27 ])
28 AT_CHECK([ovs-appctl ovs/route/add 2001:cafe::92/24 br0], [0], [OK
29 ])
30
31 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
32
33 dnl Check Neighbour discovery.
34 AT_CHECK([ovs-vsctl -- set Interface p0 options:pcap=p0.pcap])
35
36 AT_CHECK([ovs-appctl netdev-dummy/receive int-br 'in_port(2),eth(src=aa:55:aa:55:00:00,dst=f8:bc:12:ff:ff:ff),eth_type(0x0800),ipv4(src=1.1.3.92,dst=1.1.3.88,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'])
37 AT_CHECK([ovs-pcap p0.pcap > p0.pcap.txt 2>&1])
38
39 AT_CHECK([cat p0.pcap.txt | grep 92aa55aa55000086dd6000000000203aff2001cafe | uniq], [0], [dnl
40 3333ff000092aa55aa55000086dd6000000000203aff2001cafe000000000000000000000088ff0200000000000000000001ff00009287004d48000000002001cafe0000000000000000000000920101aa55aa550000
41 ])
42
43 dnl
44 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::88,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=136,code=0),nd(target=2001:cafe::92,sll=00:00:00:00:00:00,tll=f8:bc:12:44:34:b6)'])
45
46 AT_CHECK([ovs-appctl tnl/arp/show | tail -n+3 | sort], [0], [dnl
47 2001:cafe::92 f8:bc:12:44:34:b6 br0
48 ])
49
50 AT_CHECK([ovs-appctl tnl/ports/show |sort], [0], [dnl
51 Listening ports:
52 ip6gre_sys (6) ref_cnt=1
53 ])
54
55 dnl Check IPv6 GRE tunnel pop
56 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::88,label=0,proto=47,tclass=0x0,hlimit=64)'], [0], [stdout])
57 AT_CHECK([tail -1 stdout], [0],
58 [Datapath actions: tnl_pop(6)
59 ])
60
61 dnl Check IPv6 GRE tunnel push
62 AT_CHECK([ovs-ofctl add-flow int-br action=2])
63 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
64
65 AT_CHECK([tail -1 stdout], [0],
66 [Datapath actions: clone(tnl_push(tnl_port(6),header(size=58,type=109,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=47,tclass=0x0,hlimit=64),gre((flags=0x0,proto=0x6558))),out_port(100)),1)
67 ])
68
69 OVS_VSWITCHD_STOP
70 AT_CLEANUP
71
72 AT_SETUP([tunnel_push_pop_ipv6 - ip6erspan])
73
74 OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 other-config:hwaddr=aa:55:aa:55:00:00])
75 AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
76 AT_CHECK([ovs-vsctl add-port int-br t2 -- set Interface t2 type=ip6erspan \
77 options:remote_ip=2001:cafe::92 options:key=123 \
78 options:erspan_ver=1 options:erspan_idx=3 ofport_request=2\
79 -- add-port int-br t3 -- set Interface t3 type=ip6erspan \
80 options:remote_ip=2001:cafe::93 options:key=567 \
81 options:erspan_ver=2 options:erspan_dir=1 options:erspan_hwid=0x7 \
82 ofport_request=3\
83 ], [0])
84
85 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
86 dummy@ovs-dummy: hit:0 missed:0
87 br0:
88 br0 65534/100: (dummy-internal)
89 p0 1/1: (dummy)
90 int-br:
91 int-br 65534/2: (dummy-internal)
92 t2 2/6: (ip6erspan: erspan_idx=0x3, erspan_ver=1, key=123, remote_ip=2001:cafe::92)
93 t3 3/6: (ip6erspan: erspan_dir=1, erspan_hwid=0x7, erspan_ver=2, key=567, remote_ip=2001:cafe::93)
94 ])
95
96 dnl First setup dummy interface IP address, then add the route
97 dnl so that tnl-port table can get valid IP address for the device.
98 AT_CHECK([ovs-appctl netdev-dummy/ip6addr br0 2001:cafe::88/24], [0], [OK
99 ])
100 AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
101 ])
102 AT_CHECK([ovs-appctl ovs/route/add 2001:cafe::92/24 br0], [0], [OK
103 ])
104
105 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
106
107 dnl Check Neighbour discovery.
108 AT_CHECK([ovs-vsctl -- set Interface p0 options:pcap=p0.pcap])
109
110 AT_CHECK([ovs-appctl netdev-dummy/receive int-br 'in_port(2),eth(src=aa:55:aa:55:00:00,dst=f8:bc:12:ff:ff:ff),eth_type(0x0800),ipv4(src=1.1.3.92,dst=1.1.3.88,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'])
111 AT_CHECK([ovs-pcap p0.pcap > p0.pcap.txt 2>&1])
112
113 AT_CHECK([cat p0.pcap.txt | grep 92aa55aa55000086dd6000000000203aff2001cafe | uniq], [0], [dnl
114 3333ff000092aa55aa55000086dd6000000000203aff2001cafe000000000000000000000088ff0200000000000000000001ff00009287004d48000000002001cafe0000000000000000000000920101aa55aa550000
115 ])
116 AT_CHECK([cat p0.pcap.txt | grep 93aa55aa55000086dd6000000000203aff2001cafe | uniq], [0], [dnl
117 3333ff000093aa55aa55000086dd6000000000203aff2001cafe000000000000000000000088ff0200000000000000000001ff00009387004d46000000002001cafe0000000000000000000000930101aa55aa550000
118 ])
119
120
121 dnl
122 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::88,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=136,code=0),nd(target=2001:cafe::92,sll=00:00:00:00:00:00,tll=f8:bc:12:44:34:b6)'])
123 dnl
124 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=f8:bc:12:44:34:b7,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::93,dst=2001:cafe::88,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=136,code=0),nd(target=2001:cafe::93,sll=00:00:00:00:00:00,tll=f8:bc:12:44:34:b7)'])
125
126 dnl Check ARP Snoop
127 dnl AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::94,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=136,code=0),nd(target=2001:cafe::92,sll=00:00:00:00:00:00,tll=f8:bc:12:44:34:b6)'])
128
129 dnl AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=f8:bc:12:44:34:b7,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::93,dst=2001:cafe::94,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=136,code=0),nd(target=2001:cafe::93,sll=00:00:00:00:00:00,tll=f8:bc:12:44:34:b7)'])
130
131 ovs-appctl time/warp 1000
132 ovs-appctl time/warp 1000
133
134 AT_CHECK([ovs-appctl tnl/arp/show | tail -n+3 | sort], [0], [dnl
135 2001:cafe::92 f8:bc:12:44:34:b6 br0
136 2001:cafe::93 f8:bc:12:44:34:b7 br0
137 ])
138
139 AT_CHECK([ovs-appctl tnl/ports/show |sort], [0], [dnl
140 Listening ports:
141 ip6erspan_sys (6) ref_cnt=2
142 ])
143
144 dnl Check ERSPAN tunnel pop
145 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::88,label=0,proto=47,tclass=0x0,hlimit=64)'], [0], [stdout])
146 AT_CHECK([tail -1 stdout], [0],
147 [Datapath actions: tnl_pop(6)
148 ])
149
150 dnl Check ERSPAN v1 tunnel push
151 AT_CHECK([ovs-ofctl add-flow int-br action=2])
152 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
153 AT_CHECK([tail -1 stdout], [0],
154 [Datapath actions: clone(tnl_push(tnl_port(6),header(size=70,type=108,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=47,tclass=0x0,hlimit=64),erspan(ver=1,sid=0x7b,idx=0x3)),out_port(100)),1)
155 ])
156
157 dnl Check ERSPAN v2 tunnel push
158 AT_CHECK([ovs-ofctl mod-flows int-br action=3])
159 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
160 AT_CHECK([tail -1 stdout], [0],
161 [Datapath actions: clone(tnl_push(tnl_port(6),header(size=74,type=108,eth(dst=f8:bc:12:44:34:b7,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::93,label=0,proto=47,tclass=0x0,hlimit=64),erspan(ver=2,sid=0x237,dir=1,hwid=0x7)),out_port(100)),1)
162 ])
163
164 ovs-appctl vlog/set dbg
165 dnl Check decapsulation of ERSPAN v1
166 dnl Hex dump: GRE:(100088be)
167 dnl ERSPAN: v1, session id = 0x7b (1000007b), index=3 (00000003)
168 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6486dd60000000006a2f402001cafe0000000000000000000000922001cafe000000000000000000000088100088be000000011000007b00000003fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
169 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6486dd60000000006a2f402001cafe0000000000000000000000922001cafe000000000000000000000088100088be000000011000007b00000003fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
170
171 ovs-appctl time/warp 1000
172
173 AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port 2'], [0], [dnl
174 port 2: rx pkts=2, bytes=196, drop=?, errs=?, frame=?, over=?, crc=?
175 ])
176
177 dnl Check decapsulation ERSPAN v2
178 dnl Hex dump: GRE:(100022eb)
179 dnl ERSPAN: v2, session id = 0x237 (20000237), hwid = 8,dir = 1 (00000078)
180 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6486dd60000000006a2f402001cafe0000000000000000000000932001cafe000000000000000000000088100022eb000000012000023710abcd0100000078fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
181
182 ovs-appctl time/warp 1000
183
184 AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port 3'], [0], [dnl
185 port 3: rx pkts=1, bytes=98, drop=?, errs=?, frame=?, over=?, crc=?
186 ])
187
188 OVS_VSWITCHD_STOP
189 AT_CLEANUP
190
191 AT_SETUP([tunnel_push_pop_ipv6 - action])
192
193 OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 other-config:hwaddr=aa:55:aa:55:00:00])
194 AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
195 AT_CHECK([ovs-vsctl add-port int-br t2 -- set Interface t2 type=vxlan \
196 options:remote_ip=2001:cafe::92 options:key=123 ofport_request=2\
197 -- add-port int-br t1 -- set Interface t1 type=gre \
198 options:remote_ip=2001:cafe::92 options:key=456 ofport_request=3\
199 -- add-port int-br t3 -- set Interface t3 type=vxlan \
200 options:remote_ip=2001:cafe::93 options:out_key=flow options:csum=true ofport_request=4\
201 -- add-port int-br t4 -- set Interface t4 type=geneve \
202 options:remote_ip=flow options:key=123 ofport_request=5\
203 -- add-port int-br t5 -- set Interface t5 type=gre \
204 options:remote_ip=2001:cafe::92 options:key=455 options:packet_type=legacy_l3 ofport_request=6\
205 ], [0])
206
207 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
208 dummy@ovs-dummy: hit:0 missed:0
209 br0:
210 br0 65534/100: (dummy-internal)
211 p0 1/1: (dummy)
212 int-br:
213 int-br 65534/2: (dummy-internal)
214 t1 3/3: (gre: key=456, remote_ip=2001:cafe::92)
215 t2 2/4789: (vxlan: key=123, remote_ip=2001:cafe::92)
216 t3 4/4789: (vxlan: csum=true, out_key=flow, remote_ip=2001:cafe::93)
217 t4 5/6081: (geneve: key=123, remote_ip=flow)
218 t5 6/3: (gre: key=455, packet_type=legacy_l3, remote_ip=2001:cafe::92)
219 ])
220
221 AT_CHECK([ovs-appctl tnl/ports/show |sort], [0], [dnl
222 Listening ports:
223 genev_sys_6081 (6081) ref_cnt=1
224 gre_sys (3) ref_cnt=2
225 vxlan_sys_4789 (4789) ref_cnt=2
226 ])
227
228
229 dnl First setup dummy interface IP address, then add the route
230 dnl so that tnl-port table can get valid IP address for the device.
231 AT_CHECK([ovs-appctl netdev-dummy/ip6addr br0 2001:cafe::88/24], [0], [OK
232 ])
233 AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
234 ])
235 AT_CHECK([ovs-appctl ovs/route/add 2001:cafe::92/24 br0], [0], [OK
236 ])
237
238 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
239
240 dnl Check Neighbour discovery.
241 AT_CHECK([ovs-vsctl -- set Interface p0 options:pcap=p0.pcap])
242
243 AT_CHECK([ovs-appctl netdev-dummy/receive int-br 'in_port(2),eth(src=aa:55:aa:55:00:00,dst=f8:bc:12:ff:ff:ff),eth_type(0x0800),ipv4(src=1.1.3.92,dst=1.1.3.88,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'])
244
245 dnl Wait for the two Neighbor Solicitation packets to be sent.
246 dnl Sometimes the system can be slow (e.g. under valgrind)
247 OVS_WAIT_UNTIL([test `ovs-pcap p0.pcap | sort | uniq | wc -l` -ge 2])
248
249 AT_CHECK([ovs-pcap p0.pcap > p0.pcap.txt 2>&1])
250
251 AT_CHECK([cat p0.pcap.txt | grep 92aa55aa55000086dd6000000000203aff2001cafe | uniq], [0], [dnl
252 3333ff000092aa55aa55000086dd6000000000203aff2001cafe000000000000000000000088ff0200000000000000000001ff00009287004d48000000002001cafe0000000000000000000000920101aa55aa550000
253 ])
254 AT_CHECK([cat p0.pcap.txt | grep 93aa55aa55000086dd6000000000203aff2001cafe | uniq], [0], [dnl
255 3333ff000093aa55aa55000086dd6000000000203aff2001cafe000000000000000000000088ff0200000000000000000001ff00009387004d46000000002001cafe0000000000000000000000930101aa55aa550000
256 ])
257
258 dnl Check ARP Snoop
259 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=f8:bc:12:44:34:c8,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::88,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=136,code=0),nd(target=2001:cafe::92,sll=00:00:00:00:00:00,tll=f8:bc:12:44:34:c8)'])
260
261 ovs-appctl time/warp 1000
262 ovs-appctl time/warp 1000
263
264 AT_CHECK([ovs-appctl tnl/arp/show | tail -n+3 | sort], [0], [dnl
265 2001:cafe::92 f8:bc:12:44:34:c8 br0
266 ])
267
268 dnl Receiving Neighbor Advertisement with incorrect 'nw_dst' should not alter tunnel neighbor cache
269 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::99,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=136,code=0),nd(target=2001:cafe::92,sll=00:00:00:00:00:00,tll=f8:bc:12:44:34:b6)'])
270
271 ovs-appctl time/warp 1000
272 ovs-appctl time/warp 1000
273
274 AT_CHECK([ovs-appctl tnl/arp/show | tail -n+3 | sort], [0], [dnl
275 2001:cafe::92 f8:bc:12:44:34:c8 br0
276 ])
277
278 dnl Receiving Neighbot Advertisement with incorrect VLAN id should not alter tunnel neighbor cache
279 AT_CHECK([ovs-vsctl set port br0 tag=10])
280 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::88,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=136,code=0),nd(target=2001:cafe::92,sll=00:00:00:00:00:00,tll=f8:bc:12:44:34:b6))'])
281
282 ovs-appctl time/warp 1000
283 ovs-appctl time/warp 1000
284
285 AT_CHECK([ovs-appctl tnl/arp/show | tail -n+3 | sort], [0], [dnl
286 2001:cafe::92 f8:bc:12:44:34:c8 br0
287 ])
288
289 dnl Receiving Neighbor Advertisement with correct VLAN id should alter tunnel neighbor cache
290 AT_CHECK([ovs-vsctl set port br0 tag=10])
291 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x8100),vlan(vid=10,pcp=7),encap(eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::88,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=136,code=0),nd(target=2001:cafe::92,sll=00:00:00:00:00:00,tll=f8:bc:12:44:34:b6))'])
292
293 ovs-appctl time/warp 1000
294 ovs-appctl time/warp 1000
295
296 AT_CHECK([ovs-appctl tnl/arp/show | tail -n+3 | sort], [0], [dnl
297 2001:cafe::92 f8:bc:12:44:34:b6 br0
298 ])
299
300 dnl Receiving Neighbor Advertisement in overlay bridge should not alter tunnel neighbor cache
301 AT_CHECK([ovs-vsctl add-port int-br p1 -- set interface p1 type=dummy ofport_request=200 other-config:hwaddr=aa:55:aa:55:00:99])
302 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(200),eth(src=f8:bc:12:44:34:c8,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::99,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=136,code=0),nd(target=2001:cafe::92,sll=00:00:00:00:00:00,tll=f8:bc:12:44:34:c8)'])
303
304 ovs-appctl time/warp 1000
305 ovs-appctl time/warp 1000
306
307 AT_CHECK([ovs-appctl tnl/neigh/show | grep br | sort], [0], [dnl
308 2001:cafe::92 f8:bc:12:44:34:b6 br0
309 ])
310
311 dnl Receive Neighbor Advertisement without VLAN header
312 AT_CHECK([ovs-vsctl set port br0 tag=0])
313 AT_CHECK([ovs-appctl tnl/neigh/flush], [0], [OK
314 ])
315
316 ovs-appctl time/warp 1000
317 ovs-appctl time/warp 1000
318
319
320 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::88,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=136,code=0),nd(target=2001:cafe::92,sll=00:00:00:00:00:00,tll=f8:bc:12:44:34:b6)'])
321
322 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=f8:bc:12:44:34:b7,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::93,dst=ff02::1:ff00:0088,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=136,code=0),nd(target=2001:cafe::93,sll=00:00:00:00:00:00,tll=f8:bc:12:44:34:b7)'])
323
324 ovs-appctl time/warp 1000
325 ovs-appctl time/warp 1000
326
327 AT_CHECK([ovs-appctl tnl/arp/show | tail -n+3 | sort], [0], [dnl
328 2001:cafe::92 f8:bc:12:44:34:b6 br0
329 2001:cafe::93 f8:bc:12:44:34:b7 br0
330 ])
331
332 AT_CHECK([ovs-appctl tnl/ports/show |sort], [0], [dnl
333 Listening ports:
334 genev_sys_6081 (6081) ref_cnt=1
335 gre_sys (3) ref_cnt=2
336 vxlan_sys_4789 (4789) ref_cnt=2
337 ])
338
339 dnl Check VXLAN tunnel pop
340 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::88,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=51283,dst=4789)'], [0], [stdout])
341 AT_CHECK([tail -1 stdout], [0],
342 [Datapath actions: tnl_pop(4789)
343 ])
344
345 dnl Check GRE tunnel pop
346 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::88,label=0,proto=47,tclass=0x0,hlimit=64)'], [0], [stdout])
347 AT_CHECK([tail -1 stdout], [0],
348 [Datapath actions: tnl_pop(3)
349 ])
350
351 dnl Check Geneve tunnel pop
352 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x86dd),ipv6(src=2001:cafe::92,dst=2001:cafe::88,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=51283,dst=6081)'], [0], [stdout])
353 AT_CHECK([tail -1 stdout], [0],
354 [Datapath actions: tnl_pop(6081)
355 ])
356
357 dnl Check VXLAN tunnel push
358 AT_CHECK([ovs-ofctl add-flow int-br action=2])
359 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
360 AT_CHECK([tail -1 stdout], [0],
361 [Datapath actions: clone(tnl_push(tnl_port(4789),header(size=70,type=4,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=0,dst=4789,csum=0xffff),vxlan(flags=0x8000000,vni=0x7b)),out_port(100)),1)
362 ])
363
364 dnl Check VXLAN tunnel push set tunnel id by flow and checksum
365 AT_CHECK([ovs-ofctl add-flow int-br "actions=set_tunnel:124,4"])
366 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
367 AT_CHECK([tail -1 stdout], [0],
368 [Datapath actions: clone(tnl_push(tnl_port(4789),header(size=70,type=4,eth(dst=f8:bc:12:44:34:b7,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::93,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=0,dst=4789,csum=0xffff),vxlan(flags=0x8000000,vni=0x7c)),out_port(100)),1)
369 ])
370
371 dnl Check GRE tunnel push
372 AT_CHECK([ovs-ofctl add-flow int-br action=3])
373 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
374 AT_CHECK([tail -1 stdout], [0],
375 [Datapath actions: clone(tnl_push(tnl_port(3),header(size=62,type=109,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=47,tclass=0x0,hlimit=64),gre((flags=0x2000,proto=0x6558),key=0x1c8)),out_port(100)),1)
376 ])
377
378 dnl Check Geneve tunnel push
379 AT_CHECK([ovs-ofctl add-flow int-br "actions=set_field:2001:cafe::92->tun_ipv6_dst,5"])
380 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
381 AT_CHECK([tail -1 stdout], [0],
382 [Datapath actions: clone(tnl_push(tnl_port(6081),header(size=70,type=5,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=0,dst=6081,csum=0xffff),geneve(vni=0x7b)),out_port(100)),1)
383 ])
384
385 dnl Check Geneve tunnel push with options
386 AT_CHECK([ovs-ofctl add-tlv-map int-br "{class=0xffff,type=0x80,len=4}->tun_metadata0"])
387 AT_CHECK([ovs-ofctl add-flow int-br "actions=set_field:2001:cafe::92->tun_ipv6_dst,set_field:0xa->tun_metadata0,5"])
388 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
389 AT_CHECK([tail -1 stdout], [0],
390 [Datapath actions: clone(tnl_push(tnl_port(6081),header(size=78,type=5,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=0,dst=6081,csum=0xffff),geneve(crit,vni=0x7b,options({class=0xffff,type=0x80,len=4,0xa}))),out_port(100)),1)
391 ])
392
393 dnl Check decapsulation of GRE packet
394 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6486dd60000000006a2f402001cafe0000000000000000000000922001cafe00000000000000000000008820006558000001c8fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
395 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6486dd60000000006a2f402001cafe0000000000000000000000922001cafe00000000000000000000008820006558000001c8fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
396 ovs-appctl time/warp 1000
397
398 AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port 3'], [0], [dnl
399 port 3: rx pkts=2, bytes=196, drop=?, errs=?, frame=?, over=?, crc=?
400 ])
401
402 dnl Check decapsulation of L3GRE packet
403 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6486dd60000000005a2f402001cafe0000000000000000000000922001cafe00000000000000000000008820000800000001c745000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
404 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6486dd60000000005a2f402001cafe0000000000000000000000922001cafe00000000000000000000008820000800000001c745000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
405 ovs-appctl time/warp 1000
406 ovs-appctl time/warp 1000
407
408 AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port 6'], [0], [dnl
409 port 6: rx pkts=2, bytes=168, drop=?, errs=?, frame=?, over=?, crc=?
410 ])
411
412 dnl Check decapsulation of Geneve packet with options
413 AT_CAPTURE_FILE([ofctl_monitor.log])
414 AT_CHECK([ovs-ofctl monitor int-br 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
415
416 AT_CHECK([ovs-ofctl del-flows int-br])
417 AT_CHECK([ovs-ofctl add-flow int-br "tun_metadata0=0xa/0xf,actions=5,controller"])
418 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6486dd60000000008211402001cafe0000000000000000000000922001cafe000000000000000000000088308817c1008200000400655800007b00ffff80010000000affff00010000000bfe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
419
420 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2])
421 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
422
423 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
424 NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=98 tun_id=0x7b,tun_ipv6_src=2001:cafe::92,tun_ipv6_dst=2001:cafe::88,tun_metadata0=0xa,in_port=5 (via action) data_len=98 (unbuffered)
425 icmp,vlan_tci=0x0000,dl_src=be:b6:f4:e1:49:4a,dl_dst=fe:71:d8:83:72:4f,nw_src=30.0.0.1,nw_dst=30.0.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=0,icmp_code=0 icmp_csum:4227
426 ])
427
428 AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port 5'], [0], [dnl
429 port 5: rx pkts=1, bytes=98, drop=?, errs=?, frame=?, over=?, crc=?
430 ])
431 AT_CHECK([ovs-appctl dpif/dump-flows int-br | grep 'in_port(6081)'], [0], [dnl
432 tunnel(tun_id=0x7b,ipv6_src=2001:cafe::92,ipv6_dst=2001:cafe::88,geneve({class=0xffff,type=0x80,len=4,0xa/0xf}{class=0xffff,type=0,len=4}),flags(-df-csum+key)),recirc_id(0),in_port(6081),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=3,rule_cookie=0,controller_id=0,max_len=65535))
433 ])
434
435 ovs-appctl time/warp 10000
436
437 AT_CHECK([ovs-vsctl del-port int-br t3 \
438 -- set Interface t1 type=vxlan \
439 -- set Interface t2 options:dst_port=4790 \
440 ], [0])
441
442 dnl Check tunnel lookup entries after deleting/reconfiguring some ports
443 AT_CHECK([ovs-appctl tnl/ports/show |sort], [0], [dnl
444 Listening ports:
445 genev_sys_6081 (6081) ref_cnt=1
446 gre_sys (3) ref_cnt=1
447 vxlan_sys_4789 (4789) ref_cnt=1
448 vxlan_sys_4790 (4790) ref_cnt=1
449 ])
450
451 AT_CHECK([ovs-vsctl del-port int-br t1 \
452 -- del-port int-br t2 \
453 -- del-port int-br t4 \
454 -- del-port int-br t5 \
455 ], [0])
456
457 dnl Check tunnel lookup entries after deleting all remaining tunnel ports
458 AT_CHECK([ovs-appctl tnl/ports/show |sort], [0], [dnl
459 Listening ports:
460 ])
461
462 OVS_VSWITCHD_STOP
463 AT_CLEANUP