]> git.proxmox.com Git - ovs.git/blob - tests/dpif-netdev.at
System-tests: Improve reliability of an icmp test.
[ovs.git] / tests / dpif-netdev.at
1 AT_BANNER([dpif-netdev])
2
3 m4_divert_push([PREPARE_TESTS])
4 [
5 # Strips out uninteresting parts of flow output, as well as parts
6 # that vary from one run to another (e.g., timing and bond actions).
7 strip_timers () {
8 sed '
9 s/duration:[0-9]*\.[0-9]*/duration:0.0/
10 s/used:[0-9]*\.[0-9]*/used:0.0/
11 '
12 }
13
14 strip_xout () {
15 sed '
16 s/ufid:[-0-9a-f]* //
17 s/used:[0-9]*\.[0-9]*/used:0.0/
18 s/actions:.*/actions: <del>/
19 s/packets:[0-9]*/packets:0/
20 s/bytes:[0-9]*/bytes:0/
21 ' | sort
22 }
23
24 strip_xout_keep_actions () {
25 sed '
26 s/ufid:[-0-9a-f]* //
27 s/used:[0-9]*\.[0-9]*/used:0.0/
28 s/packets:[0-9]*/packets:0/
29 s/bytes:[0-9]*/bytes:0/
30 ' | sort
31 }
32
33 filter_flow_install () {
34 grep 'flow_add' | sed 's/.*flow_add: //' | sort | uniq
35 }
36
37 filter_flow_dump () {
38 grep 'flow_dump ' | sed '
39 s/.*flow_dump //
40 s/used:[0-9]*\.[0-9]*/used:0.0/
41 ' | sort | uniq
42 }
43
44 strip_metadata () {
45 sed 's/metadata=0x[0-9a-f]*/metadata=0x0/'
46 }
47 ]
48 m4_divert_pop([PREPARE_TESTS])
49
50 m4_define([DPIF_NETDEV_DUMMY_IFACE],
51 [AT_SETUP([dpif-netdev - $1 interface])
52 # Create br0 with interfaces p1 and p7
53 # and br1 with interfaces p2 and p8
54 # with p1 and p2 connected via unix domain socket
55 OVS_VSWITCHD_START(
56 [add-port br0 p1 -- set interface p1 type=$1 options:pstream=punix:$OVS_RUNDIR/p0.sock ofport_request=1 -- \
57 add-port br0 p7 -- set interface p7 ofport_request=7 type=$1 -- \
58 add-br br1 -- \
59 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
60 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
61 fail-mode=secure -- \
62 add-port br1 p2 -- set interface p2 type=$1 options:stream=unix:$OVS_RUNDIR/p0.sock ofport_request=2 -- \
63 add-port br1 p8 -- set interface p8 ofport_request=8 type=$1 --], [], [],
64 [m4_if([$1], [dummy-pmd], [--dummy-numa="0,0,0,0,1,1,1,1"], [])])
65 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
66
67 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
68 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
69 ovs-appctl time/stop
70 ovs-appctl time/warp 5000
71 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
72 AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
73 ovs-appctl time/warp 100
74 sleep 1 # wait for forwarders process packets
75
76 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
77 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
78 recirc_id(0),in_port(2),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
79 recirc_id(0),in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
80 recirc_id(0),in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
81 ])
82
83 OVS_VSWITCHD_STOP
84 AT_CLEANUP])
85
86 DPIF_NETDEV_DUMMY_IFACE([dummy])
87 DPIF_NETDEV_DUMMY_IFACE([dummy-pmd])
88
89 m4_define([DPIF_NETDEV_MISS_FLOW_INSTALL],
90 [AT_SETUP([dpif-netdev - miss upcall key matches flow_install - $1])
91 OVS_VSWITCHD_START(
92 [add-port br0 p1 -- set interface p1 type=$1 options:pstream=punix:$OVS_RUNDIR/p0.sock
93 set bridge br0 datapath-type=dummy other-config:datapath-id=1234 fail-mode=secure], [], [],
94 [m4_if([$1], [dummy-pmd], [--dummy-numa="0,0,0,0,1,1,1,1"], [])])
95 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
96
97 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
98 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
99 ovs-appctl ofproto/trace 'in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
100 sleep 1
101
102 AT_CHECK([grep -A 1 'miss upcall' ovs-vswitchd.log | tail -n 1], [0], [dnl
103 skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)
104 ])
105 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
106 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
107 ])
108
109 # Now, the same again without megaflows.
110 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
111 ])
112 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
113 sleep 1
114
115 AT_CHECK([grep -A 1 'miss upcall' ovs-vswitchd.log | tail -n 1], [0], [dnl
116 skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)
117 ])
118 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
119 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
120 skb_priority(0),skb_mark(0),ct_state(-new-est-rel-rpl-inv-trk-snat-dnat),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), actions: <del>
121 ])
122
123 OVS_VSWITCHD_STOP
124 AT_CLEANUP])
125
126 DPIF_NETDEV_MISS_FLOW_INSTALL([dummy])
127 DPIF_NETDEV_MISS_FLOW_INSTALL([dummy-pmd])
128
129 m4_define([DPIF_NETDEV_MISS_FLOW_DUMP],
130 [AT_SETUP([dpif-netdev - miss upcall key matches flow_dump - $1])
131 OVS_VSWITCHD_START(
132 [add-port br0 p1 -- set interface p1 type=$1 options:pstream=punix:$OVS_RUNDIR/p0.sock
133 set bridge br0 datapath-type=dummy other-config:datapath-id=1234 fail-mode=secure], [], [],
134 [m4_if([$1], [dummy-pmd], [--dummy-numa="0,0,0,0,1,1,1,1"], [])])
135 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
136 ], [])
137 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
138
139 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
140 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
141 sleep 1
142
143 AT_CHECK([grep -A 1 'miss upcall' ovs-vswitchd.log | tail -n 1], [0], [dnl
144 skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)
145 ])
146 AT_CHECK([filter_flow_dump < ovs-vswitchd.log | strip_xout], [0], [dnl
147 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions: <del>
148 ])
149
150 # Now, the same again without megaflows.
151 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
152 ])
153 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
154 ], [])
155 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
156 sleep 1
157
158 AT_CHECK([grep -A 1 'miss upcall' ovs-vswitchd.log | tail -n 1], [0], [dnl
159 skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)
160 ])
161 AT_CHECK([filter_flow_dump < ovs-vswitchd.log | strip_xout], [0], [dnl
162 skb_priority(0),skb_mark(0),ct_state(0/0xff),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:0, bytes:0, used:never, actions: <del>
163 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions: <del>
164 ])
165
166 OVS_VSWITCHD_STOP
167 AT_CLEANUP])
168
169 DPIF_NETDEV_MISS_FLOW_DUMP([dummy])
170 DPIF_NETDEV_MISS_FLOW_DUMP([dummy-pmd])
171
172 AT_SETUP([dpif-netdev - meters])
173 # Create br0 with interfaces p1 and p7
174 # and br1 with interfaces p2 and p8
175 # with p1 and p2 connected via unix domain socket
176 OVS_VSWITCHD_START(
177 [add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock ofport_request=1 -- \
178 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
179 add-br br1 -- \
180 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
181 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
182 fail-mode=secure -- \
183 add-port br1 p2 -- set interface p2 type=dummy options:stream=unix:$OVS_RUNDIR/p0.sock ofport_request=2 -- \
184 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
185 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
186
187 AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=1 pktps burst stats bands=type=drop rate=1 burst_size=1'])
188 AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=2 kbps burst stats bands=type=drop rate=1 burst_size=2'])
189 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 'in_port=1 action=meter:1,7'])
190 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 'in_port=7 action=meter:2,1'])
191 AT_CHECK([ovs-ofctl add-flow br1 'in_port=2 action=8'])
192 AT_CHECK([ovs-ofctl add-flow br1 'in_port=8 action=2'])
193 ovs-appctl time/stop
194
195 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-meters br0], [0], [dnl
196 OFPST_METER_CONFIG reply (OF1.3) (xid=0x2):
197 meter=1 pktps burst stats bands=
198 type=drop rate=1 burst_size=1
199
200 meter=2 kbps burst stats bands=
201 type=drop rate=1 burst_size=2
202 ])
203
204 ovs-appctl time/warp 5000
205 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
206 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
207 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
208 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
209 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
210 AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
211 AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
212 AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
213 AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
214 AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
215 sleep 1 # wait for forwarders process packets
216
217 # Meter 1 is measuring packets, allowing one packet per second with
218 # bursts of one packet, so 4 out of 5 packets should hit the drop
219 # band.
220 # Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). 4 packets
221 # (240 bytes == 1920 bits) pass, but the last packet should hit the drop band.
222 AT_CHECK([ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers], [0], [dnl
223 OFPST_METER reply (OF1.3) (xid=0x2):
224 meter:1 flow_count:1 packet_in_count:5 byte_in_count:300 duration:0.0s bands:
225 0: packet_count:4 byte_count:240
226
227 meter:2 flow_count:1 packet_in_count:5 byte_in_count:300 duration:0.0s bands:
228 0: packet_count:1 byte_count:60
229 ])
230
231 # Advance time by 1/2 second
232 ovs-appctl time/warp 500
233
234 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
235 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
236 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
237 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
238 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
239 AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
240 AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
241 AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
242 AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
243 AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60])
244 sleep 1 # wait for forwarders process packets
245
246 # Meter 1 is measuring packets, allowing one packet per second with
247 # bursts of one packet, so all 5 of the new packets should hit the drop
248 # band.
249 # Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). After 500ms
250 # there should be space for 80 + 500 bits, so one new 60 byte (480 bit) packet
251 # should pass, remaining 4 should hit the drop band.
252 AT_CHECK([ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers], [0], [dnl
253 OFPST_METER reply (OF1.3) (xid=0x2):
254 meter:1 flow_count:1 packet_in_count:10 byte_in_count:600 duration:0.0s bands:
255 0: packet_count:9 byte_count:540
256
257 meter:2 flow_count:1 packet_in_count:10 byte_in_count:600 duration:0.0s bands:
258 0: packet_count:5 byte_count:300
259 ])
260
261 AT_CHECK([cat ovs-vswitchd.log | filter_flow_install | strip_xout_keep_actions], [0], [dnl
262 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:meter(0),7
263 recirc_id(0),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:8
264 recirc_id(0),in_port(7),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:meter(1),1
265 recirc_id(0),in_port(8),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:2
266 ])
267
268 OVS_VSWITCHD_STOP
269 AT_CLEANUP