]> git.proxmox.com Git - mirror_ovs.git/blame - tests/tunnel-push-pop.at
db-ctl-base: Add {in} and {not-in} set relational operators.
[mirror_ovs.git] / tests / tunnel-push-pop.at
CommitLineData
a36de779
PS
1AT_BANNER([tunnel_push_pop])
2
7dc18ae9
WT
3AT_SETUP([tunnel_push_pop - erspan])
4OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 other-config:hwaddr=aa:55:aa:55:00:00])
5AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
6AT_CHECK([ovs-vsctl add-port int-br t1 -- set Interface t1 type=erspan \
7 options:remote_ip=1.1.2.92 options:key=123 options:erspan_ver=1 \
8 options:erspan_idx=3 ofport_request=2 \
9 -- add-port int-br t2 -- set Interface t2 type=erspan \
10 options:remote_ip=1.1.2.92 options:key=567 options:erspan_ver=2 \
11 options:erspan_dir=1 options:erspan_hwid=0x7 ofport_request=3\
068794b4
GR
12 -- add-port int-br t3 -- set Interface t3 type=erspan \
13 options:remote_ip=flow options:erspan_ver=2 options:key=456 \
14 options:erspan_hwid=flow options:erspan_dir=flow ofport_request=4\
15 -- add-port int-br t4 -- set Interface t4 type=erspan \
16 options:remote_ip=flow options:erspan_ver=2 options:key=56 \
17 options:erspan_ver=flow ofport_request=5\
7dc18ae9
WT
18 ], [0])
19
20AT_CHECK([ovs-appctl dpif/show], [0], [dnl
21dummy@ovs-dummy: hit:0 missed:0
7be29a47
BP
22 br0:
23 br0 65534/100: (dummy-internal)
24 p0 1/1: (dummy)
25 int-br:
26 int-br 65534/2: (dummy-internal)
27 t1 2/3: (erspan: erspan_idx=0x3, erspan_ver=1, key=123, remote_ip=1.1.2.92)
28 t2 3/3: (erspan: erspan_dir=1, erspan_hwid=0x7, erspan_ver=2, key=567, remote_ip=1.1.2.92)
29 t3 4/3: (erspan: erspan_dir=flow, erspan_hwid=flow, erspan_ver=2, key=456, remote_ip=flow)
30 t4 5/3: (erspan: erspan_dir=flow, erspan_hwid=flow, erspan_idx=flow, erspan_ver=flow, key=56, remote_ip=flow)
7dc18ae9
WT
31])
32
33dnl First setup dummy interface IP address, then add the route
34dnl so that tnl-port table can get valid IP address for the device.
35AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
36])
37AT_CHECK([ovs-appctl netdev-dummy/ip6addr br0 2001:cafe::88/24], [0], [OK
38])
39
40AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK
41])
42
43AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0 pkt_mark=1234], [0], [OK
44])
45
46AT_CHECK([ovs-ofctl add-flow br0 action=normal])
47
48dnl Check ARP request
49AT_CHECK([ovs-vsctl -- set Interface p0 options:pcap=p0.pcap])
50
51AT_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)'])
52
53dnl Wait for the two ARP requests to be sent. Sometimes the system
54dnl can be slow (e.g. under valgrind)
55OVS_WAIT_UNTIL([test `ovs-pcap p0.pcap | sort | uniq | wc -l` -ge 1])
56
57AT_CHECK([ovs-pcap p0.pcap > p0.pcap.txt 2>&1])
58
59AT_CHECK([cat p0.pcap.txt | grep 101025 | uniq], [0], [dnl
60ffffffffffffaa55aa55000008060001080006040001aa55aa550000010102580000000000000101025c
61])
62
63
64dnl Check ARP Snoop
65AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(100),eth(src=f8:bc:12:44:34:b6,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00)'])
66AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(100),eth(src=f8:bc:12:44:34:b7,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.93,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b7,tha=00:00:00:00:00:00)'])
67AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(100),eth(src=f8:bc:12:44:34:b8,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.94,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b8,tha=00:00:00:00:00:00)'])
68
69ovs-appctl time/warp 1000
70ovs-appctl time/warp 1000
71
72AT_CHECK([ovs-appctl tnl/neigh/show | tail -n+3 | sort], [0], [dnl
731.1.2.92 f8:bc:12:44:34:b6 br0
741.1.2.93 f8:bc:12:44:34:b7 br0
751.1.2.94 f8:bc:12:44:34:b8 br0
76])
77
78AT_CHECK([ovs-appctl tnl/ports/show |sort], [0], [dnl
79Listening ports:
068794b4 80erspan_sys (3) ref_cnt=4
7dc18ae9
WT
81])
82
83dnl Check ERSPAN v1 tunnel push
84AT_CHECK([ovs-vsctl -- set Interface br0 options:pcap=br0.pcap])
85AT_CHECK([ovs-ofctl add-flow int-br action=2])
86AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
87AT_CHECK([tail -1 stdout], [0],
88 [Datapath actions: clone(tnl_push(tnl_port(3),header(size=50,type=107,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x4000),erspan(ver=1,sid=0x7b,idx=0x3)),out_port(100)),1)
89])
90
91dnl Check ERSPAN v2 tunnel push
92AT_CHECK([ovs-ofctl mod-flows int-br action=3])
93AT_CHECK([ovs-appctl revalidator/wait])
94AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
95AT_CHECK([tail -1 stdout], [0],
96 [Datapath actions: clone(tnl_push(tnl_port(3),header(size=54,type=107,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x4000),erspan(ver=2,sid=0x237,dir=1,hwid=0x7)),out_port(100)),1)
97])
98
99dnl Check ERSPAN v2 flow-based tunnel push
100AT_CHECK([ovs-ofctl mod-flows int-br "action=set_field:1.1.2.94->tun_dst,set_field:1->tun_erspan_dir,set_field:0x1->tun_erspan_hwid,4"])
101AT_CHECK([ovs-appctl revalidator/wait])
102AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
103AT_CHECK([tail -1 stdout], [0],
104 [Datapath actions: clone(tnl_push(tnl_port(3),header(size=54,type=107,eth(dst=f8:bc:12:44:34:b8,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.94,proto=47,tos=0,ttl=64,frag=0x4000),erspan(ver=2,sid=0x1c8,dir=1,hwid=0x1)),out_port(100)),1)
105])
106
107dnl Check ERSPAN v2 flow-based tunnel push, erspan_ver=flow
108dnl Dynamically set erspan v2
109AT_CHECK([ovs-ofctl mod-flows int-br "action=set_field:1.1.2.94->tun_dst,set_field:2->tun_erspan_ver,set_field:1->tun_erspan_dir,set_field:0x1->tun_erspan_hwid,5"])
110AT_CHECK([ovs-appctl revalidator/wait])
111AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
112AT_CHECK([tail -1 stdout], [0],
113 [Datapath actions: clone(tnl_push(tnl_port(3),header(size=54,type=107,eth(dst=f8:bc:12:44:34:b8,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.94,proto=47,tos=0,ttl=64,frag=0x4000),erspan(ver=2,sid=0x38,dir=1,hwid=0x1)),out_port(100)),1)
114])
115
116dnl Dynamically set erspan v1
117AT_CHECK([ovs-ofctl mod-flows int-br "action=set_field:1.1.2.94->tun_dst,set_field:1->tun_erspan_ver,set_field:1->tun_erspan_idx,5"])
118AT_CHECK([ovs-appctl revalidator/wait])
119AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
120AT_CHECK([tail -1 stdout], [0],
121 [Datapath actions: clone(tnl_push(tnl_port(3),header(size=50,type=107,eth(dst=f8:bc:12:44:34:b8,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.94,proto=47,tos=0,ttl=64,frag=0x4000),erspan(ver=1,sid=0x38,idx=0x1)),out_port(100)),1)
122])
123
124dnl Check ERSPAN v2 flow-based tunnel push
125AT_CHECK([ovs-ofctl mod-flows int-br "action=set_field:1.1.2.94->tun_dst,set_field:1->tun_erspan_dir,set_field:0x1->tun_erspan_hwid,4"])
126AT_CHECK([ovs-appctl revalidator/wait])
127AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
128AT_CHECK([tail -1 stdout], [0],
129 [Datapath actions: clone(tnl_push(tnl_port(3),header(size=54,type=107,eth(dst=f8:bc:12:44:34:b8,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.94,proto=47,tos=0,ttl=64,frag=0x4000),erspan(ver=2,sid=0x1c8,dir=1,hwid=0x1)),out_port(100)),1)
130])
131
132dnl Check ERSPAN v2 flow-based tunnel push, erspan_ver=flow
133dnl Dynamically set erspan v2
134AT_CHECK([ovs-ofctl mod-flows int-br "action=set_field:1.1.2.94->tun_dst,set_field:2->tun_erspan_ver,set_field:1->tun_erspan_dir,set_field:0x1->tun_erspan_hwid,5"])
135AT_CHECK([ovs-appctl revalidator/wait])
136AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
137AT_CHECK([tail -1 stdout], [0],
138 [Datapath actions: clone(tnl_push(tnl_port(3),header(size=54,type=107,eth(dst=f8:bc:12:44:34:b8,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.94,proto=47,tos=0,ttl=64,frag=0x4000),erspan(ver=2,sid=0x38,dir=1,hwid=0x1)),out_port(100)),1)
139])
140
141dnl Dynamically set erspan v1
142AT_CHECK([ovs-ofctl mod-flows int-br "action=set_field:1.1.2.94->tun_dst,set_field:1->tun_erspan_ver,set_field:1->tun_erspan_idx,5"])
143AT_CHECK([ovs-appctl revalidator/wait])
144AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
145AT_CHECK([tail -1 stdout], [0],
146 [Datapath actions: clone(tnl_push(tnl_port(3),header(size=50,type=107,eth(dst=f8:bc:12:44:34:b8,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.94,proto=47,tos=0,ttl=64,frag=0x4000),erspan(ver=1,sid=0x38,idx=0x1)),out_port(100)),1)
147])
148
149dnl Check ERSPAN tunnel pop
150AT_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(0x0800),ipv4(src=1.1.11.93,dst=1.1.2.88,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
151AT_CHECK([tail -1 stdout], [0],
152 [Datapath actions: tnl_pop(3)
153])
154
155AT_CHECK([ovs-ofctl del-flows int-br])
156
157dnl Check decapsulation of ERSPAN v1
158dnl Hex dump: GRE:(100088be)
159dnl ERSPAN: v1, session id = 0x7b (1000007b), index=3 (00000003)
160AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6408004500007e79464000402fba550101025c01010258100088be000000011000007b00000003fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
161
162AT_CHECK([ovs-appctl revalidator/wait])
163AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port 2'], [0], [dnl
164 port 2: rx pkts=1, bytes=98, drop=?, errs=?, frame=?, over=?, crc=?
165])
166
167dnl Check decapsulation ERSPAN v2
168dnl Hex dump: GRE:(100022eb)
169dnl ERSPAN: v2, session id = 0x237 (20000237), hwid =7, dir = 1 (00000078)
170AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6408004500007e79464000402fba550101025c01010258100022eb000000012000023710abcd0100000078fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
171
172AT_CHECK([ovs-appctl revalidator/wait])
173AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port 3'], [0], [dnl
174 port 3: rx pkts=1, bytes=98, drop=?, errs=?, frame=?, over=?, crc=?
175])
176
177dnl Check ERSPAN encap in pcap file
178dnl This ARP reply from p0 has two effects:
179dnl 1. The ARP cache will learn that 1.1.2.92 is at f8:bc:12:44:34:b6.
180dnl 2. The br0 mac learning will learn that f8:bc:12:44:34:b6 is on p0.
181AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(2),eth(src=f8:bc:12:44:34:b6,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00)'])
182
183AT_CHECK([ovs-vsctl -- set Interface p0 options:tx_pcap=p0.pcap])
184
185dnl Output to tunnel from a int-br internal port
186AT_CHECK([ovs-ofctl add-flow int-br "in_port=LOCAL,actions=output:2"])
187AT_CHECK([ovs-appctl revalidator/wait])
188AT_CHECK([ovs-appctl netdev-dummy/receive int-br '50540000000a5054000000091234'])
189dnl 100088be: GRE with ERSPANv1, 00000001: Seqno, 1000007b: v1 with 0x7b session ID (key)
190OVS_WAIT_UNTIL([test `ovs-pcap p0.pcap | grep 100088be000000011000007b | wc -l` -ge 1])
191
192AT_CHECK([ovs-ofctl mod-flows int-br "in_port=LOCAL,actions=output:3"])
193AT_CHECK([ovs-appctl revalidator/wait])
194AT_CHECK([ovs-appctl netdev-dummy/receive int-br '50540000000a5054000000091235'])
195dnl 100022eb: GRE with ERSPANv2, 00000001: Seqno, 20000237: v2 with 0x237 session ID (key)
196OVS_WAIT_UNTIL([test `ovs-pcap p0.pcap | grep 100022eb0000000120000237 | wc -l` -ge 1])
197
198OVS_VSWITCHD_STOP
199AT_CLEANUP
200
a36de779
PS
201AT_SETUP([tunnel_push_pop - action])
202
7f9b8504 203OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 other-config:hwaddr=aa:55:aa:55:00:00])
d32754b4
JR
204AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
205AT_CHECK([ovs-vsctl add-port int-br t2 -- set Interface t2 type=vxlan \
a36de779
PS
206 options:remote_ip=1.1.2.92 options:key=123 ofport_request=2\
207 -- add-port int-br t1 -- set Interface t1 type=gre \
c876a4bb
RL
208 options:remote_ip=1.1.2.92 options:key=456 ofport_request=3\
209 -- add-port int-br t3 -- set Interface t3 type=vxlan \
8e45fe7c 210 options:remote_ip=1.1.2.93 options:out_key=flow options:csum=true ofport_request=4\
e5a1caee 211 -- add-port int-br t4 -- set Interface t4 type=geneve \
eaac0f22 212 options:remote_ip=flow options:key=123 ofport_request=5\
bf4bbd0d
PS
213 -- add-port int-br t5 -- set Interface t5 type=geneve \
214 options:remote_ip=1.1.2.93 options:out_key=flow options:egress_pkt_mark=1234 ofport_request=6\
63171f04 215 -- add-port int-br t6 -- set Interface t6 type=gre \
875ab130 216 options:remote_ip=1.1.2.92 options:key=456 options:packet_type=legacy_l3 ofport_request=7\
439f39cb
GS
217 -- add-port int-br t7 -- set Interface t7 type=vxlan \
218 options:remote_ip=1.1.2.92 options:key=345 options:exts=gpe ofport_request=8\
3c6d05a0
WT
219 -- add-port int-br t8 -- set Interface t8 type=gtpu \
220 options:remote_ip=1.1.2.92 options:key=123 ofport_request=9\
c876a4bb 221 ], [0])
a36de779
PS
222
223AT_CHECK([ovs-appctl dpif/show], [0], [dnl
224dummy@ovs-dummy: hit:0 missed:0
7be29a47
BP
225 br0:
226 br0 65534/100: (dummy-internal)
227 p0 1/1: (dummy)
228 int-br:
229 int-br 65534/2: (dummy-internal)
230 t1 3/3: (gre: key=456, remote_ip=1.1.2.92)
231 t2 2/4789: (vxlan: key=123, remote_ip=1.1.2.92)
232 t3 4/4789: (vxlan: csum=true, out_key=flow, remote_ip=1.1.2.93)
233 t4 5/6081: (geneve: key=123, remote_ip=flow)
234 t5 6/6081: (geneve: egress_pkt_mark=1234, out_key=flow, remote_ip=1.1.2.93)
235 t6 7/3: (gre: key=456, packet_type=legacy_l3, remote_ip=1.1.2.92)
236 t7 8/4789: (vxlan: key=345, remote_ip=1.1.2.92)
3c6d05a0 237 t8 9/2152: (gtpu: key=123, remote_ip=1.1.2.92)
a36de779
PS
238])
239
7f9b8504
PS
240dnl First setup dummy interface IP address, then add the route
241dnl so that tnl-port table can get valid IP address for the device.
a36de779
PS
242AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
243])
80c4589a
PS
244AT_CHECK([ovs-appctl netdev-dummy/ip6addr br0 2001:cafe::88/24], [0], [OK
245])
246
7f9b8504
PS
247AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK
248])
a36de779 249
ed52ca57
PS
250AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0 pkt_mark=1234], [0], [OK
251])
252
a36de779
PS
253AT_CHECK([ovs-ofctl add-flow br0 action=normal])
254
80c4589a
PS
255dnl Check ARP request
256AT_CHECK([ovs-vsctl -- set Interface p0 options:pcap=p0.pcap])
257
258AT_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)'])
e9407a81
DDP
259
260dnl Wait for the two ARP requests to be sent. Sometimes the system
261dnl can be slow (e.g. under valgrind)
262OVS_WAIT_UNTIL([test `ovs-pcap p0.pcap | sort | uniq | wc -l` -ge 2])
263
56e18591 264AT_CHECK([ovs-pcap p0.pcap > p0.pcap.txt 2>&1])
80c4589a 265
56e18591
PS
266AT_CHECK([cat p0.pcap.txt | grep 101025c | uniq], [0], [dnl
267ffffffffffffaa55aa55000008060001080006040001aa55aa550000010102580000000000000101025c
80c4589a 268])
56e18591
PS
269AT_CHECK([cat p0.pcap.txt | grep 101025d | uniq], [0], [dnl
270ffffffffffffaa55aa55000008060001080006040001aa55aa550000010102580000000000000101025d
80c4589a
PS
271])
272
a36de779 273dnl Check ARP Snoop
83c2757b
ZB
274AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(1),eth(src=f8:bc:12:44:34:c8,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:c8,tha=00:00:00:00:00:00)'])
275
276ovs-appctl time/warp 1000
277ovs-appctl time/warp 1000
278
279AT_CHECK([ovs-appctl tnl/neigh/show | grep br0 | sort], [0], [dnl
2801.1.2.92 f8:bc:12:44:34:c8 br0
281])
282
283dnl Receiving ARP reply with incorrect 'tip' should not alter tunnel neighbor cache
284AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(1),eth(src=f8:bc:12:44:34:b8,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.90,op=2,sha=f8:bc:12:44:34:b8,tha=00:00:00:00:00:00)'])
285
286ovs-appctl time/warp 1000
287ovs-appctl time/warp 1000
288
289AT_CHECK([ovs-appctl tnl/neigh/show | grep br0 | sort], [0], [dnl
2901.1.2.92 f8:bc:12:44:34:c8 br0
291])
292
293dnl Receiving ARP reply with incorrect VLAN id should not alter tunnel neighbor cache
294AT_CHECK([ovs-vsctl set port br0 tag=10])
295AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(1),eth(src=f8:bc:12:44:34:b6,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00))'])
296
297ovs-appctl time/warp 1000
298ovs-appctl time/warp 1000
299
300AT_CHECK([ovs-appctl tnl/neigh/show | grep br0 | sort], [0], [dnl
3011.1.2.92 f8:bc:12:44:34:c8 br0
302])
303
304dnl Receiving ARP reply with correct VLAN id should alter tunnel neighbor cache
305AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(1),eth(src=f8:bc:12:44:34:b6,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8100),vlan(vid=10,pcp=7),encap(eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00))'])
306
307ovs-appctl time/warp 1000
308ovs-appctl time/warp 1000
309
310AT_CHECK([ovs-appctl tnl/neigh/show | grep br0 | sort], [0], [dnl
3111.1.2.92 f8:bc:12:44:34:b6 br0
312])
313
314dnl Receiving ARP reply in overlay bridge should not alter tunnel neighbor cache
315AT_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])
316AT_CHECK([ovs-appctl netdev-dummy/receive p1 'recirc_id(0),in_port(200),eth(src=f8:bc:12:44:34:c8,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:c8,tha=00:00:00:00:00:00)'])
317
318ovs-appctl time/warp 1000
319ovs-appctl time/warp 1000
320
321AT_CHECK([ovs-appctl tnl/neigh/show | grep br | sort], [0], [dnl
3221.1.2.92 f8:bc:12:44:34:b6 br0
323])
324
325dnl Receive ARP reply without VLAN header
326AT_CHECK([ovs-vsctl set port br0 tag=0])
327AT_CHECK([ovs-appctl tnl/neigh/flush], [0], [OK
328])
329
330ovs-appctl time/warp 1000
331ovs-appctl time/warp 1000
332
2ce9e71b
ZB
333AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(1),eth(src=f8:bc:12:44:34:b6,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00)'])
334AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(1),eth(src=f8:bc:12:44:34:b7,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.93,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b7,tha=00:00:00:00:00:00)'])
a36de779 335
83c2757b
ZB
336ovs-appctl time/warp 1000
337ovs-appctl time/warp 1000
338
7eca52f1 339AT_CHECK([ovs-appctl tnl/neigh/show | tail -n+3 | sort], [0], [dnl
4673650f
TLSC
3401.1.2.92 f8:bc:12:44:34:b6 br0
3411.1.2.93 f8:bc:12:44:34:b7 br0
a36de779
PS
342])
343
6d9e94b5
AZ
344AT_CHECK([ovs-appctl tnl/ports/show |sort], [0], [dnl
345Listening ports:
c8025aee
BN
346genev_sys_6081 (6081) ref_cnt=2
347gre_sys (3) ref_cnt=2
3c6d05a0 348gtpu_sys_2152 (2152) ref_cnt=1
c8025aee 349vxlan_sys_4789 (4789) ref_cnt=3
6d9e94b5
AZ
350])
351
a36de779 352dnl Check VXLAN tunnel pop
7f9b8504 353AT_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(0x0800),ipv4(src=1.1.2.92,dst=1.1.2.88,proto=17,tos=0,ttl=64,frag=no),udp(src=51283,dst=4789)'], [0], [stdout])
a36de779
PS
354AT_CHECK([tail -1 stdout], [0],
355 [Datapath actions: tnl_pop(4789)
356])
357
358dnl Check GRE tunnel pop
7f9b8504 359AT_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(0x0800),ipv4(src=1.1.2.92,dst=1.1.2.88,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
a36de779 360AT_CHECK([tail -1 stdout], [0],
d32754b4 361 [Datapath actions: tnl_pop(3)
a36de779
PS
362])
363
e5a1caee 364dnl Check Geneve tunnel pop
7f9b8504 365AT_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(0x0800),ipv4(src=1.1.2.92,dst=1.1.2.88,proto=17,tos=0,ttl=64,frag=no),udp(src=51283,dst=6081)'], [0], [stdout])
e5a1caee
JG
366AT_CHECK([tail -1 stdout], [0],
367 [Datapath actions: tnl_pop(6081)
368])
369
bf4bbd0d
PS
370dnl Check Geneve tunnel (t6) pop
371AT_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(0x0800),ipv4(src=1.1.2.96,dst=1.1.2.88,proto=17,tos=0,ttl=64,frag=no),udp(src=51283,dst=6081)'], [0], [stdout])
372AT_CHECK([tail -1 stdout], [0],
373 [Datapath actions: tnl_pop(6081)
374])
375
3c6d05a0
WT
376dnl Check GTP-U tunnel pop
377AT_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(0x0800),ipv4(src=1.1.2.92,dst=1.1.2.88,proto=17,tos=0,ttl=64,frag=no),udp(src=51283,dst=2152)'],
378[0], [stdout])
379AT_CHECK([tail -1 stdout], [0],
380 [Datapath actions: tnl_pop(2152)
381])
382
a36de779
PS
383dnl Check VXLAN tunnel push
384AT_CHECK([ovs-ofctl add-flow int-br action=2])
beb75a40 385AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
a36de779 386AT_CHECK([tail -1 stdout], [0],
2ce9e71b 387 [Datapath actions: clone(tnl_push(tnl_port(4789),header(size=50,type=4,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=4789,csum=0x0),vxlan(flags=0x8000000,vni=0x7b)),out_port(100)),1)
a36de779
PS
388])
389
439f39cb
GS
390dnl Check VXLAN GPE tunnel push
391AT_CHECK([ovs-ofctl add-flow int-br action=8])
392AT_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])
393AT_CHECK([tail -1 stdout], [0],
2ce9e71b 394 [Datapath actions: clone(tnl_push(tnl_port(4789),header(size=50,type=4,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=4789,csum=0x0),vxlan(flags=0xc000003,vni=0x159)),out_port(100)),1)
439f39cb
GS
395])
396
8e45fe7c 397dnl Check VXLAN tunnel push set tunnel id by flow and checksum
c876a4bb 398AT_CHECK([ovs-ofctl add-flow int-br "actions=set_tunnel:124,4"])
beb75a40 399AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
c876a4bb 400AT_CHECK([tail -1 stdout], [0],
2ce9e71b 401 [Datapath actions: clone(tnl_push(tnl_port(4789),header(size=50,type=4,eth(dst=f8:bc:12:44:34:b7,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.93,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=4789,csum=0xffff),vxlan(flags=0x8000000,vni=0x7c)),out_port(100)),1)
c876a4bb
RL
402])
403
a36de779
PS
404dnl Check GRE tunnel push
405AT_CHECK([ovs-ofctl add-flow int-br action=3])
beb75a40 406AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
a36de779 407AT_CHECK([tail -1 stdout], [0],
2ce9e71b 408 [Datapath actions: clone(tnl_push(tnl_port(3),header(size=42,type=3,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x4000),gre((flags=0x2000,proto=0x6558),key=0x1c8)),out_port(100)),1)
a36de779
PS
409])
410
63171f04
JS
411dnl Check L3GRE tunnel push
412AT_CHECK([ovs-ofctl add-flow int-br action=7])
413AT_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])
414AT_CHECK([tail -1 stdout], [0],
2ce9e71b 415 [Datapath actions: pop_eth,clone(tnl_push(tnl_port(3),header(size=42,type=3,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x4000),gre((flags=0x2000,proto=0x800),key=0x1c8)),out_port(100)),1)
63171f04
JS
416])
417
e5a1caee 418dnl Check Geneve tunnel push
eaac0f22 419AT_CHECK([ovs-ofctl add-flow int-br "actions=set_field:1.1.2.92->tun_dst,5"])
beb75a40 420AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
e5a1caee 421AT_CHECK([tail -1 stdout], [0],
2ce9e71b 422 [Datapath actions: clone(tnl_push(tnl_port(6081),header(size=50,type=5,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=6081,csum=0x0),geneve(vni=0x7b)),out_port(100)),1)
e5a1caee
JG
423])
424
bf4bbd0d
PS
425dnl Check Geneve tunnel push with pkt-mark
426AT_CHECK([ovs-ofctl add-flow int-br "actions=set_tunnel:234,6"])
beb75a40 427AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
bf4bbd0d 428AT_CHECK([tail -1 stdout], [0],
2ce9e71b 429 [Datapath actions: set(skb_mark(0x4d2)),clone(tnl_push(tnl_port(6081),header(size=50,type=5,eth(dst=f8:bc:12:44:34:b7,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.93,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=6081,csum=0x0),geneve(vni=0xea)),out_port(100)),1)
bf4bbd0d
PS
430])
431
5bb08b0e 432dnl Check Geneve tunnel push with options
4e548ad9 433AT_CHECK([ovs-ofctl add-tlv-map int-br "{class=0xffff,type=0x80,len=4}->tun_metadata0"])
5bb08b0e 434AT_CHECK([ovs-ofctl add-flow int-br "actions=set_field:1.1.2.92->tun_dst,set_field:0xa->tun_metadata0,5"])
beb75a40 435AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
5bb08b0e 436AT_CHECK([tail -1 stdout], [0],
2ce9e71b 437 [Datapath actions: clone(tnl_push(tnl_port(6081),header(size=58,type=5,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=6081,csum=0x0),geneve(crit,vni=0x7b,options({class=0xffff,type=0x80,len=4,0xa}))),out_port(100)),1)
5bb08b0e
JG
438])
439
3c6d05a0
WT
440dnl Check GTP-U tunnel push
441AT_CHECK([ovs-ofctl add-flow int-br "actions=9"])
442AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'],
443[0], [stdout])
444AT_CHECK([tail -1 stdout], [0],
445 [Datapath actions: pop_eth,clone(tnl_push(tnl_port(2152),header(size=50,type=110,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=2152,csum=0x0),gtpu(flags=0x30,msgtype=255,teid=0x7b)),out_port(100)),1)
446])
447AT_CHECK([ovs-ofctl del-flows int-br])
448
6432e527 449dnl Check decapsulation of GRE packet
f41256d7 450AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6408004500007e79464000402fba550101025c0101025820006558000001c8fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
63171f04
JS
451AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6408004500007e79464000402fba550101025c0101025820006558000001c8fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
452AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6408004500007e79464000402fba550101025c0101025820006558000001c8fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
6432e527
JG
453ovs-appctl time/warp 1000
454
455AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port 3'], [0], [dnl
63171f04 456 port 3: rx pkts=3, bytes=294, drop=?, errs=?, frame=?, over=?, crc=?
6432e527
JG
457])
458
63171f04
JS
459dnl Check decapsulation of L3GRE packet
460AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6408004500007079464000402fba630101025c0101025820000800000001c845000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
461AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6408004500007079464000402fba630101025c0101025820000800000001c845000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
462AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6408004500007079464000402fba630101025c0101025820000800000001c845000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
463ovs-appctl time/warp 1000
6432e527
JG
464ovs-appctl time/warp 1000
465
63171f04
JS
466AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port 7'], [0], [dnl
467 port 7: rx pkts=3, bytes=252, drop=?, errs=?, frame=?, over=?, crc=?
468])
469
a13a0209
AT
470AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6408004500007079464000402fba600101025c0101025820000800000001c845000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
471
472ovs-appctl time/warp 5000
473
474AT_CHECK([
475ovs-appctl coverage/read-counter datapath_drop_tunnel_pop_error
476], [0], [dnl
4771
478])
479
480AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6408004503007079464000402fba600101025c0101025820000800000001c845000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
481
482ovs-appctl time/warp 5000
483
484AT_CHECK([
485ovs-appctl coverage/read-counter drop_action_congestion
486], [0], [dnl
4871
488])
489
490
63171f04
JS
491dnl Check GREL3 only accepts non-fragmented packets?
492AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab6408004500007e79464000402fba550101025c0101025820000800000001c8fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
493
83c2757b
ZB
494ovs-appctl time/warp 1000
495ovs-appctl time/warp 1000
496
63171f04
JS
497AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port [[37]]' | sort], [0], [dnl
498 port 3: rx pkts=3, bytes=294, drop=?, errs=?, frame=?, over=?, crc=?
a13a0209 499 port 7: rx pkts=5, bytes=434, drop=?, errs=?, frame=?, over=?, crc=?
6432e527
JG
500])
501
5bb08b0e 502dnl Check decapsulation of Geneve packet with options
2234a7db
JG
503AT_CAPTURE_FILE([ofctl_monitor.log])
504AT_CHECK([ovs-ofctl monitor int-br 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
505
5bb08b0e 506AT_CHECK([ovs-ofctl del-flows int-br])
2234a7db 507AT_CHECK([ovs-ofctl add-flow int-br "tun_metadata0=0xa/0xf,actions=5,controller"])
f41256d7 508AT_CHECK([ovs-appctl netdev-dummy/receive p0 'aa55aa550000001b213cab64080045000096794640004011ba5b0101025c01010258308817c1008200000400655800007b00ffff80010000000affff00010000000bfe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
5bb08b0e 509
2234a7db
JG
510OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2])
511OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
512
513AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6409e008 514NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=98 tun_id=0x7b,tun_src=1.1.2.92,tun_dst=1.1.2.88,tun_metadata0=0xa,in_port=5 (via action) data_len=98 (unbuffered)
2234a7db
JG
515icmp,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
516])
517
5bb08b0e 518AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port 5'], [0], [dnl
d6e3feb5 519 port 5: rx pkts=1, bytes=98, drop=?, errs=?, frame=?, over=?, crc=?
5bb08b0e 520])
f5ca7ec2 521AT_CHECK([ovs-appctl dpif/dump-flows int-br | grep 'in_port(6081)'], [0], [dnl
a13a0209 522tunnel(tun_id=0x7b,src=1.1.2.92,dst=1.1.2.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=2,rule_cookie=0,controller_id=0,max_len=65535))
5bb08b0e
JG
523])
524
c8025aee
BN
525ovs-appctl time/warp 10000
526
527AT_CHECK([ovs-vsctl del-port int-br t3 \
528 -- del-port int-br t5 \
529 -- set Interface t1 type=vxlan \
530 -- set Interface t2 options:dst_port=4790 \
531 ], [0])
532
533dnl Check tunnel lookup entries after deleting/reconfiguring some ports
534AT_CHECK([ovs-appctl tnl/ports/show |sort], [0], [dnl
535Listening ports:
536genev_sys_6081 (6081) ref_cnt=1
537gre_sys (3) ref_cnt=1
3c6d05a0 538gtpu_sys_2152 (2152) ref_cnt=1
c8025aee
BN
539vxlan_sys_4789 (4789) ref_cnt=2
540vxlan_sys_4790 (4790) ref_cnt=1
541])
542
543AT_CHECK([ovs-vsctl del-port int-br t1 \
544 -- del-port int-br t2 \
545 -- del-port int-br t4 \
546 -- del-port int-br t6 \
547 -- del-port int-br t7 \
3c6d05a0 548 -- del-port int-br t8 \
c8025aee
BN
549 ], [0])
550
551dnl Check tunnel lookup entries after deleting all remaining tunnel ports
552AT_CHECK([ovs-appctl tnl/ports/show |sort], [0], [dnl
553Listening ports:
554])
555
a13a0209
AT
556OVS_VSWITCHD_STOP(["/dropping tunnel packet marked ECN CE but is not ECN capable/d
557/ip packet has invalid checksum/d"])
a36de779 558AT_CLEANUP
8a41d7c3
DDP
559
560AT_SETUP([tunnel_push_pop - packet_out])
561
562OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 other-config:hwaddr=aa:55:aa:55:00:00])
563AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg])
564AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy])
565AT_CHECK([ovs-vsctl add-port int-br t2 -- set Interface t2 type=geneve \
566 options:remote_ip=1.1.2.92 options:key=123 ofport_request=2 \
567 ])
568
569dnl First setup dummy interface IP address, then add the route
570dnl so that tnl-port table can get valid IP address for the device.
571AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
572])
573
574AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK
575])
576
577AT_CHECK([ovs-ofctl add-flow br0 action=normal])
578
579dnl This ARP reply from p0 has two effects:
580dnl 1. The ARP cache will learn that 1.1.2.92 is at f8:bc:12:44:34:b6.
581dnl 2. The br0 mac learning will learn that f8:bc:12:44:34:b6 is on p0.
582AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(2),eth(src=f8:bc:12:44:34:b6,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00)'])
583
584AT_CHECK([ovs-vsctl -- set Interface p0 options:tx_pcap=p0.pcap])
585
586dnl Output to tunnel from a int-br internal port
587AT_CHECK([ovs-ofctl add-flow int-br "in_port=LOCAL,actions=output:2"])
588AT_CHECK([ovs-appctl netdev-dummy/receive int-br '50540000000a5054000000091234'])
589OVS_WAIT_UNTIL([test `ovs-pcap p0.pcap | grep 50540000000a5054000000091234 | wc -l` -ge 1])
590
591dnl Output to tunnel from the controller
592AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out int-br CONTROLLER "output:2" '50540000000a5054000000091235'])
593OVS_WAIT_UNTIL([test `ovs-pcap p0.pcap | grep 50540000000a5054000000091235 | wc -l` -ge 1])
594
595OVS_VSWITCHD_STOP
596AT_CLEANUP
621268a6
WT
597
598AT_SETUP([tunnel_push_pop - underlay bridge match])
599
600OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 other-config:hwaddr=aa:55:aa:55:00:00])
601AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
602AT_CHECK([ovs-vsctl add-port int-br t1 -- set Interface t1 type=gre \
0ffff497 603 options:remote_ip=1.1.2.92 options:key=456 options:seq=true ofport_request=3], [0])
621268a6
WT
604
605AT_CHECK([ovs-appctl dpif/show], [0], [dnl
606dummy@ovs-dummy: hit:0 missed:0
7be29a47
BP
607 br0:
608 br0 65534/100: (dummy-internal)
609 p0 1/1: (dummy)
610 int-br:
611 int-br 65534/2: (dummy-internal)
612 t1 3/3: (gre: key=456, remote_ip=1.1.2.92, seq=true)
621268a6
WT
613])
614
615AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
616])
617AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK
618])
619AT_CHECK([ovs-ofctl add-flow br0 'arp,priority=1,action=normal'])
620
621dnl Use arp reply to achieve tunnel next hop mac binding
2ce9e71b 622AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(1),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00)'])
621268a6
WT
623
624AT_CHECK([ovs-appctl tnl/neigh/show | tail -n+3 | sort], [0], [dnl
6251.1.2.92 f8:bc:12:44:34:b6 br0
626])
627
628AT_CHECK([ovs-ofctl add-flow br0 'ip,ip_proto=47,nw_tos=0,eth_src=aa:55:aa:55:00:00,eth_dst=f8:bc:12:44:34:b6,ip_src=1.1.2.88,ip_dst=1.1.2.92,priority=99,action=normal'])
629
630dnl Direct traffic from the integration bridge to the GRE tunnel
631AT_CHECK([ovs-ofctl add-flow int-br action=3])
632
beb75a40 633AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=17,tos=0,ttl=64,frag=no),udp(src=51283,dst=4789)'], [0], [stdout])
621268a6 634AT_CHECK([tail -1 stdout], [0],
7dc18ae9 635 [Datapath actions: clone(tnl_push(tnl_port(3),header(size=46,type=3,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x4000),gre((flags=0x3000,proto=0x6558),key=0x1c8,seq=0x0)),out_port(100)),1)
621268a6
WT
636])
637
638dnl Verify outer L2 and L3 header flow fields can be matched in the underlay bridge
639AT_CHECK([ovs-appctl netdev-dummy/receive int-br '50540000000a5054000000091234'])
640AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl)
641 n_packets=1, n_bytes=42, priority=1,arp actions=NORMAL
0ffff497 642 n_packets=1, n_bytes=60, priority=99,ip,dl_src=aa:55:aa:55:00:00,dl_dst=f8:bc:12:44:34:b6,nw_src=1.1.2.88,nw_dst=1.1.2.92,nw_proto=47,nw_tos=0 actions=NORMAL
621268a6
WT
643NXST_FLOW reply:
644])
645
646OVS_VSWITCHD_STOP
647AT_CLEANUP