3 AT_SETUP([ofproto - echo request])
5 AT_CHECK([ovs-ofctl -vwarn probe br0])
9 AT_SETUP([ofproto - handling messages with bad version])
12 # Start a monitor running OpenFlow 1.0, then send the switch an OF1.1 features
14 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
15 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
16 AT_CAPTURE_FILE([monitor.log])
17 ovs-appctl -t ovs-ofctl ofctl/send 0205000801234567
18 ovs-appctl -t ovs-ofctl ofctl/barrier
19 ovs-appctl -t ovs-ofctl exit
21 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//
22 /ECHO/d' monitor.log], [0], [dnl
23 send: OFPT_FEATURES_REQUEST (OF1.1):
24 OFPT_ERROR (OF1.1): OFPBRC_BAD_VERSION
25 OFPT_FEATURES_REQUEST (OF1.1):
29 OVS_VSWITCHD_STOP(["/received OpenFlow version 0x02 != expected 01/d"])
32 AT_SETUP([ofproto - feature request, config request])
34 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
35 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
36 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
37 n_tables:254, n_buffers:256
38 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
39 actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
40 LOCAL(br0): addr:aa:55:aa:55:00:00
43 speed: 0 Mbps now, 0 Mbps max
44 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
49 AT_SETUP([ofproto - set OpenFlow port number])
51 [add-port br0 p1 -- set Interface p1 type=dummy --\
52 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=99])
53 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
55 s/ (xid=0x[0-9a-fA-F]*)//
56 s/00:0.$/00:0x/' < stdout]],
58 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
59 n_tables:254, n_buffers:256
60 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
61 actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
62 1(p1): addr:aa:55:aa:55:00:0x
65 speed: 0 Mbps now, 0 Mbps max
66 99(p2): addr:aa:55:aa:55:00:0x
69 speed: 0 Mbps now, 0 Mbps max
70 LOCAL(br0): addr:aa:55:aa:55:00:0x
73 speed: 0 Mbps now, 0 Mbps max
74 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
80 dnl This is really bare-bones.
81 dnl It at least checks request and reply serialization and deserialization.
82 AT_SETUP([ofproto - port stats - (OpenFlow 1.0)])
84 AT_CHECK([ovs-ofctl -vwarn dump-ports br0], [0], [stdout])
85 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
86 OFPST_PORT reply: 1 ports
87 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
88 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
93 AT_SETUP([ofproto - port stats - (OpenFlow 1.2)])
95 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports br0], [0], [stdout])
96 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
97 OFPST_PORT reply (OF1.2): 1 ports
98 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
99 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
104 AT_SETUP([ofproto - port stats - (OpenFlow 1.4)])
106 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-ports br0], [0], [stdout])
107 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/'],
109 OFPST_PORT reply (OF1.4): 1 ports
110 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
111 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
117 dnl This is really bare-bones.
118 dnl It at least checks request and reply serialization and deserialization.
119 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.0)])
121 AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], [stdout])
122 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
123 OFPST_PORT_DESC reply:
124 LOCAL(br0): addr:aa:55:aa:55:00:00
127 speed: 0 Mbps now, 0 Mbps max
132 dnl This is really bare-bones.
133 dnl It at least checks request and reply serialization and deserialization.
134 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.2)])
136 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc br0], [0], [stdout])
137 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
138 OFPST_PORT_DESC reply (OF1.2):
139 LOCAL(br0): addr:aa:55:aa:55:00:00
142 speed: 0 Mbps now, 0 Mbps max
147 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.5)])
149 ADD_OF_PORTS([br0], 1, 2, 3)
150 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0], [0], [stdout])
151 AT_CHECK([STRIP_XIDS stdout | sed 's/00:0./00:0x/'], [0], [dnl
152 OFPST_PORT_DESC reply (OF1.5):
153 1(p1): addr:aa:55:aa:55:00:0x
156 speed: 0 Mbps now, 0 Mbps max
157 2(p2): addr:aa:55:aa:55:00:0x
160 speed: 0 Mbps now, 0 Mbps max
161 3(p3): addr:aa:55:aa:55:00:0x
164 speed: 0 Mbps now, 0 Mbps max
165 LOCAL(br0): addr:aa:55:aa:55:00:0x
168 speed: 0 Mbps now, 0 Mbps max
170 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0 2], [0], [stdout])
171 AT_CHECK([STRIP_XIDS stdout | sed 's/00:0./00:0x/'], [0], [dnl
172 OFPST_PORT_DESC reply (OF1.5):
173 2(p2): addr:aa:55:aa:55:00:0x
176 speed: 0 Mbps now, 0 Mbps max
181 dnl This is really bare-bones.
182 dnl It at least checks request and reply serialization and deserialization.
183 AT_SETUP([ofproto - queue stats - (OpenFlow 1.0)])
185 AT_CHECK([ovs-ofctl -vwarn queue-stats br0], [0], [stdout])
186 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
187 OFPST_QUEUE reply: 0 queues
189 AT_CHECK([ovs-ofctl -vwarn queue-stats br0 ANY 5], [0],
190 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_QUEUE
191 OFPST_QUEUE request (xid=0x2):port=ANY queue=5
193 AT_CHECK([ovs-ofctl -vwarn queue-stats br0 10], [0],
194 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT
195 OFPST_QUEUE request (xid=0x2):port=10 queue=ALL
200 AT_SETUP([ofproto - queue stats - (OpenFlow 1.2)])
202 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0], [0], [stdout])
203 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
204 OFPST_QUEUE reply (OF1.2): 0 queues
206 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 ALL 5], [0],
207 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_QUEUE
208 OFPST_QUEUE request (OF1.2) (xid=0x2):port=ANY queue=5
210 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 10], [0],
211 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_PORT
212 OFPST_QUEUE request (OF1.2) (xid=0x2):port=10 queue=ALL
217 AT_SETUP([ofproto - queue stats - (OpenFlow 1.4)])
219 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0], [0], [stdout])
220 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
221 OFPST_QUEUE reply (OF1.4): 0 queues
223 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 ALL 5], [0],
224 [OFPT_ERROR (OF1.4) (xid=0x2): OFPQOFC_BAD_QUEUE
225 OFPST_QUEUE request (OF1.4) (xid=0x2):port=ANY queue=5
227 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 10], [0],
228 [OFPT_ERROR (OF1.4) (xid=0x2): OFPQOFC_BAD_PORT
229 OFPST_QUEUE request (OF1.4) (xid=0x2):port=10 queue=ALL
234 dnl This is really bare-bones.
235 dnl It at least checks request and reply serialization and deserialization.
236 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.0)])
238 ADD_OF_PORTS([br0], [1], [2])
239 AT_CHECK([ovs-ofctl queue-get-config br0 1], [0], [stdout])
240 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
241 OFPT_QUEUE_GET_CONFIG_REPLY: port=1
243 AT_CHECK([ovs-ofctl queue-get-config br0 10], [0],
244 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT
245 OFPT_QUEUE_GET_CONFIG_REQUEST (xid=0x2): port=10
250 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.2)])
252 ADD_OF_PORTS([br0], [1], [2])
253 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 1], [0], [stdout])
254 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
255 OFPT_QUEUE_GET_CONFIG_REPLY (OF1.2): port=1
257 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 10], [0],
258 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_PORT
259 OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.2) (xid=0x2): port=10
264 dnl This is really bare-bones.
265 dnl It at least checks request and reply serialization and deserialization.
266 dnl Actions definition listed in both supported formats (w/ actions=)
267 AT_SETUP([ofproto - no group support (OpenFlow 1.0)])
269 AT_DATA([groups.txt], [dnl
270 group_id=1234,type=all,bucket=output:10
271 group_id=1235,type=all,bucket=actions=output:10
273 AT_DATA([stderr], [dnl
274 ovs-ofctl: none of the usable flow formats (OXM,OpenFlow11) is among the allowed flow formats (OpenFlow10,NXM)
276 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-groups br0 groups.txt], [1], ,[stderr])
277 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn mod-group br0 'group_id=1234,type=all,bucket=output:10'], [1], ,[stderr])
278 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0], [1], ,[stderr])
279 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0 ], [1], ,[stderr])
283 dnl This is really bare-bones.
284 dnl It at least checks request and reply serialization and deserialization.
285 dnl Actions definition listed in both supported formats (w/ actions=)
286 AT_SETUP([ofproto - del group (OpenFlow 1.1)])
288 AT_DATA([groups.txt], [dnl
289 group_id=1234,type=all,bucket=output:10
290 group_id=1235,type=all,bucket=actions=output:10
292 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
293 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0 ], [0], [stdout])
294 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
295 OFPST_GROUP_DESC reply (OF1.1):
296 group_id=1234,type=all,bucket=actions=output:10
297 group_id=1235,type=all,bucket=actions=output:10
299 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
300 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
301 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
302 OFPST_GROUP_DESC reply (OF1.1):
303 group_id=1235,type=all,bucket=actions=output:10
305 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
306 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
307 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
308 OFPST_GROUP_DESC reply (OF1.1):
309 group_id=1235,type=all,bucket=actions=output:10
311 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0], [0])
312 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
313 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
314 OFPST_GROUP_DESC reply (OF1.1):
318 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=0xfffffff0],
319 [1], [], [ovs-ofctl: invalid group id 4294967280
324 dnl This is really bare-bones.
325 dnl It at least checks request and reply serialization and deserialization.
326 dnl Actions definition listed in both supported formats (w/ actions=)
327 AT_SETUP([ofproto - add indirect group])
329 dnl indirect group must have exactly one bucket
330 AT_DATA([stderr], [dnl
331 OFPT_ERROR (OF1.1) (xid=0x2): OFPGMFC_INVALID_GROUP
332 OFPT_GROUP_MOD (OF1.1) (xid=0x2): ***decode error: OFPGMFC_INVALID_GROUP***
334 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1234,type=indirect'], [1], , [stderr])
335 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1235,type=indirect,bucket=output:10'])
336 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1236,type=indirect,bucket=output:10,bucket=output:11'], [1], , [stderr])
340 dnl This is really bare-bones.
341 dnl It at least checks request and reply serialization and deserialization.
342 dnl Actions definition listed in both supported formats (w/ actions=)
343 AT_SETUP([ofproto - del group (OpenFlow 1.5)])
345 AT_DATA([groups.txt], [dnl
346 group_id=1233,type=select,selection_method=hash,bucket=output:10,bucket=output:11
347 group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11
348 group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
350 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
351 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
352 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
353 OFPST_GROUP_DESC reply (OF1.5):
354 group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
356 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
357 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
358 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
359 OFPST_GROUP_DESC reply (OF1.5):
360 group_id=1235,type=all,bucket=bucket_id:2,actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
361 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
363 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
364 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
365 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
366 OFPST_GROUP_DESC reply (OF1.5):
367 group_id=1235,type=all,bucket=bucket_id:2,actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
368 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
370 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0], [0])
371 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
372 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
373 OFPST_GROUP_DESC reply (OF1.5):
378 dnl This is really bare-bones.
379 dnl It at least checks request and reply serialization and deserialization.
380 AT_SETUP([ofproto - del group deletes flows])
382 AT_DATA([groups.txt], [dnl
383 group_id=1234,type=all,bucket=output:10
384 group_id=1235,type=all,bucket=output:10
386 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
387 AT_DATA([flows.txt], [dnl
388 tcp actions=group:1234
389 udp actions=group:1235
391 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt])
392 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
394 tcp actions=group:1234
395 udp actions=group:1235
396 OFPST_FLOW reply (OF1.1):
398 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
399 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
401 udp actions=group:1235
402 OFPST_FLOW reply (OF1.1):
404 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
405 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
407 udp actions=group:1235
408 OFPST_FLOW reply (OF1.1):
410 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0])
411 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
413 OFPST_FLOW reply (OF1.1):
418 dnl This is really bare-bones.
419 dnl It at least checks request and reply serialization and deserialization.
420 dnl Actions definition listed in both supported formats (w/ actions=)
421 AT_SETUP([ofproto - insert buckets])
423 AT_DATA([groups.txt], [dnl
424 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
426 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
427 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
428 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
429 OFPST_GROUP_DESC reply (OF1.5):
430 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
432 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1])
433 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
434 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
435 OFPST_GROUP_DESC reply (OF1.5):
436 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
438 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15])
439 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
440 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
441 OFPST_GROUP_DESC reply (OF1.5):
442 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
445 # Verify that duplicate bucket IDs are rejected.
446 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15], [1], [], [stderr])
447 AT_CHECK([STRIP_XIDS stderr | sed '/truncated/,$d'], [0], [dnl
448 OFPT_ERROR (OF1.5): OFPGMFC_BUCKET_EXISTS
449 OFPT_GROUP_MOD (OF1.5):
452 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15])
453 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
454 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
455 OFPST_GROUP_DESC reply (OF1.5):
456 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
458 AT_DATA([buckets.txt], [dnl
459 group_id=1234,command_bucket_id=11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13
461 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 - < buckets.txt])
462 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
463 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
464 OFPST_GROUP_DESC reply (OF1.5):
465 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
467 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15,bucket=bucket_id:20,actions=output:20,bucket=bucket_id:21,actions=output:21])
468 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
469 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
470 OFPST_GROUP_DESC reply (OF1.5):
471 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:20,actions=output:20,bucket=bucket_id:21,actions=output:21
475 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=0xffffff01,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [],
476 [ovs-ofctl: invalid command bucket id 4294967041
478 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [],
479 [ovs-ofctl: insert-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
484 dnl This is really bare-bones.
485 dnl It at least checks request and reply serialization and deserialization.
486 dnl Actions definition listed in both supported formats (w/ actions=)
487 AT_SETUP([ofproto - remove buckets])
489 AT_DATA([groups.txt], [dnl
490 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:16,actions=output:16
492 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
493 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
494 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
495 OFPST_GROUP_DESC reply (OF1.5):
496 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:16,actions=output:16
498 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
499 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
500 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
501 OFPST_GROUP_DESC reply (OF1.5):
502 group_id=1234,type=all,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:16,actions=output:16
504 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
505 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
506 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
507 OFPST_GROUP_DESC reply (OF1.5):
508 group_id=1234,type=all,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
510 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=13])
511 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
512 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
513 OFPST_GROUP_DESC reply (OF1.5):
514 group_id=1234,type=all,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
516 AT_DATA([buckets.txt], [dnl
519 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 - < buckets.txt])
520 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
521 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
522 OFPST_GROUP_DESC reply (OF1.5):
523 group_id=1234,type=all
525 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
526 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
527 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=all])
528 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=1], [1], [], [stderr])
529 AT_CHECK([cat stderr | ofctl_strip], [0], [dnl
530 OFPT_ERROR (OF1.5): OFPGMFC_UNKNOWN_BUCKET
531 OFPT_GROUP_MOD (OF1.5):
532 REMOVE_BUCKET command_bucket_id:1,group_id=1234
535 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [],
536 [ovs-ofctl: remove-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
541 dnl This is really bare-bones.
542 dnl It at least checks request and reply serialization and deserialization.
543 AT_SETUP([ofproto - flow mod checks group availability])
545 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
546 AT_DATA([flows.txt], [dnl
547 tcp actions=group:1234
548 udp actions=group:1235
550 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
551 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'], [1], [], [stderr])
553 # The output should look like this:
555 # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................|
556 # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................|
557 # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................|
558 # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............|
560 # This 'sed' command captures the error message but drops details.
561 AT_CHECK([sed '/truncated/d
562 /^000000.0/d' stderr | STRIP_XIDS], [0],
563 [OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP
564 OFPT_FLOW_MOD (OF1.1):
569 dnl This is really bare-bones.
570 dnl It at least checks request and reply serialization and deserialization.
571 AT_SETUP([ofproto - group description])
573 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10], [0], [stdout])
574 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
575 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
576 OFPST_GROUP_DESC reply (OF1.1):
577 group_id=1234,type=all,bucket=actions=output:10
582 dnl This is really bare-bones.
583 dnl It at least checks request and reply serialization and deserialization.
584 AT_SETUP([ofproto - group description])
586 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
587 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
588 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
589 OFPST_GROUP_DESC reply (OF1.1):
590 group_id=1234,type=all,bucket=actions=output:10
595 dnl This is really bare-bones.
596 dnl It at least checks request and reply serialization and deserialization.
597 AT_SETUP([ofproto - group features])
599 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout])
600 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
601 OFPST_GROUP_FEATURES reply (OF1.2):
606 max_groups=0xffffff00
607 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
609 max_groups=0xffffff00
610 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
612 max_groups=0xffffff00
613 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
615 max_groups=0xffffff00
616 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
621 dnl This is really bare-bones.
622 dnl It at least checks request and reply serialization and deserialization.
623 AT_SETUP([ofproto - group stats (OpenFlow 1.1)])
625 AT_DATA([groups.txt], [dnl
626 group_id=1234,type=all,bucket=output:10
627 group_id=1235,type=all,bucket=output:10
629 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
630 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
631 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
632 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
633 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
634 OFPST_GROUP reply (OF1.1):
636 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0], [0], [stdout])
637 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
638 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
639 group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
640 OFPST_GROUP reply (OF1.1):
645 dnl This is really bare-bones.
646 dnl It at least checks request and reply serialization and deserialization.
647 AT_SETUP([ofproto - group stats (OpenFlow 1.3)])
649 AT_DATA([groups.txt], [dnl
650 group_id=1234,type=all,bucket=output:10
651 group_id=1235,type=all,bucket=output:10
653 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
654 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-flow br0 'tcp actions=group:1234'])
655 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
656 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
657 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
658 OFPST_GROUP reply (OF1.3):
660 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0], [0], [stdout])
661 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
662 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
663 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
664 OFPST_GROUP reply (OF1.3):
669 dnl This is really bare-bones.
670 dnl It at least checks request and reply serialization and deserialization.
671 AT_SETUP([ofproto - group stats (OpenFlow 1.5)])
673 AT_DATA([groups.txt], [dnl
674 group_id=1234,type=all,bucket=output:10
675 group_id=1235,type=all,bucket=output:10
677 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
678 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-flow br0 'tcp actions=group:1234'])
679 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
680 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
681 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
682 OFPST_GROUP reply (OF1.5):
684 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0], [0], [stdout])
685 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
686 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
687 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
688 OFPST_GROUP reply (OF1.5):
693 dnl This found a use-after-free error in bridge destruction in the
694 dnl presence of groups.
695 AT_SETUP([ofproto - group add then bridge delete (OpenFlow 1.3)])
697 AT_DATA([groups.txt], [dnl
698 group_id=1234,type=all,bucket=output:10
699 group_id=1235,type=all,bucket=output:10
701 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
702 AT_CHECK([ovs-vsctl del-br br0])
706 AT_SETUP([ofproto - mod-port (OpenFlow 1.0)])
708 for command_config_state in \
710 'noflood NO_FLOOD 0' \
711 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
712 'flood PORT_DOWN LINK_DOWN' \
713 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
714 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
715 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
716 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
717 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
721 set $command_config_state
722 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
723 AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
724 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
725 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
726 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
727 n_tables:254, n_buffers:256
728 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
729 actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
730 LOCAL(br0): addr:aa:55:aa:55:00:00
733 speed: 0 Mbps now, 0 Mbps max
734 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
740 AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
742 for command_config_state in \
744 'down PORT_DOWN LINK_DOWN' \
745 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
746 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
747 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
748 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
749 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
753 set $command_config_state
754 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
755 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
756 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout])
757 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
758 OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210
759 n_tables:254, n_buffers:256
760 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
761 LOCAL(br0): addr:aa:55:aa:55:00:00
764 speed: 0 Mbps now, 0 Mbps max
765 OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0
771 AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
773 for command_config_state in \
775 'down PORT_DOWN LINK_DOWN' \
776 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
777 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
778 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
779 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
780 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
784 set $command_config_state
785 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
786 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command])
787 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn show br0], [0], [stdout])
788 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
789 OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210
790 n_tables:254, n_buffers:256
791 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
792 OFPST_PORT_DESC reply (OF1.4):
793 LOCAL(br0): addr:aa:55:aa:55:00:00
796 speed: 0 Mbps now, 0 Mbps max
797 OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0
803 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
805 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
807 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -])
808 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
809 AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3])
810 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
811 in_port=1 actions=output:2
812 in_port=2 actions=output:1
813 table=1, in_port=4 actions=output:3
816 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
817 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
819 AT_CHECK([ovs-ofctl del-flows br0])
820 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
825 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
827 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
829 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -])
830 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2])
831 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3])
832 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
833 in_port=1 actions=output:2
834 in_port=2 actions=output:1
835 table=1, in_port=4 actions=output:3
838 AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
839 OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
841 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
842 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
847 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)])
849 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
851 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -])
852 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2])
853 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3])
854 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
855 in_port=1 actions=output:2
856 in_port=2 actions=output:1
857 table=1, in_port=4 actions=output:3
858 OFPST_FLOW reply (OF1.1):
860 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
861 OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2
863 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
864 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
865 table=1, in_port=4 actions=output:3
870 AT_SETUP([ofproto - flow_mod negative test (OpenFlow 1.1)])
872 [set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13])
873 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2])
875 # The error message here actually comes from ovs-ofctl, not from ovs-vswitchd,
876 # but at least it's the same code in ofpacts_check() that issues the error.
877 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1],
879 [ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID)
884 AT_SETUP([ofproto - set-field flow_mod commands (NXM)])
886 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop])
887 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa-\>ipv6_src])
888 AT_CHECK([ovs-ofctl add-flow br0 icmp6,icmp_type=136,table=1,in_port=3,actions=set_field:fe80:8675:3097:890a:a6ba:dbff:f00d:59fa-\>nd_target,set_field:cc:dd:ee:ff:00:11-\>nd_tll])
889 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
890 table=1, icmp6,in_port=3,icmp_type=136 actions=load:0xa6badbfff00d59fa->NXM_NX_ND_TARGET[[0..63]],load:0xfe8086753097890a->NXM_NX_ND_TARGET[[64..127]],load:0xccddeeff0011->NXM_NX_ND_TLL[[]]
891 table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]]
897 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)])
899 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
901 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -])
902 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2])
903 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3])
904 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
905 in_port=1 actions=output:2
906 in_port=2 actions=output:1
907 table=1, in_port=4 actions=output:3
908 OFPST_FLOW reply (OF1.2):
910 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
911 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
916 AT_SETUP([ofproto - set-field flow_mod commands (OF1.2)])
918 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 ipv6,table=1,in_port=3,actions=drop])
919 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 ipv6,table=1,in_port=3,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa-\>ipv6_src])
920 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 icmp6,icmp_type=136,table=1,in_port=3,actions=set_field:fe80:8675:3097:890a:a6ba:dbff:f00d:59fa-\>nd_target,set_field:cc:dd:ee:ff:00:11-\>nd_tll])
921 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
922 table=1, icmp6,in_port=3,icmp_type=136 actions=set_field:fe80:8675:3097:890a:a6ba:dbff:f00d:59fa->nd_target,set_field:cc:dd:ee:ff:00:11->nd_tll
923 table=1, ipv6,in_port=3 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
924 OFPST_FLOW reply (OF1.2):
929 AT_SETUP([ofproto - dump flows with cookie])
931 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
932 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
933 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
934 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
935 cookie=0x1, in_port=1 actions=output:1
936 cookie=0x2, in_port=2 actions=output:1
937 cookie=0x3, in_port=3 actions=output:1
940 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
941 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
943 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl
944 cookie=0x3, in_port=3 actions=output:1
947 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | STRIP_XIDS], [0], [dnl
948 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
953 AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)])
955 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1])
956 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
957 cookie=0x1, in_port=1 actions=output:1
961 AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1])
962 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
963 cookie=0x2, in_port=1 actions=output:1
969 AT_SETUP([ofproto - mod flow with cookie change (NXM)])
971 AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1])
972 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
973 cookie=0x1, in_port=1 actions=output:1
977 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1])
978 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
979 cookie=0x2, in_port=1 actions=output:1
985 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)])
987 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
988 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
989 cookie=0x1, in_port=1 actions=output:1
990 OFPST_FLOW reply (OF1.1):
992 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1])
993 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
994 cookie=0x1, in_port=1 actions=output:1
995 OFPST_FLOW reply (OF1.1):
1000 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
1001 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)])
1003 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1004 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1005 cookie=0x1, in_port=1 actions=output:1
1006 OFPST_FLOW reply (OF1.2):
1009 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1])
1010 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1011 cookie=0x1, in_port=1 actions=output:1
1012 OFPST_FLOW reply (OF1.2):
1017 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)])
1019 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1020 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
1021 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
1022 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1023 cookie=0x1, in_port=1 actions=output:1
1024 cookie=0x1, in_port=2 actions=output:1
1025 cookie=0x2, in_port=3 actions=output:1
1029 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4])
1030 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1031 cookie=0x1, in_port=1 actions=output:4
1032 cookie=0x1, in_port=2 actions=output:4
1033 cookie=0x2, in_port=3 actions=output:1
1039 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)])
1041 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1042 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1])
1043 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1])
1044 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1045 cookie=0x1, in_port=1 actions=output:1
1046 cookie=0x1, in_port=2 actions=output:1
1047 cookie=0x2, in_port=3 actions=output:1
1048 OFPST_FLOW reply (OF1.1):
1051 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4])
1052 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1053 cookie=0x1, in_port=1 actions=output:4
1054 cookie=0x1, in_port=2 actions=output:4
1055 cookie=0x2, in_port=3 actions=output:1
1056 OFPST_FLOW reply (OF1.1):
1061 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)])
1063 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1064 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1])
1065 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1])
1066 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1067 cookie=0x1, in_port=1 actions=output:1
1068 cookie=0x1, in_port=2 actions=output:1
1069 cookie=0x2, in_port=3 actions=output:1
1070 OFPST_FLOW reply (OF1.2):
1073 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4])
1074 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1075 cookie=0x1, in_port=1 actions=output:4
1076 cookie=0x1, in_port=2 actions=output:4
1077 cookie=0x2, in_port=3 actions=output:1
1078 OFPST_FLOW reply (OF1.2):
1083 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
1084 AT_SETUP([ofproto - mod flows based on cookie mask with cookie change])
1086 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1087 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
1088 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
1089 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1090 cookie=0x1, in_port=1 actions=output:1
1091 cookie=0x1, in_port=2 actions=output:1
1092 cookie=0x2, in_port=3 actions=output:1
1096 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4])
1097 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1098 cookie=0x2, in_port=3 actions=output:1
1099 cookie=0x4, in_port=1 actions=output:4
1100 cookie=0x4, in_port=2 actions=output:4
1106 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM])
1108 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1])
1109 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1110 in_port=1 actions=output:1
1116 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1])
1118 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1])
1119 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1120 in_port=1 actions=output:1
1121 OFPST_FLOW reply (OF1.1):
1126 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2])
1128 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1])
1129 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1130 OFPST_FLOW reply (OF1.2):
1135 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM])
1137 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1])
1138 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1144 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1])
1146 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1147 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1148 OFPST_FLOW reply (OF1.1):
1153 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2])
1155 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1156 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1157 OFPST_FLOW reply (OF1.2):
1162 AT_SETUP([ofproto - del flows with cookies])
1164 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1165 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1166 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1167 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1168 cookie=0x1, in_port=1 actions=output:1
1169 cookie=0x2, in_port=2 actions=output:1
1170 cookie=0x3, in_port=3 actions=output:1
1174 AT_CHECK([ovs-ofctl del-flows br0])
1175 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1181 AT_SETUP([ofproto - del flows based on cookie])
1183 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1184 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1185 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1186 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1187 cookie=0x1, in_port=1 actions=output:1
1188 cookie=0x2, in_port=2 actions=output:1
1189 cookie=0x3, in_port=3 actions=output:1
1193 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1])
1194 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1195 cookie=0x1, in_port=1 actions=output:1
1196 cookie=0x2, in_port=2 actions=output:1
1202 AT_SETUP([ofproto - del flows based on cookie mask])
1204 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1205 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1206 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1207 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1208 cookie=0x1, in_port=1 actions=output:1
1209 cookie=0x2, in_port=2 actions=output:1
1210 cookie=0x3, in_port=3 actions=output:1
1213 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
1214 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1215 cookie=0x2, in_port=2 actions=output:1
1221 AT_SETUP([ofproto - del flows based on table id (NXM)])
1223 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1224 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1225 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1226 cookie=0x1, in_port=1 actions=output:1
1227 cookie=0x2, table=1, in_port=2 actions=output:1
1230 AT_CHECK([ovs-ofctl del-flows br0 table=0])
1231 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1232 cookie=0x2, table=1, in_port=2 actions=output:1
1235 AT_CHECK([ovs-ofctl del-flows br0 table=1])
1236 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1239 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1240 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1241 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1242 cookie=0x1, in_port=1 actions=output:1
1243 cookie=0x2, table=1, in_port=2 actions=output:1
1246 AT_CHECK([ovs-ofctl del-flows br0])
1247 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1253 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)])
1255 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1256 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1257 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1258 cookie=0x1, in_port=1 actions=output:1
1259 cookie=0x2, table=1, in_port=2 actions=output:1
1260 OFPST_FLOW reply (OF1.1):
1262 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0])
1263 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1264 cookie=0x2, table=1, in_port=2 actions=output:1
1265 OFPST_FLOW reply (OF1.1):
1267 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1])
1268 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1269 OFPST_FLOW reply (OF1.1):
1271 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1272 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1273 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1274 cookie=0x1, in_port=1 actions=output:1
1275 cookie=0x2, table=1, in_port=2 actions=output:1
1276 OFPST_FLOW reply (OF1.1):
1278 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
1279 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
1280 OFPST_FLOW reply (OF1.1):
1281 cookie=0x2, table=1, in_port=2 actions=output:1
1286 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)])
1288 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1289 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1290 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1291 cookie=0x1, in_port=1 actions=output:1
1292 cookie=0x2, table=1, in_port=2 actions=output:1
1293 OFPST_FLOW reply (OF1.2):
1295 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0])
1296 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1297 cookie=0x2, table=1, in_port=2 actions=output:1
1298 OFPST_FLOW reply (OF1.2):
1300 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1])
1301 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1302 OFPST_FLOW reply (OF1.2):
1304 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1305 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1306 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1307 cookie=0x1, in_port=1 actions=output:1
1308 cookie=0x2, table=1, in_port=2 actions=output:1
1309 OFPST_FLOW reply (OF1.2):
1311 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
1312 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1313 OFPST_FLOW reply (OF1.2):
1318 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)])
1320 # Check the default configuration.
1322 printf 'OFPST_TABLE reply (xid=0x2):
1324 active=0, lookup=0, matched=0
1327 in_port: exact match or wildcard
1328 eth_src: exact match or wildcard
1329 eth_dst: exact match or wildcard
1330 eth_type: exact match or wildcard
1331 vlan_vid: exact match or wildcard
1332 vlan_pcp: exact match or wildcard
1333 ip_src: exact match or wildcard
1334 ip_dst: exact match or wildcard
1335 nw_proto: exact match or wildcard
1336 nw_tos: exact match or wildcard
1337 tcp_src: exact match or wildcard
1338 tcp_dst: exact match or wildcard
1343 for i in `seq $1 $2`; do
1344 printf ' table %d ("table%d"): ditto\n' $i $i
1347 (head_table classifier; ditto 1 253) > expout
1348 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1349 # Change the configuration.
1352 -- --id=@t0 create Flow_Table name=main \
1353 -- --id=@t1 create Flow_Table flow-limit=1024 \
1354 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1355 | ${PERL} $srcdir/uuidfilt.pl],
1359 # Check that the configuration was updated.
1360 (head_table main; echo ' table 1 ("table1"):
1361 active=0, lookup=0, matched=0
1366 active=0, lookup=0, matched=0
1369 '; ditto 3 253) > expout
1370 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1374 dnl In-band and fail-open add "hidden rules" to table 0. These rules shouldn't
1375 dnl be visible to OpenFlow. This test checks that "dump-flows" and
1376 dnl "dump-tables" don't make them visible.
1377 AT_SETUP([ofproto - hidden rules not in table stats])
1378 # Use an IP address for a controller that won't actually exist: we
1379 # want to create in-band rules but we do not want to actually connect
1380 # to a controller (because that could mess about with our test). The
1381 # Class E range 240.0.0.0 - 255.255.255.255 seems like a good choice.
1382 OVS_VSWITCHD_START([set-controller br0 tcp:240.0.0.1:6653])
1383 for i in 1 2 3 4 5; do ovs-appctl time/warp 1000; done
1385 # Check that no hidden flows are visible in OpenFlow.
1386 AT_CHECK([ovs-ofctl dump-flows br0], [0], [NXST_FLOW reply (xid=0x4):
1389 # Check that some hidden flows related to 240.0.0.1 are actually in table 0.
1391 # We discard flows that mention table_id because we only want table 0 flows,
1392 # which in OVS is implied by the absence of a table_id.
1393 AT_CHECK([ovs-appctl bridge/dump-flows br0], [0], [stdout])
1394 AT_CHECK([test `grep '240\.0\.0\.1' stdout | grep -v table_id= | wc -l` -gt 0])
1396 # Check that dump-tables doesn't count the hidden flows.
1398 printf 'OFPST_TABLE reply (xid=0x2):
1400 active=0, lookup=0, matched=0
1403 in_port: exact match or wildcard
1404 eth_src: exact match or wildcard
1405 eth_dst: exact match or wildcard
1406 eth_type: exact match or wildcard
1407 vlan_vid: exact match or wildcard
1408 vlan_pcp: exact match or wildcard
1409 ip_src: exact match or wildcard
1410 ip_dst: exact match or wildcard
1411 nw_proto: exact match or wildcard
1412 nw_tos: exact match or wildcard
1413 tcp_src: exact match or wildcard
1414 tcp_dst: exact match or wildcard
1419 for i in `seq $1 $2`; do
1420 printf ' table %d ("table%d"): ditto\n' $i $i
1423 (head_table classifier; ditto 1 253) > expout
1424 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1425 OVS_VSWITCHD_STOP(["/240\.0\.0\.1/d"])
1428 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)])
1430 # Check the default configuration.
1432 printf 'OFPST_TABLE reply (OF1.2) (xid=0x2):
1434 active=0, lookup=0, matched=0
1435 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1438 instructions (table miss and others):
1439 instructions: apply_actions,clear_actions,write_actions,write_metadata,goto_table
1440 Write-Actions and Apply-Actions features:
1441 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
1442 supported on Set-Field: metadata in_port_oxm eth_src eth_dst vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ipv6_label ip_dscp nw_ecn arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst icmp_type icmp_code icmpv6_type icmpv6_code nd_target nd_sll nd_tll
1444 metadata: exact match or wildcard
1445 in_port_oxm: exact match or wildcard
1446 eth_src: exact match or wildcard
1447 eth_dst: exact match or wildcard
1448 eth_type: exact match or wildcard
1449 vlan_vid: exact match or wildcard
1450 vlan_pcp: exact match or wildcard
1451 mpls_label: exact match or wildcard
1452 mpls_tc: exact match or wildcard
1453 ip_src: exact match or wildcard
1454 ip_dst: exact match or wildcard
1455 ipv6_src: exact match or wildcard
1456 ipv6_dst: exact match or wildcard
1457 ipv6_label: exact match or wildcard
1458 nw_proto: exact match or wildcard
1459 ip_dscp: exact match or wildcard
1460 nw_ecn: exact match or wildcard
1461 arp_op: exact match or wildcard
1462 arp_spa: exact match or wildcard
1463 arp_tpa: exact match or wildcard
1464 arp_sha: exact match or wildcard
1465 arp_tha: exact match or wildcard
1466 tcp_src: exact match or wildcard
1467 tcp_dst: exact match or wildcard
1468 udp_src: exact match or wildcard
1469 udp_dst: exact match or wildcard
1470 sctp_src: exact match or wildcard
1471 sctp_dst: exact match or wildcard
1472 icmp_type: exact match or wildcard
1473 icmp_code: exact match or wildcard
1474 icmpv6_type: exact match or wildcard
1475 icmpv6_code: exact match or wildcard
1476 nd_target: exact match or wildcard
1477 nd_sll: exact match or wildcard
1478 nd_tll: exact match or wildcard
1483 for i in `seq $1 $2`; do
1484 printf ' table %d ("table%d"): ditto\n' $i $i
1488 printf ' table 253 ("table253"):
1489 active=0, lookup=0, matched=0
1490 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1493 instructions (table miss and others):
1494 instructions: apply_actions,clear_actions,write_actions,write_metadata
1499 (head_table classifier; ditto 1 252; tail_table) > expout
1500 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1501 # Change the configuration.
1504 -- --id=@t0 create Flow_Table name=main \
1505 -- --id=@t1 create Flow_Table flow-limit=1024 \
1506 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1507 | ${PERL} $srcdir/uuidfilt.pl],
1511 # Check that the configuration was updated.
1512 (head_table main; echo ' table 1 ("table1"):
1513 active=0, lookup=0, matched=0
1514 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1521 active=0, lookup=0, matched=0
1522 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1527 '; ditto 3 252; tail_table) > expout
1528 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1532 AT_SETUP([ofproto - table features (OpenFlow 1.3)])
1535 printf ' table 0 ("%s"):
1536 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1538 instructions (table miss and others):
1540 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata,goto_table
1541 Write-Actions and Apply-Actions features:
1542 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
1543 supported on Set-Field: tun_id tun_src tun_dst tun_flags tun_gbp_id tun_gbp_flags tun_metadata0 dnl
1544 tun_metadata1 tun_metadata2 tun_metadata3 tun_metadata4 tun_metadata5 tun_metadata6 tun_metadata7 tun_metadata8 tun_metadata9 tun_metadata10 tun_metadata11 tun_metadata12 tun_metadata13 tun_metadata14 tun_metadata15 tun_metadata16 tun_metadata17 tun_metadata18 tun_metadata19 tun_metadata20 tun_metadata21 tun_metadata22 tun_metadata23 tun_metadata24 tun_metadata25 tun_metadata26 tun_metadata27 tun_metadata28 tun_metadata29 tun_metadata30 tun_metadata31 tun_metadata32 tun_metadata33 tun_metadata34 tun_metadata35 tun_metadata36 tun_metadata37 tun_metadata38 tun_metadata39 tun_metadata40 tun_metadata41 tun_metadata42 tun_metadata43 tun_metadata44 tun_metadata45 tun_metadata46 tun_metadata47 tun_metadata48 tun_metadata49 tun_metadata50 tun_metadata51 tun_metadata52 tun_metadata53 tun_metadata54 tun_metadata55 tun_metadata56 tun_metadata57 tun_metadata58 tun_metadata59 tun_metadata60 tun_metadata61 tun_metadata62 tun_metadata63 dnl
1545 metadata in_port in_port_oxm pkt_mark ct_mark ct_label reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 xreg0 xreg1 xreg2 xreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ipv6_label nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst icmp_type icmp_code icmpv6_type icmpv6_code nd_target nd_sll nd_tll
1547 dp_hash: arbitrary mask
1548 recirc_id: exact match or wildcard
1549 conj_id: exact match or wildcard
1550 tun_id: arbitrary mask
1551 tun_src: arbitrary mask
1552 tun_dst: arbitrary mask
1553 tun_flags: arbitrary mask
1554 tun_gbp_id: arbitrary mask
1555 tun_gbp_flags: arbitrary mask
1556 tun_metadata0: arbitrary mask
1557 tun_metadata1: arbitrary mask
1558 tun_metadata2: arbitrary mask
1559 tun_metadata3: arbitrary mask
1560 tun_metadata4: arbitrary mask
1561 tun_metadata5: arbitrary mask
1562 tun_metadata6: arbitrary mask
1563 tun_metadata7: arbitrary mask
1564 tun_metadata8: arbitrary mask
1565 tun_metadata9: arbitrary mask
1566 tun_metadata10: arbitrary mask
1567 tun_metadata11: arbitrary mask
1568 tun_metadata12: arbitrary mask
1569 tun_metadata13: arbitrary mask
1570 tun_metadata14: arbitrary mask
1571 tun_metadata15: arbitrary mask
1572 tun_metadata16: arbitrary mask
1573 tun_metadata17: arbitrary mask
1574 tun_metadata18: arbitrary mask
1575 tun_metadata19: arbitrary mask
1576 tun_metadata20: arbitrary mask
1577 tun_metadata21: arbitrary mask
1578 tun_metadata22: arbitrary mask
1579 tun_metadata23: arbitrary mask
1580 tun_metadata24: arbitrary mask
1581 tun_metadata25: arbitrary mask
1582 tun_metadata26: arbitrary mask
1583 tun_metadata27: arbitrary mask
1584 tun_metadata28: arbitrary mask
1585 tun_metadata29: arbitrary mask
1586 tun_metadata30: arbitrary mask
1587 tun_metadata31: arbitrary mask
1588 tun_metadata32: arbitrary mask
1589 tun_metadata33: arbitrary mask
1590 tun_metadata34: arbitrary mask
1591 tun_metadata35: arbitrary mask
1592 tun_metadata36: arbitrary mask
1593 tun_metadata37: arbitrary mask
1594 tun_metadata38: arbitrary mask
1595 tun_metadata39: arbitrary mask
1596 tun_metadata40: arbitrary mask
1597 tun_metadata41: arbitrary mask
1598 tun_metadata42: arbitrary mask
1599 tun_metadata43: arbitrary mask
1600 tun_metadata44: arbitrary mask
1601 tun_metadata45: arbitrary mask
1602 tun_metadata46: arbitrary mask
1603 tun_metadata47: arbitrary mask
1604 tun_metadata48: arbitrary mask
1605 tun_metadata49: arbitrary mask
1606 tun_metadata50: arbitrary mask
1607 tun_metadata51: arbitrary mask
1608 tun_metadata52: arbitrary mask
1609 tun_metadata53: arbitrary mask
1610 tun_metadata54: arbitrary mask
1611 tun_metadata55: arbitrary mask
1612 tun_metadata56: arbitrary mask
1613 tun_metadata57: arbitrary mask
1614 tun_metadata58: arbitrary mask
1615 tun_metadata59: arbitrary mask
1616 tun_metadata60: arbitrary mask
1617 tun_metadata61: arbitrary mask
1618 tun_metadata62: arbitrary mask
1619 tun_metadata63: arbitrary mask
1620 metadata: arbitrary mask
1621 in_port: exact match or wildcard
1622 in_port_oxm: exact match or wildcard
1623 actset_output: exact match or wildcard
1624 pkt_mark: arbitrary mask
1625 ct_state: arbitrary mask
1626 ct_zone: exact match or wildcard
1627 ct_mark: arbitrary mask
1628 ct_label: arbitrary mask
1629 reg0: arbitrary mask
1630 reg1: arbitrary mask
1631 reg2: arbitrary mask
1632 reg3: arbitrary mask
1633 reg4: arbitrary mask
1634 reg5: arbitrary mask
1635 reg6: arbitrary mask
1636 reg7: arbitrary mask
1637 xreg0: arbitrary mask
1638 xreg1: arbitrary mask
1639 xreg2: arbitrary mask
1640 xreg3: arbitrary mask
1641 eth_src: arbitrary mask
1642 eth_dst: arbitrary mask
1643 eth_type: exact match or wildcard
1644 vlan_tci: arbitrary mask
1645 vlan_vid: arbitrary mask
1646 vlan_pcp: exact match or wildcard
1647 mpls_label: exact match or wildcard
1648 mpls_tc: exact match or wildcard
1649 mpls_bos: exact match or wildcard
1650 ip_src: arbitrary mask
1651 ip_dst: arbitrary mask
1652 ipv6_src: arbitrary mask
1653 ipv6_dst: arbitrary mask
1654 ipv6_label: arbitrary mask
1655 nw_proto: exact match or wildcard
1656 nw_tos: exact match or wildcard
1657 ip_dscp: exact match or wildcard
1658 nw_ecn: exact match or wildcard
1659 nw_ttl: exact match or wildcard
1660 ip_frag: arbitrary mask
1661 arp_op: exact match or wildcard
1662 arp_spa: arbitrary mask
1663 arp_tpa: arbitrary mask
1664 arp_sha: arbitrary mask
1665 arp_tha: arbitrary mask
1666 tcp_src: arbitrary mask
1667 tcp_dst: arbitrary mask
1668 tcp_flags: arbitrary mask
1669 udp_src: arbitrary mask
1670 udp_dst: arbitrary mask
1671 sctp_src: arbitrary mask
1672 sctp_dst: arbitrary mask
1673 icmp_type: exact match or wildcard
1674 icmp_code: exact match or wildcard
1675 icmpv6_type: exact match or wildcard
1676 icmpv6_code: exact match or wildcard
1677 nd_target: arbitrary mask
1678 nd_sll: arbitrary mask
1679 nd_tll: arbitrary mask
1684 printf ' table %d ("%s"):
1685 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1687 instructions (table miss and others):
1693 ' $1 $2 $3 `expr $1 + 1`
1696 echo ' table 252 ("table252"):
1697 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1699 instructions (table miss and others):
1705 table 253 ("table253"):
1706 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1708 instructions (table miss and others):
1709 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata
1714 (head_table classifier
1715 for i in `seq 1 251`; do
1716 ditto $i table$i 1000000
1718 tail_tables) > expout
1719 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
1720 # Change the configuration.
1723 -- --id=@t0 create Flow_Table name=main \
1724 -- --id=@t1 create Flow_Table flow-limit=1024 \
1725 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1726 | ${PERL} $srcdir/uuidfilt.pl],
1730 # Check that the configuration was updated.
1733 for i in `seq 2 251`; do
1734 ditto $i table$i 1000000
1736 tail_tables) > expout
1737 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
1741 AT_SETUP([ofproto - table description (OpenFlow 1.4)])
1744 while test $x -lt 254; do
1747 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME"
1750 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
1751 /^OFPST_TABLE_DESC/d'], [0], [expout])
1753 # Change the configuration.
1754 AT_CHECK([ovs-ofctl -O Openflow14 mod-table br0 0 evict])
1755 # Check that the configuration was updated.
1756 mv expout orig-expout
1757 sed -e '2s/eviction=off/eviction=on/' <orig-expout > expout
1758 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
1759 /^OFPST_TABLE_DESC/d'], [0], [expout])
1763 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)])
1765 # Configure a maximum of 4 flows.
1768 -- --id=@t0 create Flow_Table flow-limit=4 \
1769 -- set bridge br0 flow_tables:0=@t0 \
1770 | ${PERL} $srcdir/uuidfilt.pl],
1774 for in_port in 1 2 3 4; do
1775 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
1777 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1778 in_port=1 actions=drop
1779 in_port=2 actions=drop
1780 in_port=3 actions=drop
1781 in_port=4 actions=drop
1784 # Adding another flow will be refused.
1785 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1786 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1787 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1789 # Also a mod-flow that would add a flow will be refused.
1790 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
1791 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1792 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1794 # Replacing or modifying an existing flow is allowed.
1795 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1796 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1797 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1798 in_port=1 actions=drop
1799 in_port=2 actions=drop
1800 in_port=3 actions=output:1
1801 in_port=4 actions=NORMAL
1807 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)])
1809 # Configure a maximum of 4 flows.
1812 -- --id=@t0 create Flow_Table flow-limit=4 \
1813 -- set bridge br0 flow_tables:0=@t0 \
1814 | ${PERL} $srcdir/uuidfilt.pl],
1818 for in_port in 1 2 3 4; do
1819 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
1821 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1822 in_port=1 actions=drop
1823 in_port=2 actions=drop
1824 in_port=3 actions=drop
1825 in_port=4 actions=drop
1826 OFPST_FLOW reply (OF1.2):
1828 # Adding another flow will be refused.
1829 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1830 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1831 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1833 # Replacing or modifying an existing flow is allowed.
1834 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1835 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1836 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1837 in_port=1 actions=drop
1838 in_port=2 actions=drop
1839 in_port=3 actions=output:1
1840 in_port=4 actions=NORMAL
1841 OFPST_FLOW reply (OF1.2):
1846 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
1848 # Configure a maximum of 4 flows.
1851 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1852 -- set bridge br0 flow_tables:0=@t0 \
1853 | ${PERL} $srcdir/uuidfilt.pl],
1857 for in_port in 4 3 2 1; do
1858 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1860 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1861 idle_timeout=10, in_port=1 actions=drop
1862 idle_timeout=20, in_port=2 actions=drop
1863 idle_timeout=30, in_port=3 actions=drop
1864 idle_timeout=40, in_port=4 actions=drop
1867 # Adding another flow will cause the one that expires soonest to be evicted.
1868 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1869 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1870 idle_timeout=20, in_port=2 actions=drop
1871 idle_timeout=30, in_port=3 actions=drop
1872 idle_timeout=40, in_port=4 actions=drop
1873 in_port=5 actions=drop
1876 # A mod-flow that adds a flow also causes eviction, but replacing or
1877 # modifying an existing flow doesn't.
1878 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
1879 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1880 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1881 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1882 idle_timeout=30, in_port=3 actions=output:1
1883 in_port=4 actions=NORMAL
1884 in_port=5 actions=drop
1885 in_port=6 actions=drop
1888 # Flows with no timeouts at all cannot be evicted.
1889 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
1890 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1891 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1892 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1894 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1895 in_port=4 actions=NORMAL
1896 in_port=5 actions=drop
1897 in_port=6 actions=drop
1898 in_port=7 actions=NORMAL
1904 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
1906 # Configure a maximum of 4 flows.
1909 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1910 -- set bridge br0 flow_tables:0=@t0 \
1911 | ${PERL} $srcdir/uuidfilt.pl],
1915 for in_port in 4 3 2 1; do
1916 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1918 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1919 idle_timeout=10, in_port=1 actions=drop
1920 idle_timeout=20, in_port=2 actions=drop
1921 idle_timeout=30, in_port=3 actions=drop
1922 idle_timeout=40, in_port=4 actions=drop
1923 OFPST_FLOW reply (OF1.2):
1925 # Adding another flow will cause the one that expires soonest to be evicted.
1926 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
1927 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1928 idle_timeout=20, in_port=2 actions=drop
1929 idle_timeout=30, in_port=3 actions=drop
1930 idle_timeout=40, in_port=4 actions=drop
1931 in_port=5 actions=drop
1932 OFPST_FLOW reply (OF1.2):
1934 # In OpenFlow 1.2 a mod-flow does not ever add a flow and thus
1935 # has no effect on eviction
1936 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
1937 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1938 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1939 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1940 idle_timeout=20, in_port=2 actions=drop
1941 idle_timeout=30, in_port=3 actions=output:1
1942 in_port=4 actions=NORMAL
1943 in_port=5 actions=drop
1944 OFPST_FLOW reply (OF1.2):
1946 # Flows with no timeouts at all cannot be evicted.
1947 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
1948 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
1949 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1950 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1951 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1953 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1954 in_port=4 actions=NORMAL
1955 in_port=5 actions=drop
1956 in_port=6 actions=drop
1957 in_port=7 actions=NORMAL
1958 OFPST_FLOW reply (OF1.2):
1963 AT_SETUP([ofproto - eviction using importance upon table overflow (OpenFlow 1.4)])
1965 # Configure a maximum of 4 flows.
1968 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1969 -- set bridge br0 flow_tables:0=@t0 \
1970 | ${PERL} $srcdir/uuidfilt.pl],
1973 # Use mod-table to turn on eviction just to demonstrate that it works.
1974 AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 evict])
1976 for in_port in 4 3 2 1; do
1977 ovs-ofctl -O Openflow14 add-flow br0 importance=$((in_port + 30)),priority=$((in_port + 5)),hard_timeout=$((in_port + 500)),actions=drop
1979 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1980 hard_timeout=501, importance=31, priority=6 actions=drop
1981 hard_timeout=502, importance=32, priority=7 actions=drop
1982 hard_timeout=503, importance=33, priority=8 actions=drop
1983 hard_timeout=504, importance=34, priority=9 actions=drop
1984 OFPST_FLOW reply (OF1.4):
1986 # Adding another flow will cause the one with lowest importance to be evicted.
1987 AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=505,importance=35,priority=10,in_port=2,actions=drop])
1988 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1989 hard_timeout=502, importance=32, priority=7 actions=drop
1990 hard_timeout=503, importance=33, priority=8 actions=drop
1991 hard_timeout=504, importance=34, priority=9 actions=drop
1992 hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop
1993 OFPST_FLOW reply (OF1.4):
1995 # Disable the Eviction configuration.
1996 AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 noevict])
1997 # Adding another flow will cause the system to give error for FULL TABLE.
1998 AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=506,importance=36,priority=11,actions=drop],[1], [], [stderr])
1999 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
2000 [OFPT_ERROR (OF1.4): OFPFMFC_TABLE_FULL
2002 #Dump flows. It should show only the old values
2003 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2004 hard_timeout=502, importance=32, priority=7 actions=drop
2005 hard_timeout=503, importance=33, priority=8 actions=drop
2006 hard_timeout=504, importance=34, priority=9 actions=drop
2007 hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop
2008 OFPST_FLOW reply (OF1.4):
2010 # mod-flow that would modify a flow will be done successfully.
2011 AT_CHECK([ovs-ofctl -O Openflow14 mod-flows br0 in_port=2,actions=NORMAL])
2012 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2013 hard_timeout=502, importance=32, priority=7 actions=drop
2014 hard_timeout=503, importance=33, priority=8 actions=drop
2015 hard_timeout=504, importance=34, priority=9 actions=drop
2016 hard_timeout=505, importance=35, priority=10,in_port=2 actions=NORMAL
2017 OFPST_FLOW reply (OF1.4):
2019 # Also a mod-flow that would add a flow will be refused.
2020 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
2021 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
2022 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2027 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
2029 # Configure a maximum of 4 flows.
2032 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
2033 overflow-policy=evict \
2034 groups='"NXM_OF_IN_PORT[[]]"' \
2035 -- set bridge br0 flow_tables:0=@t0 \
2036 | ${PERL} $srcdir/uuidfilt.pl],
2040 ovs-ofctl add-flows br0 - <<EOF
2041 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
2042 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
2043 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
2044 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
2046 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2047 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2048 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
2049 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2050 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2053 # Adding another flow will cause the one that expires soonest within
2054 # the largest group (those with in_port=1) to be evicted. In this
2055 # case this is not the same as the one that expires soonest overall
2056 # (which is what makes the test interesting):
2057 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
2058 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2059 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2060 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2061 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2062 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2065 # Enlarge the flow limit, change the eviction policy back to strictly
2066 # based on expiration, and and add some flows.
2067 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
2068 ovs-ofctl add-flows br0 - <<EOF
2069 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
2070 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
2071 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
2073 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2074 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2075 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2076 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2077 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2078 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2079 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2080 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2083 # Adding another flow will cause the one that expires soonest overall
2085 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
2086 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2087 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2088 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2089 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2090 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2091 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2092 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2093 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2096 # Reducing the flow limit also causes the flows that expire soonest
2097 # overall to be evicted.
2098 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
2099 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2100 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2101 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2102 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2103 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2109 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
2111 # Configure a maximum of 4 flows.
2114 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
2115 overflow-policy=evict \
2116 groups='"NXM_OF_IN_PORT[[]]"' \
2117 -- set bridge br0 flow_tables:0=@t0 \
2118 | ${PERL} $srcdir/uuidfilt.pl],
2122 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
2123 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
2124 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
2125 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
2126 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
2128 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2129 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2130 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
2131 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2132 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2133 OFPST_FLOW reply (OF1.2):
2135 # Adding another flow will cause the one that expires soonest within
2136 # the largest group (those with in_port=1) to be evicted. In this
2137 # case this is not the same as the one that expires soonest overall
2138 # (which is what makes the test interesting):
2139 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
2140 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2141 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2142 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2143 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2144 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2145 OFPST_FLOW reply (OF1.2):
2147 # Enlarge the flow limit, change the eviction policy back to strictly
2148 # based on expiration, and and add some flows.
2149 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
2150 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
2151 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
2152 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
2153 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
2155 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2156 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2157 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2158 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2159 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2160 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2161 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2162 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2163 OFPST_FLOW reply (OF1.2):
2165 # Adding another flow will cause the one that expires soonest overall
2167 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
2168 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2169 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2170 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2171 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2172 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2173 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2174 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2175 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2176 OFPST_FLOW reply (OF1.2):
2178 # Reducing the flow limit also causes the flows that expire soonest
2179 # overall to be evicted.
2180 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
2181 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2182 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2183 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2184 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2185 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2186 OFPST_FLOW reply (OF1.2):
2191 AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout])
2193 # Configure a maximum of 4 flows.
2196 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2197 -- set bridge br0 flow_tables:0=@t0 \
2198 | ${PERL} $srcdir/uuidfilt.pl],
2201 ovs-appctl time/stop
2203 for in_port in 4 3 2 1; do
2204 ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
2206 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2207 hard_timeout=13, in_port=1 actions=drop
2208 hard_timeout=16, in_port=2 actions=drop
2209 hard_timeout=19, in_port=3 actions=drop
2210 hard_timeout=22, in_port=4 actions=drop
2213 # Sleep and modify the one that expires soonest
2214 ovs-appctl time/warp 5000
2215 AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop])
2216 # At this point the table would looks like:
2217 # in_port seconds to expire
2222 ovs-appctl time/warp 2000
2223 # Adding another flow will cause the one that expires soonest to be evicted.
2224 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
2225 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2226 hard_timeout=13, in_port=1 actions=drop
2227 hard_timeout=19, in_port=3 actions=drop
2228 hard_timeout=22, in_port=4 actions=drop
2229 in_port=5 actions=drop
2235 AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout])
2236 OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1])
2237 # Configure a maximum of 4 flows.
2240 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2241 -- set bridge br0 flow_tables:0=@t0 \
2242 | ${PERL} $srcdir/uuidfilt.pl],
2246 for in_port in 4 3 2 1; do
2247 ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
2249 ovs-appctl time/stop
2250 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2251 idle_timeout=13, in_port=1 actions=drop
2252 idle_timeout=16, in_port=2 actions=drop
2253 idle_timeout=19, in_port=3 actions=drop
2254 idle_timeout=22, in_port=4 actions=drop
2257 # Sleep and receive on the flow that expires soonest
2258 ovs-appctl time/warp 5000
2259 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)'])
2260 # At this point the table would looks like:
2261 # in_port seconds to expire
2266 ovs-appctl time/warp 2000
2267 # Adding another flow will cause the one that expires soonest to be evicted.
2268 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
2269 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2270 idle_timeout=19, in_port=3 actions=drop
2271 idle_timeout=22, in_port=4 actions=drop
2272 in_port=5 actions=drop
2273 n_packets=1, n_bytes=60, idle_timeout=13, in_port=1 actions=drop
2279 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
2281 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
2283 printf '\n\n--- check_async %d ---\n\n\n' $1
2286 ovs-appctl -t ovs-ofctl ofctl/barrier
2287 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2290 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2291 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
2292 if test X"$1" = X"OFPR_ACTION"; then shift;
2293 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2294 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2297 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2298 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2299 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2300 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
2301 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2304 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2305 ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2306 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2307 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
2308 udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
2311 # OFPT_PORT_STATUS, OFPPR_ADD
2312 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
2313 if test X"$1" = X"OFPPR_ADD"; then shift;
2314 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
2317 speed: 0 Mbps now, 0 Mbps max"
2320 # OFPT_PORT_STATUS, OFPPR_DELETE
2321 ovs-vsctl del-port br0 test
2322 if test X"$1" = X"OFPPR_DELETE"; then shift;
2323 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
2326 speed: 0 Mbps now, 0 Mbps max"
2329 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2330 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
2331 ovs-ofctl --strict del-flows br0 ''
2332 if test X"$1" = X"OFPRR_DELETE"; then shift;
2333 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
2335 AT_FAIL_IF([test X"$1" != X])
2337 ovs-appctl -t ovs-ofctl ofctl/barrier
2338 echo >>expout "OFPT_BARRIER_REPLY:"
2342 s/ (xid=0x[0-9a-fA-F]*)//
2344 s/00:0.$/00:0x/' < monitor.log]],
2348 # It's a service connection so initially there should be no async messages.
2351 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2352 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2353 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2355 # Set miss_send_len to 128 and enable invalid_ttl.
2356 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
2357 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2359 # Become slave, which should disable everything except port status.
2360 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
2361 check_async 4 OFPPR_ADD OFPPR_DELETE
2363 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
2364 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
2365 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2367 # Set controller ID 123.
2368 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
2369 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2371 # Restore controller ID 0.
2372 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
2375 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
2376 check_async 7 OFPR_ACTION OFPPR_ADD
2378 ovs-appctl -t ovs-ofctl exit
2382 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
2384 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2386 printf '\n\n--- check_async %d ---\n\n\n' $1
2390 ovs-appctl -t ovs-ofctl ofctl/barrier
2391 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2394 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2395 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
2396 if test X"$1" = X"OFPR_ACTION"; then shift;
2397 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2398 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2401 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2402 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2403 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2404 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2405 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2408 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2409 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2410 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2411 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2412 udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
2415 # OFPT_PORT_STATUS, OFPPR_ADD
2416 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2417 if test X"$1" = X"OFPPR_ADD"; then shift;
2418 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2421 speed: 0 Mbps now, 0 Mbps max"
2424 # OFPT_PORT_STATUS, OFPPR_DELETE
2425 ovs-vsctl del-port br0 test
2426 if test X"$1" = X"OFPPR_DELETE"; then shift;
2427 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2430 speed: 0 Mbps now, 0 Mbps max"
2433 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2434 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
2435 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
2436 if test X"$1" = X"OFPRR_DELETE"; then shift;
2437 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
2439 AT_FAIL_IF([test X"$1" != X])
2441 ovs-appctl -t ovs-ofctl ofctl/barrier
2442 echo >>expout "OFPT_BARRIER_REPLY (OF1.2):"
2446 s/ (xid=0x[0-9a-fA-F]*)//
2448 s/00:0.$/00:0x/' < monitor.log]],
2452 # It's a service connection so initially there should be no async messages.
2455 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2456 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2457 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2459 # Set miss_send_len to 128 and enable invalid_ttl.
2460 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
2461 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2463 # Become slave (OF 1.2), which should disable everything except port status.
2464 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
2465 check_async 4 OFPPR_ADD OFPPR_DELETE
2467 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
2468 ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
2469 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2471 # Set controller ID 123.
2472 ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
2473 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2475 # Restore controller ID 0.
2476 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
2478 # Become master (OF 1.2).
2479 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
2480 check_async 7 OFPR_ACTION OFPPR_ADD
2482 ovs-appctl -t ovs-ofctl exit
2486 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
2488 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
2490 printf '\n\n--- check_async %d ---\n\n\n' $1
2494 ovs-appctl -t ovs-ofctl ofctl/barrier
2495 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2498 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2499 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
2500 if test X"$1" = X"OFPR_ACTION"; then shift;
2501 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2502 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2505 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2506 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2507 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2508 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2509 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2512 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2513 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2514 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2515 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2516 udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
2519 # OFPT_PORT_STATUS, OFPPR_ADD
2520 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2521 if test X"$1" = X"OFPPR_ADD"; then shift;
2522 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2525 speed: 0 Mbps now, 0 Mbps max"
2528 # OFPT_PORT_STATUS, OFPPR_DELETE
2529 ovs-vsctl del-port br0 test
2530 if test X"$1" = X"OFPPR_DELETE"; then shift;
2531 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2534 speed: 0 Mbps now, 0 Mbps max"
2537 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2538 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
2539 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
2540 if test X"$1" = X"OFPRR_DELETE"; then shift;
2541 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
2544 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
2545 ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10
2546 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234
2547 ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234
2548 if test X"$1" = X"OFPRR_DELETE"; then shift;
2549 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=gropu_delete table_id=0"
2552 AT_FAIL_IF([test X"$1" != X])
2554 ovs-appctl -t ovs-ofctl ofctl/barrier
2555 echo >>expout "OFPT_BARRIER_REPLY (OF1.3):"
2559 s/ (xid=0x[0-9a-fA-F]*)//
2561 s/00:0.$/00:0x/' < monitor.log]],
2565 # It's a service connection so initially there should be no async messages.
2568 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2569 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
2570 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2572 # Become slave (OF 1.3), which should disable everything except port status.
2573 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
2574 check_async 3 OFPPR_ADD OFPPR_DELETE
2576 # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
2577 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005
2578 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2580 # Set controller ID 123.
2581 ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
2582 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2584 # Restore controller ID 0.
2585 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
2587 # Become master (OF 1.3).
2588 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
2589 check_async 6 OFPR_ACTION OFPPR_ADD
2591 ovs-appctl -t ovs-ofctl exit
2595 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.4)])
2597 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile])
2599 printf '\n\n--- check_async %d ---\n\n\n' $1
2603 ovs-appctl -t ovs-ofctl ofctl/barrier
2604 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2607 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2608 ovs-ofctl -O OpenFlow14 -v packet-out br0 none controller '0001020304050010203040501234'
2609 if test X"$1" = X"OFPR_ACTION"; then shift;
2610 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2611 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2614 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2615 ovs-ofctl -O OpenFlow14 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2616 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2617 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2618 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2621 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2622 ovs-ofctl -O OpenFlow14 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2623 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2624 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2625 udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
2628 # OFPT_PORT_STATUS, OFPPR_ADD
2629 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2630 if test X"$1" = X"OFPPR_ADD"; then shift;
2631 echo >>expout "OFPT_PORT_STATUS (OF1.4): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2634 speed: 0 Mbps now, 0 Mbps max"
2637 # OFPT_PORT_STATUS, OFPPR_MODIFY
2638 ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 test up
2639 if test X"$1" = X"OFPPR_MODIFY"; then shift;
2640 echo >>expout "OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2643 speed: 0 Mbps now, 0 Mbps max
2644 OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2647 speed: 0 Mbps now, 0 Mbps max"
2650 # OFPT_PORT_STATUS, OFPPR_DELETE
2651 ovs-vsctl del-port br0 test
2652 if test X"$1" = X"OFPPR_DELETE"; then shift;
2653 echo >>expout "OFPT_PORT_STATUS (OF1.4): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2656 speed: 0 Mbps now, 0 Mbps max"
2659 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2660 ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=drop
2661 ovs-ofctl -O OpenFlow14 --strict del-flows br0 ''
2662 if test X"$1" = X"OFPRR_DELETE"; then shift;
2663 echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=delete table_id=0"
2666 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
2667 ovs-ofctl -O OpenFlow14 add-group br0 group_id=1234,type=all,bucket=output:10
2668 ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=group:1234
2669 ovs-ofctl -O OpenFlow14 --strict del-groups br0 group_id=1234
2670 if test X"$1" = X"OFPRR_GROUP_DELETE"; then shift;
2671 echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=group_delete table_id=0"
2674 AT_FAIL_IF([test X"$1" != X])
2676 ovs-appctl -t ovs-ofctl ofctl/barrier
2677 echo >>expout "OFPT_BARRIER_REPLY (OF1.4):"
2681 s/ (xid=0x[0-9a-fA-F]*)//
2683 s/00:0.$/00:0x/' < monitor.log]],
2687 # It's a service connection so initially there should be no async messages.
2690 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2691 ovs-appctl -t ovs-ofctl ofctl/send 0509000c0123456700000080
2692 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
2694 # Become slave (OF 1.4), which should disable everything except port status.
2695 ovs-appctl -t ovs-ofctl ofctl/send 051800180000000200000003000000000000000000000001
2696 check_async 3 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
2698 # Use OF 1.4 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
2699 ovs-appctl -t ovs-ofctl ofctl/send 051c0038000000020000000800000005000100080000000200020008000000020003000800000005000400080000001c0005000800000005
2700 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
2702 # Set controller ID 123.
2703 ovs-appctl -t ovs-ofctl ofctl/send 05040018000000030000232000000014000000000000007b
2704 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
2706 # Restore controller ID 0.
2707 ovs-appctl -t ovs-ofctl ofctl/send 050400180000000300002320000000140000000000000000
2709 # Become master (OF 1.4).
2710 ovs-appctl -t ovs-ofctl ofctl/send 051800180000000400000002000000000000000000000002
2711 check_async 6 OFPR_ACTION OFPPR_ADD OFPPR_MODIFY OFPRR_DELETE
2713 ovs-appctl -t ovs-ofctl exit
2717 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.5)])
2719 AT_CHECK([ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile])
2721 printf '\n\n--- check_async %d ---\n\n\n' $1
2725 ovs-appctl -t ovs-ofctl ofctl/barrier
2726 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2729 # Other tests are not working with OF 1.5, and message
2730 # format may change, so leave them out.
2732 # OFPT_PORT_STATUS, OFPPR_ADD
2733 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2734 if test X"$1" = X"OFPPR_ADD"; then shift;
2735 echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2738 speed: 0 Mbps now, 0 Mbps max"
2741 # OFPT_PORT_STATUS, OFPPR_MODIFY
2742 ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test up
2743 if test X"$1" = X"OFPPR_MODIFY"; then shift;
2744 echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2747 speed: 0 Mbps now, 0 Mbps max
2748 OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x
2751 speed: 0 Mbps now, 0 Mbps max"
2754 # OFPT_PORT_STATUS, OFPPR_DELETE
2755 ovs-vsctl del-port br0 test
2756 if test X"$1" = X"OFPPR_DELETE"; then shift;
2757 echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2760 speed: 0 Mbps now, 0 Mbps max"
2763 AT_FAIL_IF([test X"$1" != X])
2765 ovs-appctl -t ovs-ofctl ofctl/barrier
2766 echo >>expout "OFPT_BARRIER_REPLY (OF1.5):"
2770 s/ (xid=0x[0-9a-fA-F]*)//
2772 s/00:0.$/00:0x/' < monitor.log]],
2776 # It's a service connection so initially there should be no async messages.
2779 # If we don't set this, async messages are not received.
2780 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2781 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
2782 check_async 2 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
2784 # Set-async has changed in OF 1.4 and is not yet implemented.
2786 ovs-appctl -t ovs-ofctl exit
2790 dnl This test checks that the role request/response messaging works
2791 dnl and that generation_id is handled properly.
2792 AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
2794 on_exit 'kill `cat c1.pid c2.pid`'
2796 # Start two ovs-ofctl controller processes.
2797 AT_CAPTURE_FILE([monitor1.log])
2798 AT_CAPTURE_FILE([expout1])
2799 AT_CAPTURE_FILE([experr1])
2800 AT_CAPTURE_FILE([monitor2.log])
2801 AT_CAPTURE_FILE([expout2])
2802 AT_CAPTURE_FILE([experr2])
2804 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
2805 ovs-appctl -t `pwd`/c$i ofctl/barrier
2806 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2810 # find out current role
2811 ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000
2812 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange"
2813 echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
2816 # controller 1: Become slave (generation_id is initially undefined, so
2817 # 2^63+2 should not be stale)
2818 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
2819 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
2820 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
2822 # controller 2: Become master.
2823 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
2824 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
2825 echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
2827 # controller 1: Try to become the master using a stale generation ID
2828 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
2829 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
2830 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
2831 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
2833 # controller 1: Become master using a valid generation ID
2834 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
2835 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
2836 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
2839 ovs-appctl -t `pwd`/c$i ofctl/barrier
2840 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):"
2846 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2848 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2853 dnl This test checks that the role request/response messaging works,
2854 dnl that generation_id is handled properly, and that role status update
2855 dnl messages are sent when a controller's role gets changed from master
2857 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
2859 on_exit 'kill `cat c1.pid c2.pid`'
2861 # Start two ovs-ofctl controller processes.
2862 AT_CAPTURE_FILE([monitor1.log])
2863 AT_CAPTURE_FILE([expout1])
2864 AT_CAPTURE_FILE([experr1])
2865 AT_CAPTURE_FILE([monitor2.log])
2866 AT_CAPTURE_FILE([expout2])
2867 AT_CAPTURE_FILE([experr2])
2869 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
2870 ovs-appctl -t `pwd`/c$i ofctl/barrier
2871 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2875 # find out current role
2876 ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000
2877 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange"
2878 echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
2881 # controller 1: Become slave (generation_id is initially undefined, so
2882 # 2^63+2 should not be stale)
2883 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
2884 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
2885 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
2887 # controller 2: Become master.
2888 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
2889 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
2890 echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
2892 # controller 1: Try to become the master using a stale generation ID
2893 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
2894 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2895 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
2896 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2898 # controller 1: Become master using a valid generation ID
2899 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
2900 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
2901 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
2902 echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
2905 ovs-appctl -t `pwd`/c$i ofctl/barrier
2906 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):"
2912 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2914 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2919 dnl This test checks the Group and meter notifications when a group mod
2920 dnl command is sent from one controller and the reply is received by
2921 dnl other controllers.
2922 AT_SETUP([ofproto - requestforward (OpenFlow 1.4)])
2924 on_exit 'kill `cat c1.pid c2.pid c3.pid`'
2926 # Start two ovs-ofctl controller processes.
2927 AT_CAPTURE_FILE([monitor1.log])
2928 AT_CAPTURE_FILE([expout1])
2929 AT_CAPTURE_FILE([monitor2.log])
2930 AT_CAPTURE_FILE([expout2])
2931 AT_CAPTURE_FILE([monitor3.log])
2932 AT_CAPTURE_FILE([expout3])
2934 ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile=`pwd`/c1.pid --unixctl=`pwd`/c1
2935 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c2.pid --unixctl=`pwd`/c2
2936 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c3.pid --unixctl=`pwd`/c3
2940 ovs-appctl -t `pwd`/c$i ofctl/barrier
2941 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2945 printf '\n\n--- check_async %d ---\n\n\n' $1
2950 ovs-appctl -t `pwd`/c2 ofctl/send 050f0010000000020000000000000001
2951 if test X"$1" = X"OFPGC_ADD"; then shift;
2952 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
2953 ADD group_id=1,type=all"
2954 echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
2955 ADD group_id=1,type=all"
2956 echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
2957 ADD group_id=1,type=all"
2961 ovs-appctl -t `pwd`/c2 ofctl/send 050f0010000000020001010000000001
2962 if test X"$1" = X"OFPGC_MODIFY"; then shift;
2963 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
2964 MOD group_id=1,type=select"
2965 echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
2966 MOD group_id=1,type=select"
2967 echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
2968 MOD group_id=1,type=select"
2971 ovs-appctl -t `pwd`/c1 ofctl/barrier
2972 echo >>expout1 "OFPT_BARRIER_REPLY (OF1.5):"
2973 ovs-appctl -t `pwd`/c2 ofctl/barrier
2974 echo >>expout2 "OFPT_BARRIER_REPLY (OF1.4):"
2975 ovs-appctl -t `pwd`/c3 ofctl/barrier
2976 echo >>expout3 "OFPT_BARRIER_REPLY (OF1.4):"
2983 s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
2988 # controller 1: Become slave
2989 ovs-appctl -t `pwd`/c1 ofctl/send 061800180000000300000003000000008000000000000002
2991 # controller 2: Become master
2992 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
2994 # controller 1: Become slave
2995 ovs-appctl -t `pwd`/c3 ofctl/send 051800180000000300000003000000008000000000000004
2997 # controller 1: Enabled requestforward using set Asynchronous message
2998 ovs-appctl -t `pwd`/c1 ofctl/send 061c00280000000200000008000000050002000800000002000400080000001a000a000800000003
3000 # controller 2: Enabled requestforward using set Asynchronous message
3001 ovs-appctl -t `pwd`/c2 ofctl/send 051c002800000002000100080000000200030008000000050005000800000005000b000800000003
3003 # controller 1: Enabled requestforward using set Asynchronous message
3004 ovs-appctl -t `pwd`/c3 ofctl/send 051c00280000000200000008000000050002000800000002000400080000001a000a000800000003
3005 check_async 1 OFPGC_ADD OFPGC_MODIFY
3010 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
3011 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
3012 dnl controllers despite the spec) as meaning a packet that was generated
3013 dnl by the controller.
3014 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
3016 ADD_OF_PORTS([br0], [1])
3018 # Start a monitor listening for packet-ins.
3019 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
3020 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
3021 ovs-appctl -t ovs-ofctl ofctl/barrier
3022 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3023 AT_CAPTURE_FILE([monitor.log])
3025 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
3026 AT_CHECK([ovs-ofctl packet-out br0 none controller,1 '0001020304050010203040501234'])
3027 AT_CHECK([ovs-ofctl packet-out br0 controller controller,1 '0001020304050010203040505678'])
3029 # Stop the monitor and check its output.
3030 ovs-appctl -t ovs-ofctl ofctl/barrier
3031 ovs-appctl -t ovs-ofctl exit
3033 ovs-ofctl dump-ports br0
3035 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3036 OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3037 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3038 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3039 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
3046 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
3047 dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
3048 dnl controllers despite the spec) as meaning a packet that was generated
3049 dnl by the controller.
3050 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
3053 # Start a monitor listening for packet-ins.
3054 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
3055 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
3056 ovs-appctl -t ovs-ofctl ofctl/barrier
3057 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3058 AT_CAPTURE_FILE([monitor.log])
3060 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
3061 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
3062 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
3064 # Stop the monitor and check its output.
3065 ovs-appctl -t ovs-ofctl ofctl/barrier
3066 ovs-appctl -t ovs-ofctl exit
3068 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3069 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3070 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3071 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3072 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
3073 OFPT_BARRIER_REPLY (OF1.2):
3079 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
3080 dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some
3081 dnl controllers despite the spec) as meaning a packet that was generated
3082 dnl by the controller.
3083 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)])
3086 # Start a monitor listening for packet-ins.
3087 AT_CHECK([ovs-ofctl -O OpenFlow11 monitor br0 --detach --no-chdir --pidfile])
3088 ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080
3089 ovs-appctl -t ovs-ofctl ofctl/barrier
3090 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3091 AT_CAPTURE_FILE([monitor.log])
3093 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
3094 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 none controller '0001020304050010203040501234'])
3095 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 4294967293 controller '0001020304050010203040505678'])
3097 # Stop the monitor and check its output.
3098 ovs-appctl -t ovs-ofctl ofctl/barrier
3099 ovs-appctl -t ovs-ofctl exit
3101 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3102 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3103 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3104 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3105 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
3106 OFPT_BARRIER_REPLY (OF1.1):
3112 dnl This test checks that metadata is encoded in packet_in structures,
3113 dnl supported by NXAST.
3114 AT_SETUP([ofproto - packet-out with metadata (NXM)])
3117 # Start a monitor listening for packet-ins.
3118 AT_CHECK([ovs-ofctl -P nxm monitor br0 --detach --no-chdir --pidfile])
3119 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
3120 ovs-appctl -t ovs-ofctl ofctl/barrier
3121 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3122 AT_CAPTURE_FILE([monitor.log])
3124 # Send a packet-out with a load action to set some metadata, and forward to controller
3125 AT_CHECK([ovs-ofctl packet-out br0 controller 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), load(0xaa->NXM_NX_PKT_MARK[[]]), controller' '0001020304050010203040501234'])
3127 # Stop the monitor and check its output.
3128 ovs-appctl -t ovs-ofctl ofctl/barrier
3129 ovs-appctl -t ovs-ofctl exit
3131 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3132 NXT_PACKET_IN: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3133 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3140 dnl This test checks that metadata is encoded in packet_in structures,
3141 dnl supported by NXAST.
3142 AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
3145 # Start a monitor listening for packet-ins.
3146 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
3147 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
3148 ovs-appctl -t ovs-ofctl ofctl/barrier
3149 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3150 AT_CAPTURE_FILE([monitor.log])
3152 # Send a packet-out with a set-field action to set some metadata, and forward to controller
3153 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234'])
3155 # Stop the monitor and check its output.
3156 ovs-appctl -t ovs-ofctl ofctl/barrier
3157 ovs-appctl -t ovs-ofctl exit
3159 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3160 OFPT_PACKET_IN (OF1.2): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=ANY (via action) data_len=14 (unbuffered)
3161 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3162 OFPT_BARRIER_REPLY (OF1.2):
3168 dnl This test checks that metadata is encoded in packet_in structures,
3169 dnl supported by NXAST.
3170 AT_SETUP([ofproto - packet-out with metadata and dual set_field (OpenFlow 1.3)])
3173 # Start a monitor listening for packet-ins.
3174 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
3175 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
3176 ovs-appctl -t ovs-ofctl ofctl/barrier
3177 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3178 AT_CAPTURE_FILE([monitor.log])
3180 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
3181 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, set_field:0x6b->metadata, controller' '0001020304050010203040501234'])
3183 # Stop the monitor and check its output.
3184 ovs-appctl -t ovs-ofctl ofctl/barrier
3185 ovs-appctl -t ovs-ofctl exit
3187 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3188 OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0x6b,in_port=ANY (via action) data_len=14 (unbuffered)
3189 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3190 OFPT_BARRIER_REPLY (OF1.3):
3196 dnl This test checks that tunnel metadata is encoded in packet_in structures.
3197 AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
3200 # Start a monitor listening for packet-ins.
3201 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
3202 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
3203 ovs-appctl -t ovs-ofctl ofctl/barrier
3204 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3205 AT_CAPTURE_FILE([monitor.log])
3207 # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
3208 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:127.0.0.1->tun_src,set_field:0x01020304->tun_id,set_field:192.168.0.1->tun_dst, controller' '0001020304050010203040501234'])
3210 # Stop the monitor and check its output.
3211 ovs-appctl -t ovs-ofctl ofctl/barrier
3212 ovs-appctl -t ovs-ofctl exit
3214 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3215 OFPT_PACKET_IN (OF1.2): total_len=14 tun_id=0x1020304,tun_src=127.0.0.1,tun_dst=192.168.0.1,in_port=ANY (via action) data_len=14 (unbuffered)
3216 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3217 OFPT_BARRIER_REPLY (OF1.2):
3223 m4_divert_push([PREPARE_TESTS])
3224 # Sorts groups of lines that start with a space, without moving them
3225 # past the nearest line that does not start with a space.
3235 print $_ foreach sort(@buffer);
3240 print $_ foreach sort(@buffer);
3243 m4_divert_pop([PREPARE_TESTS])
3245 AT_SETUP([ofproto - flow monitoring])
3246 AT_KEYWORDS([monitor])
3249 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
3251 # Start a monitor watching the flow table and check the initial reply.
3252 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
3253 AT_CAPTURE_FILE([monitor.log])
3254 ovs-appctl -t ovs-ofctl ofctl/barrier
3255 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3256 [NXST_FLOW_MONITOR reply:
3257 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
3261 # Add, delete, and modify some flows and check the updates.
3262 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3263 ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
3264 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
3265 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
3266 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
3267 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
3268 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
3269 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
3270 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
3271 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
3272 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
3273 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
3274 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
3275 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
3276 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
3277 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
3278 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
3279 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
3280 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
3281 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
3282 ovs-ofctl add-flow br0 in_port=0,actions=output:23
3283 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
3284 ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
3285 ovs-ofctl del-flows br0 dl_vlan=123
3286 ovs-ofctl del-flows br0
3287 ovs-appctl -t ovs-ofctl ofctl/barrier
3288 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
3289 [NXST_FLOW_MONITOR reply (xid=0x0):
3290 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
3291 NXST_FLOW_MONITOR reply (xid=0x0):
3292 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
3293 NXST_FLOW_MONITOR reply (xid=0x0):
3294 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
3295 NXST_FLOW_MONITOR reply (xid=0x0):
3296 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
3297 NXST_FLOW_MONITOR reply (xid=0x0):
3298 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
3299 NXST_FLOW_MONITOR reply (xid=0x0):
3300 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
3301 NXST_FLOW_MONITOR reply (xid=0x0):
3302 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
3303 NXST_FLOW_MONITOR reply (xid=0x0):
3304 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
3305 NXST_FLOW_MONITOR reply (xid=0x0):
3306 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
3307 NXST_FLOW_MONITOR reply (xid=0x0):
3308 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
3309 NXST_FLOW_MONITOR reply (xid=0x0):
3310 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
3311 NXST_FLOW_MONITOR reply (xid=0x0):
3312 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
3313 NXST_FLOW_MONITOR reply (xid=0x0):
3314 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
3315 NXST_FLOW_MONITOR reply (xid=0x0):
3316 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
3317 NXST_FLOW_MONITOR reply (xid=0x0):
3318 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
3319 NXST_FLOW_MONITOR reply (xid=0x0):
3320 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
3321 NXST_FLOW_MONITOR reply (xid=0x0):
3322 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
3323 NXST_FLOW_MONITOR reply (xid=0x0):
3324 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
3325 NXST_FLOW_MONITOR reply (xid=0x0):
3326 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
3327 NXST_FLOW_MONITOR reply (xid=0x0):
3328 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
3329 NXST_FLOW_MONITOR reply (xid=0x0):
3330 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
3331 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
3332 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
3333 NXST_FLOW_MONITOR reply (xid=0x0):
3334 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
3335 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
3336 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
3337 NXST_FLOW_MONITOR reply (xid=0x0):
3338 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
3339 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
3340 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
3341 NXST_FLOW_MONITOR reply (xid=0x0):
3342 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
3343 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
3344 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
3345 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
3346 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
3347 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
3348 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
3349 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
3350 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
3351 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
3352 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
3356 # Check that our own changes are reported as full updates.
3357 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3358 ovs-ofctl add-flow br0 in_port=1,actions=output:2
3359 ovs-ofctl add-flow br0 in_port=2,actions=output:1
3360 ovs-appctl -t ovs-ofctl ofctl/barrier
3361 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
3362 ovs-appctl -t ovs-ofctl ofctl/barrier
3363 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
3365 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
3366 [NXST_FLOW_MONITOR reply (xid=0x0):
3367 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
3368 NXST_FLOW_MONITOR reply (xid=0x0):
3369 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
3371 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
3372 NXST_FLOW_MONITOR reply (xid=0x0):
3373 event=DELETED reason=delete table=0 cookie=0 in_port=1 actions=output:2
3374 event=DELETED reason=delete table=0 cookie=0 in_port=2 actions=output:1
3378 ovs-appctl -t ovs-ofctl exit
3382 AT_SETUP([ofproto - flow monitoring with !own])
3383 AT_KEYWORDS([monitor])
3386 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
3388 # Start a monitor watching the flow table and check the initial reply.
3389 ovs-ofctl monitor br0 watch:\!own --detach --no-chdir --pidfile >monitor.log 2>&1
3390 AT_CAPTURE_FILE([monitor.log])
3391 ovs-appctl -t ovs-ofctl ofctl/barrier
3392 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3393 [NXST_FLOW_MONITOR reply:
3394 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
3398 # Check that our own changes are reported as abbreviations.
3399 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3400 ovs-ofctl add-flow br0 in_port=1,actions=output:2
3401 ovs-ofctl add-flow br0 in_port=2,actions=output:1
3402 ovs-appctl -t ovs-ofctl ofctl/barrier
3403 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
3404 ovs-appctl -t ovs-ofctl ofctl/barrier
3405 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
3407 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3408 [NXST_FLOW_MONITOR reply (xid=0x0):
3409 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
3410 NXST_FLOW_MONITOR reply (xid=0x0):
3411 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
3413 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
3414 NXST_FLOW_MONITOR reply (xid=0x0):
3415 event=ABBREV xid=0x12345678
3419 ovs-appctl -t ovs-ofctl exit
3423 AT_SETUP([ofproto - flow monitoring with out_port])
3424 AT_KEYWORDS([monitor])
3427 ovs-ofctl add-flow br0 in_port=0,dl_vlan=121,actions=output:1
3428 ovs-ofctl add-flow br0 in_port=0,dl_vlan=122,actions=output:1
3429 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:2
3431 # Start a monitor watching the flow table and check the initial reply.
3432 ovs-ofctl monitor br0 watch:out_port=2 --detach --no-chdir --pidfile >monitor.log 2>&1
3433 AT_CAPTURE_FILE([monitor.log])
3434 ovs-appctl -t ovs-ofctl ofctl/barrier
3435 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3436 [NXST_FLOW_MONITOR reply:
3437 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
3441 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3443 # Add, modify flows and check the updates.
3444 ovs-ofctl mod-flows br0 dl_vlan=121,actions=drop
3445 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1,output:2
3446 ovs-appctl -t ovs-ofctl ofctl/barrier
3448 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:1,output:2
3449 ovs-appctl -t ovs-ofctl ofctl/barrier
3451 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1
3452 ovs-appctl -t ovs-ofctl ofctl/barrier
3453 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:2
3454 ovs-appctl -t ovs-ofctl ofctl/barrier
3456 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3457 [NXST_FLOW_MONITOR reply (xid=0x0):
3458 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1,output:2
3460 NXST_FLOW_MONITOR reply (xid=0x0):
3461 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1,output:2
3463 NXST_FLOW_MONITOR reply (xid=0x0):
3464 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1
3466 NXST_FLOW_MONITOR reply (xid=0x0):
3467 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
3471 ovs-appctl -t ovs-ofctl exit
3475 AT_SETUP([ofproto - flow monitoring pause and resume])
3476 AT_KEYWORDS([monitor])
3478 # The maximum socket receive buffer size is important for this test, which
3479 # tests behavior when the receive buffer overflows.
3480 if test -e /proc/sys/net/core/rmem_max; then
3482 rmem_max=`cat /proc/sys/net/core/rmem_max`
3483 elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
3486 # Don't know how to get maximum socket receive buffer on this OS
3489 # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
3490 # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
3491 queue_size=`expr $rmem_max + 128 \* 1024`
3492 echo rmem_max=$rmem_max queue_size=$queue_size
3494 # If there's too much queuing skip the test to avoid timing out.
3495 AT_SKIP_IF([test $rmem_max -gt 1048576])
3497 # Each flow update message takes up at least 48 bytes of space in queues
3498 # and in practice more than that.
3499 n_msgs=`expr $queue_size / 48`
3504 # Start a monitor watching the flow table, then make it block.
3505 on_exit 'kill `cat ovs-ofctl.pid`'
3506 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
3507 AT_CAPTURE_FILE([monitor.log])
3508 ovs-appctl -t ovs-ofctl ofctl/block
3510 # Add $n_msgs flows.
3511 (echo "in_port=2,actions=output:2"
3513 for ($i = 0; $i < '$n_msgs'; $i++) {
3514 print "cookie=1,reg1=$i,actions=drop\n";
3517 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3518 # Check that multipart flow dumps work properly:
3519 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
3520 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
3521 AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
3522 AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
3524 ovs-appctl -t ovs-ofctl ofctl/unblock
3526 # Wait for the connection resumed.
3527 # A barrier doesn't work for this purpose.
3528 # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html
3529 # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html
3530 OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log])
3532 ovs-appctl -t ovs-ofctl exit
3534 # Check that the flow monitor reported the same number of flows
3535 # added and deleted, but fewer than we actually added and deleted.
3536 adds=`grep -c 'ADDED.*reg1=' monitor.log`
3537 deletes=`grep -c 'DELETED.*reg1=' monitor.log`
3538 echo adds=$adds deletes=$deletes
3539 AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
3540 AT_CHECK([test $adds = $deletes])
3542 # Check that the flow monitor reported everything in the expected order:
3544 # event=ADDED table=0 cookie=0x1 reg1=0x22
3546 # NXT_FLOW_MONITOR_PAUSED:
3548 # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3550 # event=ADDED table=0 cookie=0x3 in_port=1
3551 # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
3552 # NXT_FLOW_MONITOR_RESUMED:
3554 # except that, between the PAUSED and RESUMED, the order of the ADDED
3555 # and MODIFIED lines lines depends on hash order, that is, it varies
3556 # as we change the hash function or change architecture. Therefore,
3557 # we use a couple of tests below to accept both orders.
3558 AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
3561 /NXT_FLOW_MONITOR_PAUSED:/p
3562 /NXT_FLOW_MONITOR_RESUMED:/p
3563 ' > monitor.log.subset])
3564 AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
3565 event=ADDED table=0 cookie=0x1 reg1=0x22
3566 NXT_FLOW_MONITOR_PAUSED:
3567 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3568 event=ADDED table=0 cookie=0x3 in_port=1
3569 NXT_FLOW_MONITOR_RESUMED:
3571 AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
3572 NXT_FLOW_MONITOR_PAUSED:
3573 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3574 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
3575 NXT_FLOW_MONITOR_RESUMED:
3581 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
3582 AT_KEYWORDS([monitor])
3585 # Start a monitor, use the required protocol version
3586 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3587 AT_CAPTURE_FILE([monitor.log])
3589 # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a)
3590 ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a
3591 ovs-appctl -t ovs-ofctl ofctl/barrier
3593 # Check default setting
3594 read -r -d '' expected <<'EOF'
3597 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
3598 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
3599 OFPT_GET_ASYNC_REPLY (OF1.3):
3601 PACKET_IN: no_match action
3602 PORT_STATUS: add delete modify
3603 FLOW_REMOVED: idle hard delete
3607 PORT_STATUS: add delete modify
3609 OFPT_BARRIER_REPLY (OF1.3):
3615 AT_SETUP([ofproto - ofport_request])
3617 ADD_OF_PORTS([br0], [1], [2], [3])
3619 set_and_check_specific_ofports () {
3620 ovs-vsctl set Interface p1 ofport_request="$1" -- \
3621 set Interface p2 ofport_request="$2" -- \
3622 set Interface p3 ofport_request="$3"
3623 ofports=`ovs-vsctl get Interface p1 ofport -- \
3624 get Interface p2 ofport -- \
3625 get Interface p3 ofport`
3626 AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
3629 for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
3630 for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
3631 echo -----------------------------------------------------------
3632 echo "Check changing port numbers from $pre to $post"
3633 set_and_check_specific_ofports $pre
3634 set_and_check_specific_ofports $post
3638 ovs-vsctl del-port p3
3640 set_and_check_poorly_specified_ofports () {
3641 ovs-vsctl set Interface p1 ofport_request="$1" -- \
3642 set Interface p2 ofport_request="$2"
3643 p1=`ovs-vsctl get Interface p1 ofport`
3644 p2=`ovs-vsctl get Interface p2 ofport`
3647 AT_CHECK([test "$p1" != "$p2"])
3648 if test "$1" = "$2" && test "$1" != '[[]]'; then
3649 # One port number must be the requested one.
3650 AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
3651 # The other port number must be different (already tested above).
3653 AT_CHECK([test "$1" = '[[]]' || test "$p1" = "$1"])
3654 AT_CHECK([test "$2" = '[[]]' || test "$p2" = "$2"])
3657 for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
3659 for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
3661 echo -----------------------------------------------------------
3662 echo "Check changing port numbers from $pre to $post"
3663 set_and_check_poorly_specified_ofports $pre
3664 set_and_check_poorly_specified_ofports $post
3671 AT_SETUP([ofproto - bundles, open (OpenFlow 1.4)])
3672 AT_KEYWORDS([monitor])
3675 # Start a monitor, use the required protocol version
3676 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3677 AT_CAPTURE_FILE([monitor.log])
3679 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
3680 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3681 ovs-appctl -t ovs-ofctl ofctl/barrier
3682 ovs-appctl -t ovs-ofctl exit
3684 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
3685 send: OFPT_BUNDLE_CONTROL (OF1.4):
3686 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3687 OFPT_BUNDLE_CONTROL (OF1.4):
3688 bundle_id=0x1 type=OPEN_REPLY flags=0
3689 OFPT_BARRIER_REPLY (OF1.4):
3695 AT_SETUP([ofproto - bundles, double open (OpenFlow 1.4)])
3696 AT_KEYWORDS([monitor])
3699 # Start a monitor, use the required protocol version
3700 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3701 AT_CAPTURE_FILE([monitor.log])
3703 # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
3704 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3705 ovs-appctl -t ovs-ofctl ofctl/barrier
3706 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3707 ovs-appctl -t ovs-ofctl ofctl/barrier
3708 ovs-appctl -t ovs-ofctl exit
3710 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3711 send: OFPT_BUNDLE_CONTROL (OF1.4):
3712 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3713 OFPT_BUNDLE_CONTROL (OF1.4):
3714 bundle_id=0x1 type=OPEN_REPLY flags=0
3715 OFPT_BARRIER_REPLY (OF1.4):
3716 send: OFPT_BUNDLE_CONTROL (OF1.4):
3717 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3718 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3719 OFPT_BUNDLE_CONTROL (OF1.4):
3720 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3721 OFPT_BARRIER_REPLY (OF1.4):
3727 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)])
3728 AT_KEYWORDS([monitor])
3731 # Start a monitor, use the required protocol version
3732 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3733 AT_CAPTURE_FILE([monitor.log])
3735 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3736 ovs-appctl -t ovs-ofctl ofctl/barrier
3737 ovs-appctl -t ovs-ofctl exit
3739 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3740 send: OFPT_BUNDLE_CONTROL (OF1.4):
3741 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3742 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3743 OFPT_BUNDLE_CONTROL (OF1.4):
3744 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3745 OFPT_BARRIER_REPLY (OF1.4):
3751 AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)])
3752 AT_KEYWORDS([monitor])
3755 # Start a monitor, use the required protocol version
3756 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3757 AT_CAPTURE_FILE([monitor.log])
3759 # Open, Close, Close
3760 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3761 ovs-appctl -t ovs-ofctl ofctl/barrier
3762 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3763 ovs-appctl -t ovs-ofctl ofctl/barrier
3764 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3765 ovs-appctl -t ovs-ofctl ofctl/barrier
3766 ovs-appctl -t ovs-ofctl exit
3768 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3769 send: OFPT_BUNDLE_CONTROL (OF1.4):
3770 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3771 OFPT_BUNDLE_CONTROL (OF1.4):
3772 bundle_id=0x1 type=OPEN_REPLY flags=0
3773 OFPT_BARRIER_REPLY (OF1.4):
3774 send: OFPT_BUNDLE_CONTROL (OF1.4):
3775 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3776 OFPT_BUNDLE_CONTROL (OF1.4):
3777 bundle_id=0x1 type=CLOSE_REPLY flags=0
3778 OFPT_BARRIER_REPLY (OF1.4):
3779 send: OFPT_BUNDLE_CONTROL (OF1.4):
3780 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3781 OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED
3782 OFPT_BUNDLE_CONTROL (OF1.4):
3783 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3784 OFPT_BARRIER_REPLY (OF1.4):
3790 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)])
3791 AT_KEYWORDS([monitor])
3794 # Start a monitor, use the required protocol version
3795 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3796 AT_CAPTURE_FILE([monitor.log])
3798 # Open, Close, Close
3799 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3800 ovs-appctl -t ovs-ofctl ofctl/barrier
3801 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
3802 ovs-appctl -t ovs-ofctl ofctl/barrier
3803 ovs-appctl -t ovs-ofctl exit
3805 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3806 send: OFPT_BUNDLE_CONTROL (OF1.4):
3807 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3808 OFPT_BUNDLE_CONTROL (OF1.4):
3809 bundle_id=0x1 type=OPEN_REPLY flags=0
3810 OFPT_BARRIER_REPLY (OF1.4):
3811 send: OFPT_BUNDLE_CONTROL (OF1.4):
3812 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3813 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
3814 OFPT_BUNDLE_CONTROL (OF1.4):
3815 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3816 OFPT_BARRIER_REPLY (OF1.4):
3822 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)])
3823 AT_KEYWORDS([monitor])
3826 # Start a monitor, use the required protocol version
3827 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3828 AT_CAPTURE_FILE([monitor.log])
3830 # Open, Close, Close
3831 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02"
3832 ovs-appctl -t ovs-ofctl ofctl/barrier
3833 ovs-appctl -t ovs-ofctl exit
3835 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3836 send: OFPT_BUNDLE_CONTROL (OF1.4):
3837 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
3838 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3839 OFPT_BUNDLE_CONTROL (OF1.4):
3840 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
3841 OFPT_BARRIER_REPLY (OF1.4):
3847 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)])
3848 AT_KEYWORDS([monitor])
3851 # Start a monitor, use the required protocol version
3852 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3853 AT_CAPTURE_FILE([monitor.log])
3855 # Open, Close, Close
3856 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3857 ovs-appctl -t ovs-ofctl ofctl/barrier
3858 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01"
3859 ovs-appctl -t ovs-ofctl ofctl/barrier
3860 ovs-appctl -t ovs-ofctl exit
3862 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3863 send: OFPT_BUNDLE_CONTROL (OF1.4):
3864 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3865 OFPT_BUNDLE_CONTROL (OF1.4):
3866 bundle_id=0x1 type=OPEN_REPLY flags=0
3867 OFPT_BARRIER_REPLY (OF1.4):
3868 send: OFPT_BUNDLE_CONTROL (OF1.4):
3869 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
3870 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
3871 OFPT_BUNDLE_CONTROL (OF1.4):
3872 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
3873 OFPT_BARRIER_REPLY (OF1.4):
3879 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)])
3880 AT_KEYWORDS([monitor])
3883 # Start a monitor, use the required protocol version
3884 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3885 AT_CAPTURE_FILE([monitor.log])
3887 # Open, Close, Close
3888 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 02"
3889 ovs-appctl -t ovs-ofctl ofctl/barrier
3890 ovs-appctl -t ovs-ofctl exit
3892 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3893 send: OFPT_BUNDLE_CONTROL (OF1.4):
3894 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
3895 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3896 OFPT_BUNDLE_CONTROL (OF1.4):
3897 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
3898 OFPT_BARRIER_REPLY (OF1.4):
3905 AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.4)])
3906 AT_KEYWORDS([monitor])
3909 AT_CHECK([ovs-appctl vlog/set vconn:dbg])
3911 AT_CHECK([ovs-ofctl del-flows br0])
3913 AT_DATA([flows.txt], [dnl
3914 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
3915 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
3916 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
3917 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
3919 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
3920 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
3921 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
3922 delete in_port=2 dl_src=00:88:99:aa:bb:cc
3925 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
3927 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3928 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
3929 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
3933 AT_DATA([flows.txt], [dnl
3935 modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7
3938 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
3940 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3941 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3942 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
3946 # Adding an existing flow acts as a modify, and delete_strict also works.
3947 AT_DATA([flows.txt], [dnl
3948 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8
3949 delete_strict in_port=2 dl_src=00:66:77:88:99:aa
3950 add in_port=2 dl_src=00:66:77:88:99:aa actions=drop
3953 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
3955 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3956 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
3957 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3961 dnl Check logs for OpenFlow trace
3963 OVS_WAIT_UNTIL([cat ovs-vswitchd.log | vconn_sub | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3])
3964 AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl
3965 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3966 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3967 vconn|DBG|unix: received: OFPT_HELLO:
3968 version bitmap: 0x01
3969 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
3970 vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop
3971 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
3972 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
3973 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3974 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3975 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
3976 version bitmap: 0x05
3977 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
3978 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3979 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
3980 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3981 bundle_id=0 type=OPEN_REPLY flags=0
3982 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3983 bundle_id=0 flags=atomic ordered
3984 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1
3985 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3986 bundle_id=0 flags=atomic ordered
3987 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2
3988 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3989 bundle_id=0 flags=atomic ordered
3990 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3
3991 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3992 bundle_id=0 flags=atomic ordered
3993 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:4
3994 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3995 bundle_id=0 flags=atomic ordered
3996 OFPT_FLOW_MOD (OF1.4): DEL table:255 actions=drop
3997 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3998 bundle_id=0 flags=atomic ordered
3999 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:5
4000 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4001 bundle_id=0 flags=atomic ordered
4002 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:6
4003 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4004 bundle_id=0 flags=atomic ordered
4005 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7
4006 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4007 bundle_id=0 flags=atomic ordered
4008 OFPT_FLOW_MOD (OF1.4): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
4009 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4010 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
4011 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4012 bundle_id=0 type=COMMIT_REPLY flags=0
4013 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4014 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4015 vconn|DBG|unix: received: OFPT_HELLO:
4016 version bitmap: 0x01
4017 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
4018 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
4019 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
4020 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
4021 vconn|DBG|unix: received: NXST_FLOW request:
4022 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
4023 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
4024 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
4025 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4026 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4027 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
4028 version bitmap: 0x05
4029 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
4030 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4031 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
4032 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4033 bundle_id=0 type=OPEN_REPLY flags=0
4034 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4035 bundle_id=0 flags=atomic ordered
4036 OFPT_FLOW_MOD (OF1.4): MOD actions=drop
4037 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4038 bundle_id=0 flags=atomic ordered
4039 OFPT_FLOW_MOD (OF1.4): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
4040 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4041 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
4042 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4043 bundle_id=0 type=COMMIT_REPLY flags=0
4044 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4045 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4046 vconn|DBG|unix: received: OFPT_HELLO:
4047 version bitmap: 0x01
4048 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
4049 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
4050 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
4051 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
4052 vconn|DBG|unix: received: NXST_FLOW request:
4053 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
4054 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4055 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
4056 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4057 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4058 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
4059 version bitmap: 0x05
4060 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
4061 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4062 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
4063 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4064 bundle_id=0 type=OPEN_REPLY flags=0
4065 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4066 bundle_id=0 flags=atomic ordered
4067 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8
4068 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4069 bundle_id=0 flags=atomic ordered
4070 OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4071 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4072 bundle_id=0 flags=atomic ordered
4073 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4074 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4075 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
4076 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4077 bundle_id=0 type=COMMIT_REPLY flags=0
4078 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4079 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4080 vconn|DBG|unix: received: OFPT_HELLO:
4081 version bitmap: 0x01
4082 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
4083 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
4084 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
4085 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
4086 vconn|DBG|unix: received: NXST_FLOW request:
4087 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
4088 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
4089 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4096 AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.4)])
4097 AT_KEYWORDS([monitor])
4100 AT_CHECK([ovs-ofctl del-flows br0])
4102 ovs-ofctl add-flows br0 - <<EOF
4103 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=11
4104 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=22
4105 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=33
4107 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
4108 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
4109 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
4110 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
4114 # last line uses illegal table number (OVS internal table)
4115 AT_DATA([flows.txt], [dnl
4116 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
4117 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
4118 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
4119 modify idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
4121 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
4122 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
4123 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
4124 delete in_port=2 dl_src=00:88:99:aa:bb:cc
4125 add table=254 actions=drop
4128 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt 2>&1 | sed '/|WARN|/d
4129 s/unix:.*br0\.mgmt/unix:br0.mgmt/' | sed 's/(.* error)/(error)/'],
4131 OFPT_ERROR (OF1.4) (xid=0xb): OFPBRC_EPERM
4132 OFPT_FLOW_MOD (OF1.4) (xid=0xb): ADD table:254 actions=drop
4133 OFPT_ERROR (OF1.4) (xid=0xd): OFPBFC_MSG_FAILED
4134 OFPT_BUNDLE_CONTROL (OF1.4) (xid=0xd):
4135 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
4136 ovs-ofctl: talking to unix:br0.mgmt (error)
4139 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
4140 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
4141 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
4142 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33