3 AT_SETUP([ofproto - echo request])
5 AT_CHECK([ovs-ofctl -vwarn probe br0])
9 AT_SETUP([ofproto - handling messages with bad version])
10 AT_KEYWORDS([monitor])
13 # Start a monitor running OpenFlow 1.0, then send the switch an OF1.1 features
15 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
16 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
17 AT_CAPTURE_FILE([monitor.log])
18 ovs-appctl -t ovs-ofctl ofctl/send 0205000801234567
19 ovs-appctl -t ovs-ofctl ofctl/barrier
20 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
22 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//
23 /ECHO/d' monitor.log], [0], [dnl
24 send: OFPT_FEATURES_REQUEST (OF1.1):
25 OFPT_ERROR (OF1.1): OFPBRC_BAD_VERSION
26 OFPT_FEATURES_REQUEST (OF1.1):
30 OVS_VSWITCHD_STOP(["/received OpenFlow version 0x02 != expected 01/d"])
33 AT_SETUP([ofproto - feature request, config request])
35 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
36 AT_CHECK([strip_xids < stdout], [0], [dnl
37 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
38 n_tables:254, n_buffers:0
39 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
40 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
41 LOCAL(br0): addr:aa:55:aa:55:00:00
44 speed: 0 Mbps now, 0 Mbps max
45 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
50 AT_SETUP([ofproto - set OpenFlow port number])
52 [add-port br0 p1 -- set Interface p1 type=dummy --\
53 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=99])
54 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
56 s/ (xid=0x[0-9a-fA-F]*)//
57 s/00:0.$/00:0x/' < stdout]],
59 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
60 n_tables:254, n_buffers:0
61 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
62 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
63 1(p1): addr:aa:55:aa:55:00:0x
66 speed: 0 Mbps now, 0 Mbps max
67 99(p2): addr:aa:55:aa:55:00:0x
70 speed: 0 Mbps now, 0 Mbps max
71 LOCAL(br0): addr:aa:55:aa:55:00:0x
74 speed: 0 Mbps now, 0 Mbps max
75 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
81 dnl This is really bare-bones.
82 dnl It at least checks request and reply serialization and deserialization.
83 AT_SETUP([ofproto - port stats - (OpenFlow 1.0)])
85 AT_CHECK([ovs-ofctl -vwarn dump-ports br0], [0], [stdout])
86 AT_CHECK([strip_xids < stdout], [0], [dnl
87 OFPST_PORT reply: 1 ports
88 port LOCAL: rx pkts=0, bytes=0, drop=?, errs=?, frame=?, over=?, crc=?
89 tx pkts=0, bytes=0, drop=?, errs=?, coll=?
94 AT_SETUP([ofproto - port stats - (OpenFlow 1.2)])
96 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports br0], [0], [stdout])
97 AT_CHECK([strip_xids < stdout], [0], [dnl
98 OFPST_PORT reply (OF1.2): 1 ports
99 port LOCAL: rx pkts=0, bytes=0, drop=?, errs=?, frame=?, over=?, crc=?
100 tx pkts=0, bytes=0, drop=?, errs=?, coll=?
105 AT_SETUP([ofproto - port stats - (OpenFlow 1.4)])
107 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-ports br0], [0], [stdout])
108 AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/'],
110 OFPST_PORT reply (OF1.4): 1 ports
111 port LOCAL: rx pkts=0, bytes=0, drop=?, errs=?, frame=?, over=?, crc=?
112 tx pkts=0, bytes=0, drop=?, errs=?, coll=?
118 dnl This is really bare-bones.
119 dnl It at least checks request and reply serialization and deserialization.
120 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.0)])
122 AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], [stdout])
123 AT_CHECK([strip_xids < stdout], [0], [dnl
124 OFPST_PORT_DESC reply:
125 LOCAL(br0): addr:aa:55:aa:55:00:00
128 speed: 0 Mbps now, 0 Mbps max
133 dnl This is really bare-bones.
134 dnl It at least checks request and reply serialization and deserialization.
135 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.2)])
137 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc br0], [0], [stdout])
138 AT_CHECK([strip_xids < stdout], [0], [dnl
139 OFPST_PORT_DESC reply (OF1.2):
140 LOCAL(br0): addr:aa:55:aa:55:00:00
143 speed: 0 Mbps now, 0 Mbps max
148 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.5)])
150 add_of_ports br0 1 2 3
151 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0], [0], [stdout])
152 AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl
153 OFPST_PORT_DESC reply (OF1.5):
154 1(p1): addr:aa:55:aa:55:00:0x
157 speed: 0 Mbps now, 0 Mbps max
158 2(p2): addr:aa:55:aa:55:00:0x
161 speed: 0 Mbps now, 0 Mbps max
162 3(p3): addr:aa:55:aa:55:00:0x
165 speed: 0 Mbps now, 0 Mbps max
166 LOCAL(br0): addr:aa:55:aa:55:00:0x
169 speed: 0 Mbps now, 0 Mbps max
171 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0 2], [0], [stdout])
172 AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl
173 OFPST_PORT_DESC reply (OF1.5):
174 2(p2): addr:aa:55:aa:55:00:0x
177 speed: 0 Mbps now, 0 Mbps max
182 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.6)])
184 add_of_ports br0 1 2 3
185 AT_CHECK([ovs-ofctl -F OXM-OpenFlow16 -O OpenFlow16 -vwarn dump-ports-desc br0], [0], [stdout])
186 AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl
187 OFPST_PORT_DESC reply (OF1.6):
188 1(p1): addr:aa:55:aa:55:00:0x
191 speed: 0 Mbps now, 0 Mbps max
192 2(p2): addr:aa:55:aa:55:00:0x
195 speed: 0 Mbps now, 0 Mbps max
196 3(p3): addr:aa:55:aa:55:00:0x
199 speed: 0 Mbps now, 0 Mbps max
200 LOCAL(br0): addr:aa:55:aa:55:00:0x
203 speed: 0 Mbps now, 0 Mbps max
205 AT_CHECK([ovs-ofctl -F OXM-OpenFlow16 -O OpenFlow16 -vwarn dump-ports-desc br0 2], [0], [stdout])
206 AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl
207 OFPST_PORT_DESC reply (OF1.6):
208 2(p2): addr:aa:55:aa:55:00:0x
211 speed: 0 Mbps now, 0 Mbps max
216 dnl CHECK_QUEUE_STATS(label, option, format)
217 m4_define([CHECK_QUEUE_STATS], [
218 AT_SETUP([ofproto - queue stats - (OpenFlow $1)])
221 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 | strip_xids], [0],
222 [OFPST_QUEUE reply$3: 1 queues
223 port LOCAL queue 0: bytes=?, pkts=?, errors=?, duration=?
226 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 LOCAL | strip_xids], [0],
227 [OFPST_QUEUE reply$3: 1 queues
228 port LOCAL queue 0: bytes=?, pkts=?, errors=?, duration=?
231 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 LOCAL 0 | strip_xids], [0],
232 [OFPST_QUEUE reply$3: 1 queues
233 port LOCAL queue 0: bytes=?, pkts=?, errors=?, duration=?
236 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 ANY 0 | strip_xids], [0],
237 [OFPST_QUEUE reply$3: 1 queues
238 port LOCAL queue 0: bytes=?, pkts=?, errors=?, duration=?
241 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 LOCAL 5 | strip_xids], [0],
242 [OFPT_ERROR$3: OFPQOFC_BAD_QUEUE
243 OFPST_QUEUE request$3: port=LOCAL queue=5
246 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 ANY 5 | strip_xids], [0],
247 [OFPT_ERROR$3: OFPQOFC_BAD_QUEUE
248 OFPST_QUEUE request$3: port=ANY queue=5
251 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 10 | strip_xids], [0],
252 [OFPT_ERROR$3: OFPQOFC_BAD_PORT
253 OFPST_QUEUE request$3: port=10 queue=ALL
258 CHECK_QUEUE_STATS([1.0], [OpenFlow10], [])
259 CHECK_QUEUE_STATS([1.1], [OpenFlow11], [ (OF1.1)])
260 CHECK_QUEUE_STATS([1.2], [OpenFlow12], [ (OF1.2)])
261 CHECK_QUEUE_STATS([1.3], [OpenFlow13], [ (OF1.3)])
262 CHECK_QUEUE_STATS([1.4], [OpenFlow14], [ (OF1.4)])
264 dnl This is really bare-bones.
265 dnl It at least checks request and reply serialization and deserialization.
266 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.0)])
269 AT_CHECK([ovs-ofctl queue-get-config br0 1], [0], [stdout])
270 AT_CHECK([strip_xids < stdout], [0], [dnl
271 OFPT_QUEUE_GET_CONFIG_REPLY: port=1
274 AT_CHECK([ovs-ofctl queue-get-config br0], [0], [stdout])
275 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
276 OFPT_QUEUE_GET_CONFIG_REPLY: port=1
277 OFPT_QUEUE_GET_CONFIG_REPLY: port=2
281 AT_CHECK([ovs-ofctl queue-get-config br0 10], [0],
282 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT
283 OFPT_QUEUE_GET_CONFIG_REQUEST (xid=0x2): port=10
288 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.1)])
291 AT_CHECK([ovs-ofctl -O OpenFlow11 queue-get-config br0 1], [0], [stdout])
292 AT_CHECK([strip_xids < stdout], [0], [dnl
293 OFPT_QUEUE_GET_CONFIG_REPLY (OF1.1): port=1
296 AT_CHECK([ovs-ofctl -O OpenFlow11 queue-get-config br0 10 | strip_xids], [0],
297 [OFPT_ERROR (OF1.1): OFPQOFC_BAD_PORT
298 OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.1): port=10
303 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.2)])
306 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 1], [0], [stdout])
307 AT_CHECK([strip_xids < stdout], [0], [dnl
308 OFPT_QUEUE_GET_CONFIG_REPLY (OF1.2): port=1
311 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 ANY], [0], [stdout])
312 AT_CHECK([strip_xids < stdout], [0], [dnl
313 OFPT_QUEUE_GET_CONFIG_REPLY (OF1.2): port=ANY
318 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 10 | strip_xids], [0],
319 [OFPT_ERROR (OF1.2): OFPQOFC_BAD_PORT
320 OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.2): port=10
325 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.4)])
329 AT_CHECK([ovs-ofctl -O OpenFlow14 queue-get-config br0 any | strip_xids], [0],
330 [OFPST_QUEUE_DESC reply (OF1.4): port=1
338 AT_CHECK([ovs-ofctl -O OpenFlow14 queue-get-config br0 1 | strip_xids], [0],
339 [OFPST_QUEUE_DESC reply (OF1.4): port=1
343 AT_CHECK([ovs-ofctl -O OpenFlow14 queue-get-config br0 10 | strip_xids], [0],
344 [OFPT_ERROR (OF1.4): OFPQOFC_BAD_PORT
345 OFPST_QUEUE_DESC request (OF1.4): port=10
348 AT_CHECK([ovs-ofctl -O OpenFlow14 queue-get-config br0 1 2 | strip_xids], [0],
349 [OFPT_ERROR (OF1.4): OFPQOFC_BAD_QUEUE
350 OFPST_QUEUE_DESC request (OF1.4): port=1 queue=2
355 dnl This is really bare-bones.
356 dnl It at least checks request and reply serialization and deserialization.
357 dnl Actions definition listed in both supported formats (w/ actions=)
358 AT_SETUP([ofproto - no group support (OpenFlow 1.0)])
360 AT_DATA([groups.txt], [dnl
361 group_id=1234,type=all,bucket=output:10
362 group_id=1235,type=all,bucket=actions=output:10
364 AT_DATA([stderr], [dnl
365 ovs-ofctl: none of the usable flow formats (OXM,OpenFlow11) is among the allowed flow formats (OpenFlow10,NXM)
367 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-groups br0 groups.txt], [1], ,[stderr])
368 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn mod-group br0 'group_id=1234,type=all,bucket=output:10'], [1], ,[stderr])
369 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0], [1], ,[stderr])
370 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0 ], [1], ,[stderr])
374 dnl This is really bare-bones.
375 dnl It at least checks request and reply serialization and deserialization.
376 dnl Actions definition listed in both supported formats (w/ actions=)
377 AT_SETUP([ofproto - del group (OpenFlow 1.1)])
379 AT_DATA([groups.txt], [dnl
380 group_id=1234,type=all,bucket=output:10
381 group_id=1235,type=all,bucket=actions=output:10
383 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
384 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0 ], [0], [stdout])
385 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
386 group_id=1234,type=all,bucket=actions=output:10
387 group_id=1235,type=all,bucket=actions=output:10
388 OFPST_GROUP_DESC reply (OF1.1):
390 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
391 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
392 AT_CHECK([strip_xids < stdout], [0], [dnl
393 OFPST_GROUP_DESC reply (OF1.1):
394 group_id=1235,type=all,bucket=actions=output:10
396 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
397 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
398 AT_CHECK([strip_xids < stdout], [0], [dnl
399 OFPST_GROUP_DESC reply (OF1.1):
400 group_id=1235,type=all,bucket=actions=output:10
402 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0], [0])
403 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
404 AT_CHECK([strip_xids < stdout], [0], [dnl
405 OFPST_GROUP_DESC reply (OF1.1):
409 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=0xfffffff0],
410 [1], [], [ovs-ofctl: invalid group id 4294967280
415 dnl This is really bare-bones.
416 dnl It at least checks request and reply serialization and deserialization.
417 dnl Actions definition listed in both supported formats (w/ actions=)
418 AT_SETUP([ofproto - add indirect group])
420 dnl indirect group must have exactly one bucket
421 AT_DATA([stderr], [dnl
422 OFPT_ERROR (OF1.1) (xid=0x2): OFPGMFC_INVALID_GROUP
423 OFPT_GROUP_MOD (OF1.1) (xid=0x2): ***decode error: OFPGMFC_INVALID_GROUP***
425 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1234,type=indirect'], [1], , [stderr])
426 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1235,type=indirect,bucket=output:10'])
427 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1236,type=indirect,bucket=output:10,bucket=output:11'], [1], , [stderr])
431 AT_SETUP([ofproto - group mod with mod and add_or_mod command])
433 dnl Check that mod-group for non-existing group fails without --may-create
434 AT_DATA([stderr], [dnl
435 OFPT_ERROR (OF1.3) (xid=0x2): OFPGMFC_UNKNOWN_GROUP
436 OFPT_GROUP_MOD (OF1.3) (xid=0x2):
437 MOD group_id=1234,type=indirect,bucket=actions=output:2
439 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn mod-group br0 'group_id=1234,type=indirect,bucket=actions=2'], [1], , [stderr])
440 dnl Check that mod-group for non-existing group succeeds with --may-create
441 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn --may-create mod-group br0 'group_id=1234,type=indirect,bucket=actions=2'])
442 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout])
443 AT_CHECK([strip_xids < stdout], [0], [dnl
444 OFPST_GROUP_DESC reply (OF1.3):
445 group_id=1234,type=indirect,bucket=actions=output:2
447 dnl Check that mod-group for existing group succeeds with --may-create
448 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn --may-create mod-group br0 'group_id=1234,type=indirect,bucket=actions=3'])
449 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout])
450 AT_CHECK([strip_xids < stdout], [0], [dnl
451 OFPST_GROUP_DESC reply (OF1.3):
452 group_id=1234,type=indirect,bucket=actions=output:3
457 dnl This is really bare-bones.
458 dnl It at least checks request and reply serialization and deserialization.
459 dnl Actions definition listed in both supported formats (w/ actions=)
460 AT_SETUP([ofproto - del group (OpenFlow 1.5)])
462 AT_DATA([groups.txt], [dnl
463 group_id=1233,type=select,selection_method=hash,bucket=output:10,bucket=output:11
464 group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11
465 group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
466 group_id=1236,type=select,selection_method=dp_hash,bucket=output:10,bucket=output:11
468 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
469 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
470 AT_CHECK([strip_xids < stdout], [0], [dnl
471 OFPST_GROUP_DESC reply (OF1.5):
472 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
474 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
475 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
476 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
477 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
478 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
479 group_id=1236,type=select,selection_method=dp_hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
480 OFPST_GROUP_DESC reply (OF1.5):
482 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
483 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
484 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
485 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
486 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
487 group_id=1236,type=select,selection_method=dp_hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
488 OFPST_GROUP_DESC reply (OF1.5):
490 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0], [0])
491 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
492 AT_CHECK([strip_xids < stdout], [0], [dnl
493 OFPST_GROUP_DESC reply (OF1.5):
498 dnl This is really bare-bones.
499 dnl It at least checks request and reply serialization and deserialization.
500 AT_SETUP([ofproto - del group deletes flows])
502 AT_DATA([groups.txt], [dnl
503 group_id=1234,type=all,bucket=output:10
504 group_id=1235,type=all,bucket=output:10
506 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
507 AT_DATA([flows.txt], [dnl
508 tcp actions=group:1234
509 table=2 udp actions=group:1235
511 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt])
512 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
514 table=2, udp actions=group:1235
515 tcp actions=group:1234
516 OFPST_FLOW reply (OF1.1):
518 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
519 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
521 table=2, udp actions=group:1235
522 OFPST_FLOW reply (OF1.1):
524 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
525 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
527 table=2, udp actions=group:1235
528 OFPST_FLOW reply (OF1.1):
530 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0])
531 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
533 OFPST_FLOW reply (OF1.1):
538 dnl This is really bare-bones.
539 dnl It at least checks request and reply serialization and deserialization.
540 dnl Actions definition listed in both supported formats (w/ actions=)
541 AT_SETUP([ofproto - insert group buckets])
543 # Add group with no buckets.
544 AT_DATA([groups.txt], [dnl
545 group_id=1234,type=all
547 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
548 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
549 AT_CHECK([strip_xids < stdout], [0], [dnl
550 OFPST_GROUP_DESC reply (OF1.5):
551 group_id=1234,type=all
554 # Add two buckets, using "last".
555 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11])
556 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
557 AT_CHECK([strip_xids < stdout], [0], [dnl
558 OFPST_GROUP_DESC reply (OF1.5):
559 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
562 # Start over again, then add two buckets using "first".
563 AT_CHECK([ovs-ofctl -O OpenFlow15 --strict del-groups br0 group_id=1234])
564 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-group br0 group_id=1234,type=all])
565 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11])
566 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
567 AT_CHECK([strip_xids < stdout], [0], [dnl
568 OFPST_GROUP_DESC reply (OF1.5):
569 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
572 # Add two more buckets before the existing ones.
573 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])
574 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
575 AT_CHECK([strip_xids < stdout], [0], [dnl
576 OFPST_GROUP_DESC reply (OF1.5):
577 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
580 # Add another bucket at the end.
581 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])
582 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
583 AT_CHECK([strip_xids < stdout], [0], [dnl
584 OFPST_GROUP_DESC reply (OF1.5):
585 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
588 # Verify that duplicate bucket IDs are rejected.
589 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])
590 AT_CHECK([strip_xids < stderr | sed '/truncated/,$d'], [0], [dnl
591 OFPT_ERROR (OF1.5): OFPGMFC_BUCKET_EXISTS
592 OFPT_GROUP_MOD (OF1.5):
596 # Add another bucket just before bucket 15.
597 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15])
598 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
599 AT_CHECK([strip_xids < stdout], [0], [dnl
600 OFPST_GROUP_DESC reply (OF1.5):
601 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
604 # Add two more buckets just before bucket 11,
605 # getting the command from a file.
606 AT_DATA([buckets.txt], [dnl
607 group_id=1234,command_bucket_id=11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13
609 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 - < buckets.txt])
610 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
611 AT_CHECK([strip_xids < stdout], [0], [dnl
612 OFPST_GROUP_DESC reply (OF1.5):
613 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
616 # Add yet two more buckets.
617 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])
618 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
619 AT_CHECK([strip_xids < stdout], [0], [dnl
620 OFPST_GROUP_DESC reply (OF1.5):
621 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
625 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], [],
626 [ovs-ofctl: invalid command bucket id 4294967041
628 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], [],
629 [ovs-ofctl: insert-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
634 dnl This is really bare-bones.
635 dnl It at least checks request and reply serialization and deserialization.
636 dnl Actions definition listed in both supported formats (w/ actions=)
637 AT_SETUP([ofproto - remove group buckets])
639 AT_DATA([groups.txt], [dnl
640 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
642 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
643 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
644 AT_CHECK([strip_xids < stdout], [0], [dnl
645 OFPST_GROUP_DESC reply (OF1.5):
646 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
648 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
649 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
650 AT_CHECK([strip_xids < stdout], [0], [dnl
651 OFPST_GROUP_DESC reply (OF1.5):
652 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
654 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
655 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
656 AT_CHECK([strip_xids < stdout], [0], [dnl
657 OFPST_GROUP_DESC reply (OF1.5):
658 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
660 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=13])
661 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
662 AT_CHECK([strip_xids < stdout], [0], [dnl
663 OFPST_GROUP_DESC reply (OF1.5):
664 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
666 AT_DATA([buckets.txt], [dnl
669 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 - < buckets.txt])
670 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
671 AT_CHECK([strip_xids < stdout], [0], [dnl
672 OFPST_GROUP_DESC reply (OF1.5):
673 group_id=1234,type=all
675 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
676 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
677 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=all])
678 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=1], [1], [], [stderr])
679 AT_CHECK([ofctl_strip < stderr], [0], [dnl
680 OFPT_ERROR (OF1.5): OFPGMFC_UNKNOWN_BUCKET
681 OFPT_GROUP_MOD (OF1.5):
682 REMOVE_BUCKET command_bucket_id:1,group_id=1234
685 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [],
686 [ovs-ofctl: remove-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
691 AT_SETUP([ofproto - bundle del group (OpenFlow 1.3)])
693 AT_DATA([groups.txt], [dnl
694 group_id=1234,type=all,bucket=output:10
695 group_id=1235,type=all,bucket=actions=output:10
697 AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn add-groups br0 groups.txt])
698 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0 ], [0], [stdout])
699 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
700 group_id=1234,type=all,bucket=actions=output:10
701 group_id=1235,type=all,bucket=actions=output:10
702 OFPST_GROUP_DESC reply (OF1.3):
704 AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn del-groups br0 group_id=1234])
705 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout])
706 AT_CHECK([strip_xids < stdout], [0], [dnl
707 OFPST_GROUP_DESC reply (OF1.3):
708 group_id=1235,type=all,bucket=actions=output:10
710 AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn del-groups br0 group_id=1234])
711 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout])
712 AT_CHECK([strip_xids < stdout], [0], [dnl
713 OFPST_GROUP_DESC reply (OF1.3):
714 group_id=1235,type=all,bucket=actions=output:10
716 AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn del-groups br0], [0])
717 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout])
718 AT_CHECK([strip_xids < stdout], [0], [dnl
719 OFPST_GROUP_DESC reply (OF1.3):
723 AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn del-groups br0 group_id=0xfffffff0],
724 [1], [], [ovs-ofctl: invalid group id 4294967280
729 AT_SETUP([ofproto - bundle add indirect group])
731 dnl indirect group must have exactly one bucket
732 AT_DATA([stderr], [dnl
733 OFPT_ERROR (OF1.4) (xid=0x2): OFPGMFC_INVALID_GROUP
734 OFPT_BUNDLE_ADD_MESSAGE (OF1.4) (xid=0x2):
735 bundle_id=0 flags=atomic ordered
736 OFPT_GROUP_MOD (OF1.4) (xid=0x2): ***decode error: OFPGMFC_INVALID_GROUP***
738 AT_CHECK([ovs-ofctl --bundle -vwarn add-group br0 'group_id=1234,type=indirect'], [1], , [stderr])
739 AT_CHECK([ovs-ofctl --bundle -vwarn add-group br0 'group_id=1235,type=indirect,bucket=output:10'])
740 AT_CHECK([ovs-ofctl --bundle -vwarn add-group br0 'group_id=1236,type=indirect,bucket=output:10,bucket=output:11'], [1], , [stderr])
744 AT_SETUP([ofproto - bundle group mod with mod and add_or_mod command])
746 dnl Check that mod-group for non-existing group fails without --may-create
747 AT_DATA([stderr], [dnl
748 OFPT_ERROR (OF1.4) (xid=0x2): OFPGMFC_UNKNOWN_GROUP
749 OFPT_GROUP_MOD (OF1.4) (xid=0x2):
750 MOD group_id=1234,type=indirect,bucket=actions=output:2
752 AT_CHECK([ovs-ofctl --bundle -vwarn mod-group br0 'group_id=1234,type=indirect,bucket=actions=2'], [1], , [stderr])
753 dnl Check that mod-group for non-existing group succeeds with --may-create
754 AT_CHECK([ovs-ofctl --bundle -vwarn --may-create mod-group br0 'group_id=1234,type=indirect,bucket=actions=2'])
755 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-groups br0], [0], [stdout])
756 AT_CHECK([strip_xids < stdout], [0], [dnl
757 OFPST_GROUP_DESC reply (OF1.4):
758 group_id=1234,type=indirect,bucket=actions=output:2
760 dnl Check that mod-group for existing group succeeds with --may-create
761 AT_CHECK([ovs-ofctl --bundle -vwarn --may-create mod-group br0 'group_id=1234,type=indirect,bucket=actions=3'])
762 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-groups br0], [0], [stdout])
763 AT_CHECK([strip_xids < stdout], [0], [dnl
764 OFPST_GROUP_DESC reply (OF1.4):
765 group_id=1234,type=indirect,bucket=actions=output:3
770 AT_SETUP([ofproto - bundle del group (OpenFlow 1.5)])
772 AT_DATA([groups.txt], [dnl
773 group_id=1233,type=select,selection_method=hash,bucket=output:10,bucket=output:11
774 group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11
775 group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
777 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn add-groups br0 groups.txt])
778 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
779 AT_CHECK([strip_xids < stdout], [0], [dnl
780 OFPST_GROUP_DESC reply (OF1.5):
781 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
783 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
784 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
785 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
786 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
787 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
788 OFPST_GROUP_DESC reply (OF1.5):
790 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
791 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
792 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
793 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
794 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
795 OFPST_GROUP_DESC reply (OF1.5):
797 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn del-groups br0], [0])
798 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
799 AT_CHECK([strip_xids < stdout], [0], [dnl
800 OFPST_GROUP_DESC reply (OF1.5):
805 AT_SETUP([ofproto - bundle del group deletes flows])
807 AT_DATA([groups.txt], [dnl
808 group_id=1234,type=all,bucket=output:10
809 group_id=1235,type=all,bucket=output:10
811 AT_CHECK([ovs-ofctl --bundle -vwarn add-groups br0 groups.txt])
812 AT_DATA([flows.txt], [dnl
813 tcp actions=group:1234
814 table=2 udp actions=group:1235
816 AT_CHECK([ovs-ofctl --bundle -vwarn add-flows br0 flows.txt])
817 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-flows br0 | ofctl_strip | sort],
819 table=2, udp actions=group:1235
820 tcp actions=group:1234
821 OFPST_FLOW reply (OF1.4):
823 AT_CHECK([ovs-ofctl --bundle -vwarn del-groups br0 group_id=1234])
824 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-flows br0 | ofctl_strip | sort],
826 table=2, udp actions=group:1235
827 OFPST_FLOW reply (OF1.4):
829 AT_CHECK([ovs-ofctl --bundle -vwarn del-groups br0 group_id=1234])
830 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-flows br0 | ofctl_strip | sort],
832 table=2, udp actions=group:1235
833 OFPST_FLOW reply (OF1.4):
835 AT_CHECK([ovs-ofctl --bundle -vwarn del-groups br0])
836 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-flows br0 | ofctl_strip | sort],
838 OFPST_FLOW reply (OF1.4):
843 dnl This is really bare-bones.
844 dnl It at least checks request and reply serialization and deserialization.
845 dnl Actions definition listed in both supported formats (w/ actions=)
846 AT_SETUP([ofproto - bundle insert group buckets])
848 # Add group with no buckets.
849 AT_DATA([groups.txt], [dnl
850 group_id=1234,type=all
852 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn add-groups br0 groups.txt])
853 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
854 AT_CHECK([strip_xids < stdout], [0], [dnl
855 OFPST_GROUP_DESC reply (OF1.5):
856 group_id=1234,type=all
859 # Add two buckets, using "last".
860 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11])
861 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
862 AT_CHECK([strip_xids < stdout], [0], [dnl
863 OFPST_GROUP_DESC reply (OF1.5):
864 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
867 # Start over again, then add two buckets using "first".
868 AT_DATA([groups.txt], [dnl
870 add group_id=1234,type=all
871 insert_bucket group_id=1234,command_bucket_id=first,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
873 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn add-groups br0 groups.txt])
874 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
875 AT_CHECK([strip_xids < stdout], [0], [dnl
876 OFPST_GROUP_DESC reply (OF1.5):
877 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
880 # Add two more buckets before the existing ones.
881 AT_CHECK([ovs-ofctl --bundle -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])
882 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
883 AT_CHECK([strip_xids < stdout], [0], [dnl
884 OFPST_GROUP_DESC reply (OF1.5):
885 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
888 # Add another bucket at the end.
889 AT_CHECK([ovs-ofctl --bundle -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])
890 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
891 AT_CHECK([strip_xids < stdout], [0], [dnl
892 OFPST_GROUP_DESC reply (OF1.5):
893 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
896 # Verify that duplicate bucket IDs are rejected.
897 AT_CHECK([ovs-ofctl --bundle -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])
898 AT_CHECK([strip_xids < stderr | sed '/talking to/,$d'], [0], [dnl
899 Error OFPGMFC_BUCKET_EXISTS for: OFPT_GROUP_MOD (OF1.5):
900 INSERT_BUCKET command_bucket_id:last,group_id=1234,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
901 Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.5):
902 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
905 # Add another bucket just before bucket 15.
906 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15])
907 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
908 AT_CHECK([strip_xids < stdout], [0], [dnl
909 OFPST_GROUP_DESC reply (OF1.5):
910 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
913 # Add two more buckets just before bucket 11,
914 # getting the command from a file.
915 AT_DATA([buckets.txt], [dnl
916 group_id=1234,command_bucket_id=11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13
918 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 - < buckets.txt])
919 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
920 AT_CHECK([strip_xids < stdout], [0], [dnl
921 OFPST_GROUP_DESC reply (OF1.5):
922 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
925 # Add yet two more buckets.
926 AT_CHECK([ovs-ofctl --bundle -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])
927 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
928 AT_CHECK([strip_xids < stdout], [0], [dnl
929 OFPST_GROUP_DESC reply (OF1.5):
930 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
934 AT_CHECK([ovs-ofctl --bundle -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], [],
935 [ovs-ofctl: invalid command bucket id 4294967041
937 AT_CHECK([ovs-ofctl --bundle -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], [],
938 [ovs-ofctl: insert-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
943 AT_SETUP([ofproto - bundle remove group buckets])
945 AT_DATA([groups.txt], [dnl
946 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
948 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn add-groups br0 groups.txt])
949 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
950 AT_CHECK([strip_xids < stdout], [0], [dnl
951 OFPST_GROUP_DESC reply (OF1.5):
952 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
954 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
955 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
956 AT_CHECK([strip_xids < stdout], [0], [dnl
957 OFPST_GROUP_DESC reply (OF1.5):
958 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
960 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
961 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
962 AT_CHECK([strip_xids < stdout], [0], [dnl
963 OFPST_GROUP_DESC reply (OF1.5):
964 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
966 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=13])
967 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
968 AT_CHECK([strip_xids < stdout], [0], [dnl
969 OFPST_GROUP_DESC reply (OF1.5):
970 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
972 AT_DATA([buckets.txt], [dnl
975 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 - < buckets.txt])
976 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
977 AT_CHECK([strip_xids < stdout], [0], [dnl
978 OFPST_GROUP_DESC reply (OF1.5):
979 group_id=1234,type=all
981 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
982 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
983 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=all])
984 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=1], [1], [], [stderr])
985 AT_CHECK([ofctl_strip < stderr | sed '/talking to/,$d'], [0], [dnl
986 Error OFPGMFC_UNKNOWN_BUCKET for: OFPT_GROUP_MOD (OF1.5):
987 REMOVE_BUCKET command_bucket_id:1,group_id=1234
988 Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.5):
989 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
992 AT_CHECK([ovs-ofctl --bundle -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [],
993 [ovs-ofctl: remove-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
998 dnl This is really bare-bones.
999 dnl It at least checks request and reply serialization and deserialization.
1000 AT_SETUP([ofproto - flow mod checks group availability])
1002 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
1003 AT_DATA([flows.txt], [dnl
1004 tcp actions=group:1234
1005 udp actions=group:1235
1007 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
1008 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'], [1], [], [stderr])
1010 # The output should look like this:
1012 # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................|
1013 # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................|
1014 # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................|
1015 # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............|
1017 # This 'sed' command captures the error message but drops details.
1018 AT_CHECK([sed '/truncated/d
1019 /^000000.0/d' stderr | strip_xids], [0],
1020 [OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP
1021 OFPT_FLOW_MOD (OF1.1):
1026 AT_SETUP([ofproto - bundle flow mod checks group availability])
1028 AT_DATA([bundle.txt], [dnl
1029 group add group_id=1234,type=all,bucket=output:10
1030 flow add tcp actions=group:1234
1031 flow add udp actions=group:1235
1033 AT_CHECK([ovs-ofctl -vwarn bundle br0 bundle.txt], [1], [], [stderr])
1035 # The output should look like this:
1037 # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................|
1038 # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................|
1039 # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................|
1040 # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............|
1042 # This 'sed' command captures the error message but drops details.
1043 AT_CHECK([sed '/truncated/d
1044 /^000000.0/d' stderr | ofctl_strip | sed '/talking to/,$d'], [0],
1046 Error OFPBAC_BAD_OUT_GROUP for: OFPT_FLOW_MOD (OF1.4): ADD udp actions=group:1235
1047 Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.4):
1048 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
1053 dnl This is really bare-bones.
1054 dnl It at least checks request and reply serialization and deserialization.
1055 AT_SETUP([ofproto - group description])
1057 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10], [0], [stdout])
1058 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
1059 AT_CHECK([strip_xids < stdout], [0], [dnl
1060 OFPST_GROUP_DESC reply (OF1.1):
1061 group_id=1234,type=all,bucket=actions=output:10
1066 dnl This is really bare-bones.
1067 dnl It at least checks request and reply serialization and deserialization.
1068 AT_SETUP([ofproto - group description])
1070 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
1071 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
1072 AT_CHECK([strip_xids < stdout], [0], [dnl
1073 OFPST_GROUP_DESC reply (OF1.1):
1074 group_id=1234,type=all,bucket=actions=output:10
1079 dnl This is really bare-bones.
1080 dnl It at least checks request and reply serialization and deserialization.
1081 AT_SETUP([ofproto - group features])
1083 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout])
1084 AT_CHECK([strip_xids < stdout], [0], [dnl
1085 OFPST_GROUP_FEATURES reply (OF1.2):
1090 max_groups=0xffffff00
1091 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
1093 max_groups=0xffffff00
1094 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
1096 max_groups=0xffffff00
1097 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
1098 fast failover group:
1099 max_groups=0xffffff00
1100 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
1105 dnl This is really bare-bones.
1106 dnl It at least checks request and reply serialization and deserialization.
1107 AT_SETUP([ofproto - group stats (OpenFlow 1.1)])
1109 AT_DATA([groups.txt], [dnl
1110 group_id=1234,type=all,bucket=output:10
1111 group_id=1235,type=all,bucket=output:10
1113 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
1114 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
1115 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
1116 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
1117 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1118 OFPST_GROUP reply (OF1.1):
1120 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0], [0], [stdout])
1121 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
1122 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1123 group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1124 OFPST_GROUP reply (OF1.1):
1129 dnl This is really bare-bones.
1130 dnl It at least checks request and reply serialization and deserialization.
1131 AT_SETUP([ofproto - group stats (OpenFlow 1.3)])
1133 AT_DATA([groups.txt], [dnl
1134 group_id=1234,type=all,bucket=output:10
1135 group_id=1235,type=all,bucket=output:10
1137 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
1138 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-flow br0 'tcp actions=group:1234'])
1139 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
1140 AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
1141 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1142 OFPST_GROUP reply (OF1.3):
1144 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0], [0], [stdout])
1145 AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
1146 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1147 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1148 OFPST_GROUP reply (OF1.3):
1153 dnl This is really bare-bones.
1154 dnl It at least checks request and reply serialization and deserialization.
1155 AT_SETUP([ofproto - group stats (OpenFlow 1.5)])
1157 AT_DATA([groups.txt], [dnl
1158 group_id=1234,type=all,bucket=output:10
1159 group_id=1235,type=all,bucket=output:10
1161 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
1162 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-flow br0 'tcp actions=group:1234'])
1163 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
1164 AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
1165 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1166 OFPST_GROUP reply (OF1.5):
1168 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0], [0], [stdout])
1169 AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
1170 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1171 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1172 OFPST_GROUP reply (OF1.5):
1177 dnl This found a use-after-free error in bridge destruction in the
1178 dnl presence of groups.
1179 AT_SETUP([ofproto - group add then bridge delete (OpenFlow 1.3)])
1181 AT_DATA([groups.txt], [dnl
1182 group_id=1234,type=all,bucket=output:10
1183 group_id=1235,type=all,bucket=output:10
1185 dnl This checks for regression against a parser bug such that
1186 dnl "actions=resbmit(,1)" etc. was rejected as a syntax error.
1187 group_id=2345,type=select,bucket=weight:10,actions=resubmit(,1),bucket=weight:10,actions=resubmit(,2),bucket=weight:1,actions=resubmit(,3)
1189 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
1190 AT_CHECK([ovs-vsctl del-br br0])
1194 AT_SETUP([ofproto - mod-port (OpenFlow 1.0)])
1196 for command_config_state in \
1198 'noflood NO_FLOOD 0' \
1199 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
1200 'flood PORT_DOWN LINK_DOWN' \
1201 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
1202 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
1203 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
1204 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
1205 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
1209 set $command_config_state
1210 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
1211 AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
1212 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
1213 AT_CHECK_UNQUOTED([strip_xids < stdout], [0], [dnl
1214 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
1215 n_tables:254, n_buffers:0
1216 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
1217 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
1218 LOCAL(br0): addr:aa:55:aa:55:00:00
1221 speed: 0 Mbps now, 0 Mbps max
1222 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
1228 AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
1230 for command_config_state in \
1232 'down PORT_DOWN LINK_DOWN' \
1233 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
1234 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
1235 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
1236 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
1237 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
1241 set $command_config_state
1242 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
1243 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
1244 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout])
1245 AT_CHECK_UNQUOTED([strip_xids < stdout], [0], [dnl
1246 OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210
1247 n_tables:254, n_buffers:0
1248 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
1249 LOCAL(br0): addr:aa:55:aa:55:00:00
1252 speed: 0 Mbps now, 0 Mbps max
1253 OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0
1259 AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
1261 for command_config_state in \
1263 'down PORT_DOWN LINK_DOWN' \
1264 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
1265 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
1266 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
1267 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
1268 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
1272 set $command_config_state
1273 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
1274 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command])
1275 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn show br0], [0], [stdout])
1276 AT_CHECK_UNQUOTED([strip_xids < stdout], [0], [dnl
1277 OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210
1278 n_tables:254, n_buffers:0
1279 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS BUNDLES
1280 OFPST_PORT_DESC reply (OF1.4):
1281 LOCAL(br0): addr:aa:55:aa:55:00:00
1284 speed: 0 Mbps now, 0 Mbps max
1285 OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0
1291 AT_SETUP([ofproto - mod-port (OpenFlow 1.6)])
1293 for command_config_state in \
1295 'down PORT_DOWN LINK_DOWN' \
1296 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
1297 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
1298 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
1299 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
1300 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
1304 set $command_config_state
1305 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
1306 AT_CHECK([ovs-ofctl -O OpenFlow16 -vwarn mod-port br0 br0 $command])
1307 AT_CHECK([ovs-ofctl -O OpenFlow16 -vwarn show br0], [0], [stdout])
1308 AT_CHECK_UNQUOTED([strip_xids < stdout], [0], [dnl
1309 OFPT_FEATURES_REPLY (OF1.6): dpid:fedcba9876543210
1310 n_tables:254, n_buffers:0
1311 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS BUNDLES
1312 OFPST_PORT_DESC reply (OF1.6):
1313 LOCAL(br0): addr:aa:55:aa:55:00:00
1316 speed: 0 Mbps now, 0 Mbps max
1317 OFPT_GET_CONFIG_REPLY (OF1.6): frags=normal miss_send_len=0
1323 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
1325 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
1327 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -])
1328 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
1329 AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3])
1330 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1331 in_port=1 actions=output:2
1332 in_port=2 actions=output:1
1333 table=1, in_port=4 actions=output:3
1336 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | strip_xids], [0], [dnl
1337 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
1339 AT_CHECK([ovs-ofctl del-flows br0])
1340 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
1345 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
1347 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
1349 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -])
1350 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2])
1351 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3])
1352 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1353 in_port=1 actions=output:2
1354 in_port=2 actions=output:1
1355 table=1, in_port=4 actions=output:3
1358 AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | strip_xids], [0], [dnl
1359 OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
1361 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
1362 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
1367 # It's really dumb that check_overlap and reset_counts are considered
1368 # part of flow state, but OpenFlow implies that it is, and OFTest and
1369 # some users insist on it.
1370 AT_SETUP([ofproto - add-flow and flags])
1372 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 check_overlap,in_port=1,actions=drop])
1373 # Prior to OF1.3, flow dumps didn't include a "flags" field.
1374 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [dnl
1376 in_port=1 actions=drop
1378 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
1379 OFPST_FLOW reply (OF1.1):
1380 in_port=1 actions=drop
1382 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [dnl
1383 OFPST_FLOW reply (OF1.2):
1384 in_port=1 actions=drop
1386 # OF1.3 makes the flags visible.
1387 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip], [0], [dnl
1388 OFPST_FLOW reply (OF1.3):
1389 check_overlap reset_counts in_port=1 actions=drop
1391 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip], [0], [dnl
1392 OFPST_FLOW reply (OF1.4):
1393 check_overlap reset_counts in_port=1 actions=drop
1395 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-flows br0 | ofctl_strip], [0], [dnl
1396 OFPST_FLOW reply (OF1.5):
1397 check_overlap reset_counts in_port=1 actions=drop
1402 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)])
1404 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
1406 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -])
1407 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2])
1408 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3])
1409 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1410 in_port=1 actions=output:2
1411 in_port=2 actions=output:1
1412 table=1, in_port=4 actions=output:3
1413 OFPST_FLOW reply (OF1.1):
1415 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | strip_xids], [0], [dnl
1416 OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2
1418 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
1419 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
1420 table=1, in_port=4 actions=output:3
1425 AT_SETUP([ofproto - flow_mod negative test (OpenFlow 1.1)])
1427 [set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13])
1428 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2])
1430 # The error message here actually comes from ovs-ofctl, not from ovs-vswitchd,
1431 # but at least it's the same code in ofpacts_check() that issues the error.
1432 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1],
1434 [ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID)
1439 AT_SETUP([ofproto - set-field flow_mod commands (NXM)])
1441 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop])
1442 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])
1443 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])
1444 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1445 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[[]]
1446 table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]]
1452 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)])
1454 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
1456 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -])
1457 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2])
1458 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3])
1459 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1460 in_port=1 actions=output:2
1461 in_port=2 actions=output:1
1462 table=1, in_port=4 actions=output:3
1463 OFPST_FLOW reply (OF1.2):
1465 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
1466 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
1471 AT_SETUP([ofproto - set-field flow_mod commands (OF1.2)])
1473 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 ipv6,table=1,in_port=3,actions=drop])
1474 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])
1475 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])
1476 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1477 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
1478 table=1, ipv6,in_port=3 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
1479 OFPST_FLOW reply (OF1.2):
1484 AT_SETUP([ofproto - dump flows with cookie])
1486 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1487 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1488 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1489 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1490 cookie=0x1, in_port=1 actions=output:1
1491 cookie=0x2, in_port=2 actions=output:1
1492 cookie=0x3, in_port=3 actions=output:1
1495 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | strip_xids], [0], [dnl
1496 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
1498 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl
1499 cookie=0x3, in_port=3 actions=output:1
1502 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | strip_xids], [0], [dnl
1503 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
1508 AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)])
1510 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1])
1511 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1512 cookie=0x1, in_port=1 actions=output:1
1516 AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1])
1517 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1518 cookie=0x2, in_port=1 actions=output:1
1524 AT_SETUP([ofproto - mod flow with cookie change (NXM)])
1526 AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1])
1527 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1528 cookie=0x1, in_port=1 actions=output:1
1532 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1])
1533 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1534 cookie=0x2, in_port=1 actions=output:1
1540 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)])
1542 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1543 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1544 cookie=0x1, in_port=1 actions=output:1
1545 OFPST_FLOW reply (OF1.1):
1547 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1])
1548 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1549 cookie=0x1, in_port=1 actions=output:1
1550 OFPST_FLOW reply (OF1.1):
1555 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
1556 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)])
1558 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1559 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1560 cookie=0x1, in_port=1 actions=output:1
1561 OFPST_FLOW reply (OF1.2):
1564 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1])
1565 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1566 cookie=0x1, in_port=1 actions=output:1
1567 OFPST_FLOW reply (OF1.2):
1572 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)])
1574 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1575 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
1576 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
1577 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1578 cookie=0x1, in_port=1 actions=output:1
1579 cookie=0x1, in_port=2 actions=output:1
1580 cookie=0x2, in_port=3 actions=output:1
1584 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4])
1585 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1586 cookie=0x1, in_port=1 actions=output:4
1587 cookie=0x1, in_port=2 actions=output:4
1588 cookie=0x2, in_port=3 actions=output:1
1594 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)])
1596 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1597 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1])
1598 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1])
1599 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1600 cookie=0x1, in_port=1 actions=output:1
1601 cookie=0x1, in_port=2 actions=output:1
1602 cookie=0x2, in_port=3 actions=output:1
1603 OFPST_FLOW reply (OF1.1):
1606 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4])
1607 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1608 cookie=0x1, in_port=1 actions=output:4
1609 cookie=0x1, in_port=2 actions=output:4
1610 cookie=0x2, in_port=3 actions=output:1
1611 OFPST_FLOW reply (OF1.1):
1616 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)])
1618 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1619 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1])
1620 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1])
1621 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1622 cookie=0x1, in_port=1 actions=output:1
1623 cookie=0x1, in_port=2 actions=output:1
1624 cookie=0x2, in_port=3 actions=output:1
1625 OFPST_FLOW reply (OF1.2):
1628 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4])
1629 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1630 cookie=0x1, in_port=1 actions=output:4
1631 cookie=0x1, in_port=2 actions=output:4
1632 cookie=0x2, in_port=3 actions=output:1
1633 OFPST_FLOW reply (OF1.2):
1638 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
1639 AT_SETUP([ofproto - mod flows based on cookie mask with cookie change])
1641 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1642 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
1643 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
1644 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1645 cookie=0x1, in_port=1 actions=output:1
1646 cookie=0x1, in_port=2 actions=output:1
1647 cookie=0x2, in_port=3 actions=output:1
1651 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4])
1652 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1653 cookie=0x2, in_port=3 actions=output:1
1654 cookie=0x4, in_port=1 actions=output:4
1655 cookie=0x4, in_port=2 actions=output:4
1661 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM])
1663 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1])
1664 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1665 in_port=1 actions=output:1
1671 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1])
1673 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1])
1674 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1675 in_port=1 actions=output:1
1676 OFPST_FLOW reply (OF1.1):
1681 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2])
1683 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1])
1684 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1685 OFPST_FLOW reply (OF1.2):
1690 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM])
1692 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1])
1693 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1699 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1])
1701 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1702 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1703 OFPST_FLOW reply (OF1.1):
1708 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2])
1710 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1711 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1712 OFPST_FLOW reply (OF1.2):
1717 AT_SETUP([ofproto - del flows with cookies])
1719 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1720 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1721 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1722 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1723 cookie=0x1, in_port=1 actions=output:1
1724 cookie=0x2, in_port=2 actions=output:1
1725 cookie=0x3, in_port=3 actions=output:1
1729 AT_CHECK([ovs-ofctl del-flows br0])
1730 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1736 AT_SETUP([ofproto - del flows based on cookie])
1738 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1739 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1740 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1741 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1742 cookie=0x1, in_port=1 actions=output:1
1743 cookie=0x2, in_port=2 actions=output:1
1744 cookie=0x3, in_port=3 actions=output:1
1748 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1])
1749 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1750 cookie=0x1, in_port=1 actions=output:1
1751 cookie=0x2, in_port=2 actions=output:1
1757 AT_SETUP([ofproto - del flows based on cookie mask])
1759 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1760 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1761 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1762 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1763 cookie=0x1, in_port=1 actions=output:1
1764 cookie=0x2, in_port=2 actions=output:1
1765 cookie=0x3, in_port=3 actions=output:1
1768 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
1769 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1770 cookie=0x2, in_port=2 actions=output:1
1776 AT_SETUP([ofproto - del flows based on table id (NXM)])
1778 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1779 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1780 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1781 cookie=0x1, in_port=1 actions=output:1
1782 cookie=0x2, table=1, in_port=2 actions=output:1
1785 AT_CHECK([ovs-ofctl del-flows br0 table=0])
1786 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1787 cookie=0x2, table=1, in_port=2 actions=output:1
1790 AT_CHECK([ovs-ofctl del-flows br0 table=1])
1791 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1794 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1795 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1796 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1797 cookie=0x1, in_port=1 actions=output:1
1798 cookie=0x2, table=1, in_port=2 actions=output:1
1801 AT_CHECK([ovs-ofctl del-flows br0])
1802 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1808 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)])
1810 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1811 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1812 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1813 cookie=0x1, in_port=1 actions=output:1
1814 cookie=0x2, table=1, in_port=2 actions=output:1
1815 OFPST_FLOW reply (OF1.1):
1817 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0])
1818 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1819 cookie=0x2, table=1, in_port=2 actions=output:1
1820 OFPST_FLOW reply (OF1.1):
1822 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1])
1823 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1824 OFPST_FLOW reply (OF1.1):
1826 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1827 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1828 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1829 cookie=0x1, in_port=1 actions=output:1
1830 cookie=0x2, table=1, in_port=2 actions=output:1
1831 OFPST_FLOW reply (OF1.1):
1833 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
1834 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
1835 OFPST_FLOW reply (OF1.1):
1836 cookie=0x2, table=1, in_port=2 actions=output:1
1841 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)])
1843 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1844 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1845 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1846 cookie=0x1, in_port=1 actions=output:1
1847 cookie=0x2, table=1, in_port=2 actions=output:1
1848 OFPST_FLOW reply (OF1.2):
1850 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0])
1851 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1852 cookie=0x2, table=1, in_port=2 actions=output:1
1853 OFPST_FLOW reply (OF1.2):
1855 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1])
1856 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1857 OFPST_FLOW reply (OF1.2):
1859 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1860 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1861 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1862 cookie=0x1, in_port=1 actions=output:1
1863 cookie=0x2, table=1, in_port=2 actions=output:1
1864 OFPST_FLOW reply (OF1.2):
1866 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
1867 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1868 OFPST_FLOW reply (OF1.2):
1873 AT_SETUP([ofproto - flow_mod with out_port matching (OpenFlow 1.0)])
1875 AT_DATA([flows.txt], [dnl
1876 in_port=1 actions=output:2
1877 in_port=2 actions=output:1,output:2,output:3
1878 in_port=3 actions=output:3,output:1,output:2
1879 in_port=4 actions=drop
1880 in_port=5 actions=output:3
1881 in_port=6 actions=output:1
1883 AT_CHECK([ovs-ofctl -F openflow10 add-flows br0 flows.txt])
1884 (cat flows.txt; echo 'OFPST_FLOW reply:') > expout
1885 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0],
1888 (grep 'output:2' flows.txt; echo 'OFPST_FLOW reply:') > expout
1889 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 out_port=2 | ofctl_strip | sort], [0], [expout])
1891 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0 out_port=2])
1892 (grep -v 'output:2' flows.txt; echo 'OFPST_FLOW reply:') > expout
1893 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0],
1896 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0 out_port=3])
1897 (grep -v 'output:[[23]]' flows.txt; echo 'OFPST_FLOW reply:') > expout
1898 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0],
1901 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0 out_port=1])
1902 (grep -v 'output:[[123]]' flows.txt; echo 'OFPST_FLOW reply:') > expout
1903 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0],
1909 AT_SETUP([ofproto - flow_mod with out_port matching (OpenFlow 1.1)])
1911 AT_DATA([flows.txt], [dnl
1912 in_port=1 actions=output:2
1913 in_port=2 actions=output:1,write_actions(output:2,output:3)
1914 in_port=3 actions=output:3,output:1,write_actions(output:2)
1915 in_port=4 actions=drop
1916 in_port=5 actions=write_actions(output:3)
1917 in_port=6 actions=output:1
1919 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flows br0 flows.txt])
1920 (cat flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1921 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
1924 (grep 'output:2' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1925 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 out_port=2 | ofctl_strip | sort], [0], [expout])
1927 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_port=2])
1928 (grep -v 'output:2' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1929 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
1932 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_port=3])
1933 (grep -v 'output:[[23]]' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1934 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
1937 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_port=1])
1938 (grep -v 'output:[[123]]' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1939 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
1945 AT_SETUP([ofproto - flow_mod with out_group matching (OpenFlow 1.1)])
1947 AT_DATA([groups.txt], [dnl
1948 group_id=1,type=all,bucket=output:10
1949 group_id=2,type=all,bucket=output:10
1950 group_id=3,type=all,bucket=output:10
1952 AT_CHECK([ovs-ofctl -O OpenFlow11 add-groups br0 groups.txt])
1953 AT_DATA([flows.txt], [dnl
1954 in_port=1 actions=group:2,output:5
1955 in_port=2 actions=group:1,write_actions(group:2,group:3,output:6)
1956 in_port=3 actions=group:3,group:1,write_actions(group:2,output:3)
1957 in_port=4 actions=output:4
1958 in_port=5 actions=write_actions(output:4,group:3)
1959 in_port=6 actions=group:1
1961 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flows br0 flows.txt])
1962 (cat flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1963 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
1966 (grep 'output:3' flows.txt | grep 'group:2'; echo 'OFPST_FLOW reply (OF1.1):') > expout
1967 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 out_port=3,out_group=2 | ofctl_strip | sort], [0], [expout])
1969 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_group=2])
1970 (grep -v 'group:2' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1971 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
1974 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_group=3])
1975 (grep -v 'group:[[23]]' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1976 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
1979 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_group=1])
1980 (grep -v 'group:[[123]]' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1981 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
1987 AT_SETUP([ofproto - bundle flow_mod with out group matching (OpenFlow 1.4)])
1989 AT_DATA([bundle.txt], [dnl
1990 group group_id=1,type=all,bucket=output:10
1991 group group_id=2,type=all,bucket=output:10
1992 group group_id=3,type=all,bucket=output:10
1993 flow in_port=1 actions=group:2,output:5
1994 flow in_port=2 actions=group:1,write_actions(group:2,group:3,output:6)
1995 flow in_port=3 actions=group:3,group:1,write_actions(group:2,output:3)
1996 flow in_port=4 actions=output:4
1997 flow in_port=5 actions=write_actions(output:4,group:3)
1998 flow in_port=6 actions=group:1
2000 AT_CHECK([ovs-ofctl bundle br0 bundle.txt])
2003 AT_DATA([flows.txt], [dnl
2004 in_port=1 actions=group:2,output:5
2005 in_port=2 actions=group:1,write_actions(group:2,group:3,output:6)
2006 in_port=3 actions=group:3,group:1,write_actions(group:2,output:3)
2007 in_port=4 actions=output:4
2008 in_port=5 actions=write_actions(output:4,group:3)
2009 in_port=6 actions=group:1
2012 (cat flows.txt; echo 'OFPST_FLOW reply (OF1.4):') > expout
2013 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2016 (grep 'output:3' flows.txt | grep 'group:2'; echo 'OFPST_FLOW reply (OF1.4):') > expout
2017 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 out_port=3,out_group=2 | ofctl_strip | sort], [0], [expout])
2019 AT_CHECK([ovs-ofctl -O OpenFlow14 del-flows br0 out_group=2])
2020 (grep -v 'group:2' flows.txt; echo 'OFPST_FLOW reply (OF1.4):') > expout
2021 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2024 AT_CHECK([ovs-ofctl -O OpenFlow14 del-flows br0 out_group=3])
2025 (grep -v 'group:[[23]]' flows.txt; echo 'OFPST_FLOW reply (OF1.4):') > expout
2026 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2029 AT_CHECK([ovs-ofctl -O OpenFlow14 del-flows br0 out_group=1])
2030 (grep -v 'group:[[123]]' flows.txt; echo 'OFPST_FLOW reply (OF1.4):') > expout
2031 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2037 AT_SETUP([ofproto - bundle packet-out (OpenFlow 1.4)])
2040 ovs-ofctl del-flows br0
2041 ovs-ofctl add-flow br0 priority=0,actions=drop
2043 # Start a monitor listening for packet-ins.
2044 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
2045 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2046 ovs-appctl -t ovs-ofctl ofctl/barrier
2047 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2048 AT_CAPTURE_FILE([monitor.log])
2050 # This bundle adds a group, a flow using that group and then a
2051 # packet-out that needs them both. Finally the bundle deletes all
2052 # groups, which also deletes the flow, leaving only the drop flow in
2053 # the table. If this works properly, the packet-out should get
2054 # translated and processed before the flow disappears. Also, if the
2055 # bundle were to fail, the packet-in should not get executed.
2056 AT_DATA([bundle.txt], [dnl
2057 group group_id=1,type=all,bucket=output:controller
2058 flow in_port=6 actions=group:1
2059 packet-out in_port=6, packet=0001020304050010203040501234 actions=table
2062 AT_CHECK([ovs-ofctl bundle br0 bundle.txt])
2064 # Verify that only the drop flow remains.
2065 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2066 [ reset_counts priority=0 actions=drop
2067 OFPST_FLOW reply (OF1.4):
2070 # Verify that the packet-in was received via controller action.
2071 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2072 [OFPT_PACKET_IN (xid=0x0): total_len=14 in_port=6 (via action) data_len=14 (unbuffered)
2073 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2079 AT_SETUP([ofproto - bundle packet-out, failing bundle commit (OpenFlow 1.4)])
2082 ovs-ofctl del-flows br0
2083 ovs-ofctl add-flow br0 priority=0,actions=drop
2085 # Start a monitor listening for packet-ins.
2086 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
2087 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2088 ovs-appctl -t ovs-ofctl ofctl/barrier
2089 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2090 AT_CAPTURE_FILE([monitor.log])
2092 # This bundle adds a flow using that group and then a packet-out that
2093 # needs them both. Finally the bundle adds another flow that referes
2094 # to a non-existing group, causing the bundle to fail, and the
2095 # packet-in should not get executed.
2096 AT_DATA([bundle.txt], [dnl
2097 group group_id=1,type=all,bucket=output:controller
2098 flow in_port=6 actions=group:1
2099 packet-out in_port=6, packet=0001020304050010203040501234 actions=table
2100 flow in_port=7 actions=group:2
2102 AT_CHECK([ovs-ofctl bundle br0 bundle.txt 2>&1 | sed '/talking to/,$d' | strip_xids], [], [dnl
2103 Error OFPBAC_BAD_OUT_GROUP for: OFPT_FLOW_MOD (OF1.4): ADD in_port=7 actions=group:2
2104 Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.4):
2105 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
2108 # Verify that only the drop flow remains.
2109 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2110 [ reset_counts priority=0 actions=drop
2111 OFPST_FLOW reply (OF1.4):
2114 # Verify that the packet-in was NOT received via controller action.
2115 AT_CHECK([strip_xids < monitor.log], [0], [])
2120 AT_SETUP([ofproto - bundle packet-out makes bundle commit to fail(OpenFlow 1.4)])
2123 ovs-ofctl del-flows br0
2124 ovs-ofctl add-flow br0 priority=0,actions=drop
2126 # Start a monitor listening for packet-ins.
2127 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
2128 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2129 ovs-appctl -t ovs-ofctl ofctl/barrier
2130 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2131 AT_CAPTURE_FILE([monitor.log])
2133 # This bundle adds a flow using that group and then a packet-out that
2134 # needs them both. Finally the bundle adds another flow that referes
2135 # to a non-existing group, causing the bundle to fail, and the
2136 # packet-in should not get executed.
2137 AT_DATA([bundle.txt], [dnl
2138 group group_id=1,type=all,bucket=output:controller
2139 flow in_port=6 actions=group:1
2140 packet-out in_port=6, packet=0001020304050010203040501234 actions=table
2141 packet-out in_port=6, packet=0001020304050010203040501234 actions=group:2
2143 AT_CHECK([ovs-ofctl bundle br0 bundle.txt 2>&1 | sed '/talking to/,$d' | strip_xids], [], [dnl
2144 Error OFPBAC_BAD_OUT_GROUP for: OFPT_PACKET_OUT (OF1.4): in_port=6 actions=group:2 data_len=14
2145 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2146 Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.4):
2147 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
2150 # Verify that only the drop flow remains.
2151 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2152 [ reset_counts priority=0 actions=drop
2153 OFPST_FLOW reply (OF1.4):
2156 # Verify that the packet-in was NOT received via controller action.
2157 AT_CHECK([strip_xids < monitor.log], [0], [])
2162 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)])
2164 # Check the default configuration.
2166 printf 'OFPST_TABLE reply (xid=0x2):
2168 active=0, lookup=0, matched=0
2171 in_port: exact match or wildcard
2172 eth_src: exact match or wildcard
2173 eth_dst: exact match or wildcard
2174 eth_type: exact match or wildcard
2175 vlan_vid: exact match or wildcard
2176 vlan_pcp: exact match or wildcard
2177 ip_src: exact match or wildcard
2178 ip_dst: exact match or wildcard
2179 nw_proto: exact match or wildcard
2180 nw_tos: exact match or wildcard
2181 tcp_src: exact match or wildcard
2182 tcp_dst: exact match or wildcard
2187 for i in `seq $1 $2`; do
2188 printf ' table %d ("table%d"): ditto\n' $i $i
2191 (head_table classifier; ditto 1 253) > expout
2192 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
2193 # Change the configuration.
2196 -- --id=@t0 create Flow_Table name=main \
2197 -- --id=@t1 create Flow_Table flow-limit=1024 \
2198 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
2199 | ${PERL} $srcdir/uuidfilt.pl],
2203 # Check that the configuration was updated.
2204 (head_table main; echo ' table 1 ("table1"):
2205 active=0, lookup=0, matched=0
2210 active=0, lookup=0, matched=0
2213 '; ditto 3 253) > expout
2214 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
2218 dnl In-band and fail-open add "hidden rules" to table 0. These rules shouldn't
2219 dnl be visible to OpenFlow. This test checks that "dump-flows" and
2220 dnl "dump-tables" don't make them visible.
2221 AT_SETUP([ofproto - hidden rules not in table stats])
2222 # Use an IP address for a controller that won't actually exist: we
2223 # want to create in-band rules but we do not want to actually connect
2224 # to a controller (because that could mess about with our test). The
2225 # Class E range 240.0.0.0 - 255.255.255.255 seems like a good choice.
2226 OVS_VSWITCHD_START([set-controller br0 tcp:240.0.0.1:6653])
2227 for i in 1 2 3 4 5; do ovs-appctl time/warp 1000; done
2229 # Check that no hidden flows are visible in OpenFlow.
2230 AT_CHECK([ovs-ofctl dump-flows br0 | strip_xids], [0], [NXST_FLOW reply:
2233 # Check that some hidden flows related to 240.0.0.1 are actually in table 0.
2235 # We discard flows that mention table_id because we only want table 0 flows,
2236 # which in OVS is implied by the absence of a table_id.
2237 AT_CHECK([ovs-appctl bridge/dump-flows br0], [0], [stdout])
2238 AT_CHECK([test `grep '240\.0\.0\.1' stdout | grep -v table_id= | wc -l` -gt 0])
2240 # Check that dump-tables doesn't count the hidden flows.
2242 printf 'OFPST_TABLE reply:
2244 active=0, lookup=0, matched=0
2247 in_port: exact match or wildcard
2248 eth_src: exact match or wildcard
2249 eth_dst: exact match or wildcard
2250 eth_type: exact match or wildcard
2251 vlan_vid: exact match or wildcard
2252 vlan_pcp: exact match or wildcard
2253 ip_src: exact match or wildcard
2254 ip_dst: exact match or wildcard
2255 nw_proto: exact match or wildcard
2256 nw_tos: exact match or wildcard
2257 tcp_src: exact match or wildcard
2258 tcp_dst: exact match or wildcard
2263 for i in `seq $1 $2`; do
2264 printf ' table %d ("table%d"): ditto\n' $i $i
2267 (head_table classifier; ditto 1 253) > expout
2268 AT_CHECK([ovs-ofctl dump-tables br0 | strip_xids], [0], [expout])
2269 OVS_VSWITCHD_STOP(["/240\.0\.0\.1/d"])
2272 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)])
2274 # Check the default configuration.
2276 printf 'OFPST_TABLE reply (OF1.2) (xid=0x2):
2278 active=0, lookup=0, matched=0
2279 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2282 instructions (table miss and others):
2283 instructions: apply_actions,clear_actions,write_actions,write_metadata,goto_table
2284 Write-Actions and Apply-Actions features:
2285 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
2286 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
2288 metadata: exact match or wildcard
2289 in_port_oxm: exact match or wildcard
2290 eth_src: exact match or wildcard
2291 eth_dst: exact match or wildcard
2292 eth_type: exact match or wildcard
2293 vlan_vid: exact match or wildcard
2294 vlan_pcp: exact match or wildcard
2295 mpls_label: exact match or wildcard
2296 mpls_tc: exact match or wildcard
2297 ip_src: exact match or wildcard
2298 ip_dst: exact match or wildcard
2299 ipv6_src: exact match or wildcard
2300 ipv6_dst: exact match or wildcard
2301 ipv6_label: exact match or wildcard
2302 nw_proto: exact match or wildcard
2303 ip_dscp: exact match or wildcard
2304 nw_ecn: exact match or wildcard
2305 arp_op: exact match or wildcard
2306 arp_spa: exact match or wildcard
2307 arp_tpa: exact match or wildcard
2308 arp_sha: exact match or wildcard
2309 arp_tha: exact match or wildcard
2310 tcp_src: exact match or wildcard
2311 tcp_dst: exact match or wildcard
2312 udp_src: exact match or wildcard
2313 udp_dst: exact match or wildcard
2314 sctp_src: exact match or wildcard
2315 sctp_dst: exact match or wildcard
2316 icmp_type: exact match or wildcard
2317 icmp_code: exact match or wildcard
2318 icmpv6_type: exact match or wildcard
2319 icmpv6_code: exact match or wildcard
2320 nd_target: exact match or wildcard
2321 nd_sll: exact match or wildcard
2322 nd_tll: exact match or wildcard
2327 for i in `seq $1 $2`; do
2328 printf ' table %d ("table%d"): ditto\n' $i $i
2332 printf ' table 253 ("table253"):
2333 active=0, lookup=0, matched=0
2334 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2337 instructions (table miss and others):
2338 instructions: apply_actions,clear_actions,write_actions,write_metadata
2343 (head_table classifier; ditto 1 252; tail_table) > expout
2344 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
2345 # Change the configuration.
2348 -- --id=@t0 create Flow_Table name=main \
2349 -- --id=@t1 create Flow_Table flow-limit=1024 \
2350 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
2351 | ${PERL} $srcdir/uuidfilt.pl],
2355 # Check that the configuration was updated.
2356 (head_table main; echo ' table 1 ("table1"):
2357 active=0, lookup=0, matched=0
2358 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2365 active=0, lookup=0, matched=0
2366 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2371 '; ditto 3 252; tail_table) > expout
2372 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
2376 AT_SETUP([ofproto - table features (OpenFlow 1.3)])
2379 printf ' table 0 ("%s"):
2380 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2382 instructions (table miss and others):
2384 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata,goto_table
2385 Write-Actions and Apply-Actions features:
2386 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
2387 supported on Set-Field: tun_id tun_src tun_dst tun_ipv6_src tun_ipv6_dst tun_flags tun_gbp_id tun_gbp_flags tun_metadata0 dnl
2388 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
2389 metadata in_port in_port_oxm pkt_mark ct_mark ct_label reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 reg9 reg10 reg11 reg12 reg13 reg14 reg15 xreg0 xreg1 xreg2 xreg3 xreg4 xreg5 xreg6 xreg7 xxreg0 xxreg1 xxreg2 xxreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc mpls_ttl 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
2391 dp_hash: arbitrary mask
2392 recirc_id: exact match or wildcard
2393 packet_type: exact match or wildcard
2394 conj_id: exact match or wildcard
2395 tun_id: arbitrary mask
2396 tun_src: arbitrary mask
2397 tun_dst: arbitrary mask
2398 tun_ipv6_src: arbitrary mask
2399 tun_ipv6_dst: arbitrary mask
2400 tun_flags: arbitrary mask
2401 tun_gbp_id: arbitrary mask
2402 tun_gbp_flags: arbitrary mask
2403 tun_metadata0: arbitrary mask
2404 tun_metadata1: arbitrary mask
2405 tun_metadata2: arbitrary mask
2406 tun_metadata3: arbitrary mask
2407 tun_metadata4: arbitrary mask
2408 tun_metadata5: arbitrary mask
2409 tun_metadata6: arbitrary mask
2410 tun_metadata7: arbitrary mask
2411 tun_metadata8: arbitrary mask
2412 tun_metadata9: arbitrary mask
2413 tun_metadata10: arbitrary mask
2414 tun_metadata11: arbitrary mask
2415 tun_metadata12: arbitrary mask
2416 tun_metadata13: arbitrary mask
2417 tun_metadata14: arbitrary mask
2418 tun_metadata15: arbitrary mask
2419 tun_metadata16: arbitrary mask
2420 tun_metadata17: arbitrary mask
2421 tun_metadata18: arbitrary mask
2422 tun_metadata19: arbitrary mask
2423 tun_metadata20: arbitrary mask
2424 tun_metadata21: arbitrary mask
2425 tun_metadata22: arbitrary mask
2426 tun_metadata23: arbitrary mask
2427 tun_metadata24: arbitrary mask
2428 tun_metadata25: arbitrary mask
2429 tun_metadata26: arbitrary mask
2430 tun_metadata27: arbitrary mask
2431 tun_metadata28: arbitrary mask
2432 tun_metadata29: arbitrary mask
2433 tun_metadata30: arbitrary mask
2434 tun_metadata31: arbitrary mask
2435 tun_metadata32: arbitrary mask
2436 tun_metadata33: arbitrary mask
2437 tun_metadata34: arbitrary mask
2438 tun_metadata35: arbitrary mask
2439 tun_metadata36: arbitrary mask
2440 tun_metadata37: arbitrary mask
2441 tun_metadata38: arbitrary mask
2442 tun_metadata39: arbitrary mask
2443 tun_metadata40: arbitrary mask
2444 tun_metadata41: arbitrary mask
2445 tun_metadata42: arbitrary mask
2446 tun_metadata43: arbitrary mask
2447 tun_metadata44: arbitrary mask
2448 tun_metadata45: arbitrary mask
2449 tun_metadata46: arbitrary mask
2450 tun_metadata47: arbitrary mask
2451 tun_metadata48: arbitrary mask
2452 tun_metadata49: arbitrary mask
2453 tun_metadata50: arbitrary mask
2454 tun_metadata51: arbitrary mask
2455 tun_metadata52: arbitrary mask
2456 tun_metadata53: arbitrary mask
2457 tun_metadata54: arbitrary mask
2458 tun_metadata55: arbitrary mask
2459 tun_metadata56: arbitrary mask
2460 tun_metadata57: arbitrary mask
2461 tun_metadata58: arbitrary mask
2462 tun_metadata59: arbitrary mask
2463 tun_metadata60: arbitrary mask
2464 tun_metadata61: arbitrary mask
2465 tun_metadata62: arbitrary mask
2466 tun_metadata63: arbitrary mask
2467 metadata: arbitrary mask
2468 in_port: exact match or wildcard
2469 in_port_oxm: exact match or wildcard
2470 actset_output: exact match or wildcard
2471 pkt_mark: arbitrary mask
2472 ct_state: arbitrary mask
2473 ct_zone: exact match or wildcard
2474 ct_mark: arbitrary mask
2475 ct_label: arbitrary mask
2476 ct_nw_proto: exact match or wildcard
2477 ct_nw_src: arbitrary mask
2478 ct_nw_dst: arbitrary mask
2479 ct_ipv6_src: arbitrary mask
2480 ct_ipv6_dst: arbitrary mask
2481 ct_tp_src: arbitrary mask
2482 ct_tp_dst: arbitrary mask
2483 reg0: arbitrary mask
2484 reg1: arbitrary mask
2485 reg2: arbitrary mask
2486 reg3: arbitrary mask
2487 reg4: arbitrary mask
2488 reg5: arbitrary mask
2489 reg6: arbitrary mask
2490 reg7: arbitrary mask
2491 reg8: arbitrary mask
2492 reg9: arbitrary mask
2493 reg10: arbitrary mask
2494 reg11: arbitrary mask
2495 reg12: arbitrary mask
2496 reg13: arbitrary mask
2497 reg14: arbitrary mask
2498 reg15: arbitrary mask
2499 xreg0: arbitrary mask
2500 xreg1: arbitrary mask
2501 xreg2: arbitrary mask
2502 xreg3: arbitrary mask
2503 xreg4: arbitrary mask
2504 xreg5: arbitrary mask
2505 xreg6: arbitrary mask
2506 xreg7: arbitrary mask
2507 xxreg0: arbitrary mask
2508 xxreg1: arbitrary mask
2509 xxreg2: arbitrary mask
2510 xxreg3: arbitrary mask
2511 eth_src: arbitrary mask
2512 eth_dst: arbitrary mask
2513 eth_type: exact match or wildcard
2514 vlan_tci: arbitrary mask
2515 vlan_vid: arbitrary mask
2516 vlan_pcp: exact match or wildcard
2517 mpls_label: exact match or wildcard
2518 mpls_tc: exact match or wildcard
2519 mpls_bos: exact match or wildcard
2520 mpls_ttl: exact match or wildcard
2521 ip_src: arbitrary mask
2522 ip_dst: arbitrary mask
2523 ipv6_src: arbitrary mask
2524 ipv6_dst: arbitrary mask
2525 ipv6_label: arbitrary mask
2526 nw_proto: exact match or wildcard
2527 nw_tos: exact match or wildcard
2528 ip_dscp: exact match or wildcard
2529 nw_ecn: exact match or wildcard
2530 nw_ttl: exact match or wildcard
2531 ip_frag: arbitrary mask
2532 arp_op: exact match or wildcard
2533 arp_spa: arbitrary mask
2534 arp_tpa: arbitrary mask
2535 arp_sha: arbitrary mask
2536 arp_tha: arbitrary mask
2537 tcp_src: arbitrary mask
2538 tcp_dst: arbitrary mask
2539 tcp_flags: arbitrary mask
2540 udp_src: arbitrary mask
2541 udp_dst: arbitrary mask
2542 sctp_src: arbitrary mask
2543 sctp_dst: arbitrary mask
2544 icmp_type: exact match or wildcard
2545 icmp_code: exact match or wildcard
2546 icmpv6_type: exact match or wildcard
2547 icmpv6_code: exact match or wildcard
2548 nd_target: arbitrary mask
2549 nd_sll: arbitrary mask
2550 nd_tll: arbitrary mask
2555 printf ' table %d ("%s"):
2556 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2558 instructions (table miss and others):
2564 ' $1 $2 $3 `expr $1 + 1`
2567 echo ' table 252 ("table252"):
2568 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2570 instructions (table miss and others):
2576 table 253 ("table253"):
2577 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2579 instructions (table miss and others):
2580 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata
2585 (head_table classifier
2586 for i in `seq 1 251`; do
2587 ditto $i table$i 1000000
2589 tail_tables) > expout
2590 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
2591 # Change the configuration.
2594 -- --id=@t0 create Flow_Table name=main \
2595 -- --id=@t1 create Flow_Table flow-limit=1024 \
2596 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
2597 | ${PERL} $srcdir/uuidfilt.pl],
2601 # Check that the configuration was updated.
2604 for i in `seq 2 251`; do
2605 ditto $i table$i 1000000
2607 tail_tables) > expout
2608 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
2612 AT_SETUP([ofproto - table description (OpenFlow 1.4)])
2615 while test $x -lt 254; do
2618 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
2622 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
2623 /^OFPST_TABLE_DESC/d'], [0], [expout])
2625 # Change the configuration.
2626 AT_CHECK([ovs-ofctl -O Openflow14 mod-table br0 0 evict])
2627 # Check that the configuration was updated.
2628 mv expout orig-expout
2629 sed -e '2s/eviction=off/eviction=on/' <orig-expout > expout
2630 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
2631 /^OFPST_TABLE_DESC/d'], [0], [expout])
2633 AT_CHECK([ovs-ofctl -O Openflow14 mod-table br0 0 vacancy:20,80])
2634 # Check that the configuration was updated.
2635 mv expout orig-expout
2636 sed -e '3s/vacancy=off/vacancy=on vacancy_down=20% vacancy_up=80% vacancy=100%/' <orig-expout > expout
2637 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
2638 /^OFPST_TABLE_DESC/d'], [0], [expout])
2642 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)])
2644 # Configure a maximum of 4 flows.
2647 -- --id=@t0 create Flow_Table flow-limit=4 \
2648 -- set bridge br0 flow_tables:0=@t0 \
2649 | ${PERL} $srcdir/uuidfilt.pl],
2653 for in_port in 1 2 3 4; do
2654 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
2656 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2657 in_port=1 actions=drop
2658 in_port=2 actions=drop
2659 in_port=3 actions=drop
2660 in_port=4 actions=drop
2663 # Adding another flow will be refused.
2664 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
2665 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
2666 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2668 # Also a mod-flow that would add a flow will be refused.
2669 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
2670 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
2671 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2673 # Replacing or modifying an existing flow is allowed.
2674 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
2675 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
2676 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2677 in_port=1 actions=drop
2678 in_port=2 actions=drop
2679 in_port=3 actions=output:1
2680 in_port=4 actions=NORMAL
2686 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)])
2688 # Configure a maximum of 4 flows.
2691 -- --id=@t0 create Flow_Table flow-limit=4 \
2692 -- set bridge br0 flow_tables:0=@t0 \
2693 | ${PERL} $srcdir/uuidfilt.pl],
2697 for in_port in 1 2 3 4; do
2698 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
2700 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2701 in_port=1 actions=drop
2702 in_port=2 actions=drop
2703 in_port=3 actions=drop
2704 in_port=4 actions=drop
2705 OFPST_FLOW reply (OF1.2):
2707 # Adding another flow will be refused.
2708 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
2709 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
2710 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
2712 # Replacing or modifying an existing flow is allowed.
2713 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
2714 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
2715 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2716 in_port=1 actions=drop
2717 in_port=2 actions=drop
2718 in_port=3 actions=output:1
2719 in_port=4 actions=NORMAL
2720 OFPST_FLOW reply (OF1.2):
2725 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
2727 # Configure a maximum of 4 flows.
2730 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2731 -- set bridge br0 flow_tables:0=@t0 \
2732 | ${PERL} $srcdir/uuidfilt.pl],
2736 for in_port in 4 3 2 1; do
2737 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
2739 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2740 idle_timeout=10, in_port=1 actions=drop
2741 idle_timeout=20, in_port=2 actions=drop
2742 idle_timeout=30, in_port=3 actions=drop
2743 idle_timeout=40, in_port=4 actions=drop
2746 # Adding another flow will cause the one that expires soonest to be evicted.
2747 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
2748 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2749 idle_timeout=20, in_port=2 actions=drop
2750 idle_timeout=30, in_port=3 actions=drop
2751 idle_timeout=40, in_port=4 actions=drop
2752 in_port=5 actions=drop
2755 # A mod-flow that adds a flow also causes eviction, but replacing or
2756 # modifying an existing flow doesn't.
2757 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
2758 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
2759 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
2760 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2761 idle_timeout=30, in_port=3 actions=output:1
2762 in_port=4 actions=NORMAL
2763 in_port=5 actions=drop
2764 in_port=6 actions=drop
2767 # Flows with no timeouts at all cannot be evicted.
2768 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
2769 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
2770 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
2771 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2773 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2774 in_port=4 actions=NORMAL
2775 in_port=5 actions=drop
2776 in_port=6 actions=drop
2777 in_port=7 actions=NORMAL
2783 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
2785 # Configure a maximum of 4 flows.
2788 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2789 -- set bridge br0 flow_tables:0=@t0 \
2790 | ${PERL} $srcdir/uuidfilt.pl],
2794 for in_port in 4 3 2 1; do
2795 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
2797 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2798 idle_timeout=10, in_port=1 actions=drop
2799 idle_timeout=20, in_port=2 actions=drop
2800 idle_timeout=30, in_port=3 actions=drop
2801 idle_timeout=40, in_port=4 actions=drop
2802 OFPST_FLOW reply (OF1.2):
2804 # Adding another flow will cause the one that expires soonest to be evicted.
2805 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
2806 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2807 idle_timeout=20, in_port=2 actions=drop
2808 idle_timeout=30, in_port=3 actions=drop
2809 idle_timeout=40, in_port=4 actions=drop
2810 in_port=5 actions=drop
2811 OFPST_FLOW reply (OF1.2):
2813 # In OpenFlow 1.2 a mod-flow does not ever add a flow and thus
2814 # has no effect on eviction
2815 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
2816 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
2817 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
2818 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2819 idle_timeout=20, in_port=2 actions=drop
2820 idle_timeout=30, in_port=3 actions=output:1
2821 in_port=4 actions=NORMAL
2822 in_port=5 actions=drop
2823 OFPST_FLOW reply (OF1.2):
2825 # Flows with no timeouts at all cannot be evicted.
2826 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
2827 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
2828 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
2829 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
2830 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
2832 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2833 in_port=4 actions=NORMAL
2834 in_port=5 actions=drop
2835 in_port=6 actions=drop
2836 in_port=7 actions=NORMAL
2837 OFPST_FLOW reply (OF1.2):
2842 AT_SETUP([ofproto - eviction using importance upon table overflow (OpenFlow 1.4)])
2844 # Configure a maximum of 4 flows.
2847 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
2848 -- set bridge br0 flow_tables:0=@t0 \
2849 | ${PERL} $srcdir/uuidfilt.pl],
2852 # Use mod-table to turn on eviction just to demonstrate that it works.
2853 AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 evict])
2855 for in_port in 4 3 2 1; do
2856 ovs-ofctl -O Openflow14 add-flow br0 importance=$((in_port + 30)),priority=$((in_port + 5)),hard_timeout=$((in_port + 500)),actions=drop
2858 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2859 hard_timeout=501, importance=31, priority=6 actions=drop
2860 hard_timeout=502, importance=32, priority=7 actions=drop
2861 hard_timeout=503, importance=33, priority=8 actions=drop
2862 hard_timeout=504, importance=34, priority=9 actions=drop
2863 OFPST_FLOW reply (OF1.4):
2865 # Adding another flow will cause the one with lowest importance to be evicted.
2866 AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=505,importance=35,priority=10,in_port=2,actions=drop])
2867 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2868 hard_timeout=502, importance=32, priority=7 actions=drop
2869 hard_timeout=503, importance=33, priority=8 actions=drop
2870 hard_timeout=504, importance=34, priority=9 actions=drop
2871 hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop
2872 OFPST_FLOW reply (OF1.4):
2874 # Disable the Eviction configuration.
2875 AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 noevict])
2876 # Adding another flow will cause the system to give error for FULL TABLE.
2877 AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=506,importance=36,priority=11,actions=drop],[1], [], [stderr])
2878 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
2879 [OFPT_ERROR (OF1.4): OFPFMFC_TABLE_FULL
2881 #Dump flows. It should show only the old values
2882 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2883 hard_timeout=502, importance=32, priority=7 actions=drop
2884 hard_timeout=503, importance=33, priority=8 actions=drop
2885 hard_timeout=504, importance=34, priority=9 actions=drop
2886 hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop
2887 OFPST_FLOW reply (OF1.4):
2889 # mod-flow that would modify a flow will be done successfully.
2890 AT_CHECK([ovs-ofctl -O Openflow14 mod-flows br0 in_port=2,actions=NORMAL])
2891 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2892 hard_timeout=502, importance=32, priority=7 actions=drop
2893 hard_timeout=503, importance=33, priority=8 actions=drop
2894 hard_timeout=504, importance=34, priority=9 actions=drop
2895 hard_timeout=505, importance=35, priority=10,in_port=2 actions=NORMAL
2896 OFPST_FLOW reply (OF1.4):
2898 # Also a mod-flow that would add a flow will be refused.
2899 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
2900 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
2901 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2906 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
2908 # Configure a maximum of 4 flows.
2911 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
2912 overflow-policy=evict \
2913 groups='"NXM_OF_IN_PORT[[]]"' \
2914 -- set bridge br0 flow_tables:0=@t0 \
2915 | ${PERL} $srcdir/uuidfilt.pl],
2919 ovs-ofctl add-flows br0 - <<EOF
2920 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
2921 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
2922 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
2923 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
2925 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2926 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2927 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
2928 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2929 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2932 # Adding another flow will cause the one that expires soonest within
2933 # the largest group (those with in_port=1) to be evicted. In this
2934 # case this is not the same as the one that expires soonest overall
2935 # (which is what makes the test interesting):
2936 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
2937 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2938 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2939 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2940 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2941 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2944 # Enlarge the flow limit, change the eviction policy back to strictly
2945 # based on expiration, and and add some flows.
2946 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
2947 ovs-ofctl add-flows br0 - <<EOF
2948 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
2949 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
2950 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
2952 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2953 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2954 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2955 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2956 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2957 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2958 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2959 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2962 # Adding another flow will cause the one that expires soonest overall
2964 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
2965 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2966 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2967 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2968 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2969 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2970 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2971 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2972 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2975 # Reducing the flow limit also causes the flows that expire soonest
2976 # overall to be evicted.
2977 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
2978 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2979 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2980 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2981 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2982 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2988 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
2990 # Configure a maximum of 4 flows.
2993 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
2994 overflow-policy=evict \
2995 groups='"NXM_OF_IN_PORT[[]]"' \
2996 -- set bridge br0 flow_tables:0=@t0 \
2997 | ${PERL} $srcdir/uuidfilt.pl],
3001 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
3002 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
3003 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
3004 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
3005 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
3007 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3008 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
3009 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
3010 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
3011 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
3012 OFPST_FLOW reply (OF1.2):
3014 # Adding another flow will cause the one that expires soonest within
3015 # the largest group (those with in_port=1) to be evicted. In this
3016 # case this is not the same as the one that expires soonest overall
3017 # (which is what makes the test interesting):
3018 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
3019 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3020 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
3021 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
3022 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
3023 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
3024 OFPST_FLOW reply (OF1.2):
3026 # Enlarge the flow limit, change the eviction policy back to strictly
3027 # based on expiration, and and add some flows.
3028 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
3029 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
3030 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
3031 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
3032 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
3034 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3035 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
3036 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
3037 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
3038 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3039 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
3040 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
3041 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
3042 OFPST_FLOW reply (OF1.2):
3044 # Adding another flow will cause the one that expires soonest overall
3046 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'])
3047 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3048 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
3049 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
3050 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3051 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
3052 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
3053 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
3054 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
3055 OFPST_FLOW reply (OF1.2):
3057 # Reducing the flow limit also causes the flows that expire soonest
3058 # overall to be evicted.
3059 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
3060 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3061 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
3062 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
3063 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
3064 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
3065 OFPST_FLOW reply (OF1.2):
3070 AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout])
3072 # Configure a maximum of 4 flows.
3075 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
3076 -- set bridge br0 flow_tables:0=@t0 \
3077 | ${PERL} $srcdir/uuidfilt.pl],
3080 ovs-appctl time/stop
3082 for in_port in 4 3 2 1; do
3083 ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
3085 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3086 hard_timeout=13, in_port=1 actions=drop
3087 hard_timeout=16, in_port=2 actions=drop
3088 hard_timeout=19, in_port=3 actions=drop
3089 hard_timeout=22, in_port=4 actions=drop
3092 # Sleep and modify the one that expires soonest
3093 ovs-appctl time/warp 5000
3094 AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop])
3095 # At this point the table would looks like:
3096 # in_port seconds to expire
3101 ovs-appctl time/warp 2000
3102 # Adding another flow will cause the one that expires soonest to be evicted.
3103 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
3104 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3105 hard_timeout=13, in_port=1 actions=drop
3106 hard_timeout=19, in_port=3 actions=drop
3107 hard_timeout=22, in_port=4 actions=drop
3108 in_port=5 actions=drop
3114 AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout])
3115 OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1])
3116 # Configure a maximum of 4 flows.
3119 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
3120 -- set bridge br0 flow_tables:0=@t0 \
3121 | ${PERL} $srcdir/uuidfilt.pl],
3125 for in_port in 4 3 2 1; do
3126 ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
3128 ovs-appctl time/stop
3129 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3130 idle_timeout=13, in_port=1 actions=drop
3131 idle_timeout=16, in_port=2 actions=drop
3132 idle_timeout=19, in_port=3 actions=drop
3133 idle_timeout=22, in_port=4 actions=drop
3136 # Sleep and receive on the flow that expires soonest
3137 ovs-appctl time/warp 5000
3138 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)'])
3139 # At this point the table would looks like:
3140 # in_port seconds to expire
3145 ovs-appctl time/warp 2000
3146 # Adding another flow will cause the one that expires soonest to be evicted.
3147 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
3148 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3149 idle_timeout=19, in_port=3 actions=drop
3150 idle_timeout=22, in_port=4 actions=drop
3151 in_port=5 actions=drop
3152 n_packets=1, n_bytes=14, idle_timeout=13, in_port=1 actions=drop
3158 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
3160 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
3162 printf '\n\n--- check_async %d ---\n\n\n' $1
3165 ovs-appctl -t ovs-ofctl ofctl/barrier
3166 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3169 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
3170 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
3171 if test X"$1" = X"OFPR_ACTION"; then shift;
3172 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3173 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3176 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
3177 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
3178 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
3179 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
3180 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3183 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
3184 ovs-ofctl packet-out br0 "in_port=controller packet=002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00 actions=dec_ttl"
3185 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
3186 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
3187 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"
3190 # OFPT_PORT_STATUS, OFPPR_ADD
3191 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
3192 if test X"$1" = X"OFPPR_ADD"; then shift;
3193 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
3196 speed: 0 Mbps now, 0 Mbps max"
3199 # OFPT_PORT_STATUS, OFPPR_DELETE
3200 ovs-vsctl del-port br0 test
3201 if test X"$1" = X"OFPPR_DELETE"; then shift;
3202 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
3205 speed: 0 Mbps now, 0 Mbps max"
3208 # OFPT_FLOW_REMOVED, OFPRR_DELETE
3209 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
3210 ovs-ofctl --strict del-flows br0 ''
3211 if test X"$1" = X"OFPRR_DELETE"; then shift;
3212 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
3214 AT_FAIL_IF([test X"$1" != X])
3216 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3220 s/ (xid=0x[0-9a-fA-F]*)//
3222 s/00:0.$/00:0x/' < monitor.log]],
3226 # It's a service connection so initially there should be no async messages.
3229 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3230 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
3231 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3233 # Set miss_send_len to 128 and enable invalid_ttl.
3234 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
3235 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3237 # Become slave, which should disable everything except port status.
3238 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
3239 check_async 4 OFPPR_ADD OFPPR_DELETE
3241 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
3242 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
3243 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
3245 # Set controller ID 123.
3246 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
3247 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
3249 # Restore controller ID 0.
3250 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
3253 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
3254 check_async 7 OFPR_ACTION OFPPR_ADD
3256 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3260 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
3262 AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile])
3264 printf '\n\n--- check_async %d ---\n\n\n' $1
3268 ovs-appctl -t ovs-ofctl ofctl/barrier
3269 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3272 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
3273 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
3274 if test X"$1" = X"OFPR_ACTION"; then shift;
3275 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3276 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3279 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
3280 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
3281 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
3282 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
3283 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3286 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
3287 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
3288 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
3289 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
3290 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"
3293 # OFPT_PORT_STATUS, OFPPR_ADD
3294 ovs-vsctl add-port br0 test -- set Interface test type=dummy
3295 if test X"$1" = X"OFPPR_ADD"; then shift;
3296 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3299 speed: 0 Mbps now, 0 Mbps max"
3302 # OFPT_PORT_STATUS, OFPPR_DELETE
3303 ovs-vsctl del-port br0 test
3304 if test X"$1" = X"OFPPR_DELETE"; then shift;
3305 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3308 speed: 0 Mbps now, 0 Mbps max"
3311 # OFPT_FLOW_REMOVED, OFPRR_DELETE
3312 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
3313 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
3314 if test X"$1" = X"OFPRR_DELETE"; then shift;
3315 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
3317 AT_FAIL_IF([test X"$1" != X])
3319 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3323 s/ (xid=0x[0-9a-fA-F]*)//
3325 s/00:0.$/00:0x/' < monitor.log]],
3329 # It's a service connection so initially there should be no async messages.
3332 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3333 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
3334 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3336 # Set miss_send_len to 128 and enable invalid_ttl.
3337 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
3338 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3340 # Become slave (OF 1.2), which should disable everything except port status.
3341 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
3342 check_async 4 OFPPR_ADD OFPPR_DELETE
3344 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
3345 ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
3346 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
3348 # Set controller ID 123.
3349 ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
3350 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
3352 # Restore controller ID 0.
3353 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
3355 # Become master (OF 1.2).
3356 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
3357 check_async 7 OFPR_ACTION OFPPR_ADD
3359 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3363 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
3364 OVS_VSWITCHD_START([dnl
3365 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=10
3367 AT_CHECK([ovs-ofctl -O OpenFlow13 -P standard monitor br0 --detach --no-chdir --pidfile])
3369 printf '\n\n--- check_async %d ---\n\n\n' $1
3373 ovs-appctl -t ovs-ofctl ofctl/barrier
3374 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3377 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
3378 # OFPR_ACTION_SET is treated as OFPR_ACTION in OpenFlow 1.3
3379 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
3380 ovs-ofctl -O OpenFlow13 add-flow br0 'in_port=10 actions=write_actions(output(CONTROLLER))'
3381 ovs-appctl netdev-dummy/receive p1 'in_port(10),eth(src=00:10:20:30:40:50,dst=00:01:02:03:04:05),eth_type(0x1234)'
3382 if test X"$1" = X"OFPR_ACTION"; then shift;
3383 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3384 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3385 echo >>expout "OFPT_PACKET_IN (OF1.3): cookie=0x0 total_len=14 in_port=10 (via action) data_len=14 (unbuffered)
3386 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3389 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
3390 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
3391 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
3392 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
3393 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3396 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
3397 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
3398 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
3399 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
3400 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"
3403 # OFPT_PORT_STATUS, OFPPR_ADD
3404 ovs-vsctl add-port br0 test -- set Interface test type=dummy
3405 if test X"$1" = X"OFPPR_ADD"; then shift;
3406 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3409 speed: 0 Mbps now, 0 Mbps max"
3412 # OFPT_PORT_STATUS, OFPPR_DELETE
3413 ovs-vsctl del-port br0 test
3414 if test X"$1" = X"OFPPR_DELETE"; then shift;
3415 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3418 speed: 0 Mbps now, 0 Mbps max"
3421 # OFPT_FLOW_REMOVED, OFPRR_DELETE
3422 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
3423 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
3424 if test X"$1" = X"OFPRR_DELETE"; then shift;
3425 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
3428 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
3429 ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10
3430 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234
3431 ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234
3432 if test X"$1" = X"OFPRR_DELETE"; then shift;
3433 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=gropu_delete table_id=0"
3436 AT_FAIL_IF([test X"$1" != X])
3438 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3442 s/ (xid=0x[0-9a-fA-F]*)//
3444 s/00:0.$/00:0x/' < monitor.log]],
3448 # It's a service connection so initially there should be no async messages.
3451 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3452 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
3453 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3455 # Become slave (OF 1.3), which should disable everything except port status.
3456 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
3457 check_async 3 OFPPR_ADD OFPPR_DELETE
3459 # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
3460 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005
3461 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
3463 # Set controller ID 123.
3464 ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
3465 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
3467 # Restore controller ID 0.
3468 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
3470 # Become master (OF 1.3).
3471 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
3472 check_async 6 OFPR_ACTION OFPPR_ADD
3474 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3478 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.4)])
3479 OVS_VSWITCHD_START([dnl
3480 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=10
3482 AT_CHECK([ovs-ofctl -O OpenFlow14 -P standard monitor br0 --detach --no-chdir --pidfile])
3484 printf '\n\n--- check_async %d ---\n\n\n' $1
3488 ovs-appctl -t ovs-ofctl ofctl/barrier
3489 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3492 # OFPT_PACKET_IN, OFPR_PACKET_OUT (controller_id=0)
3493 ovs-ofctl -O OpenFlow14 -v packet-out br0 none controller '0001020304050010203040501234'
3494 if test X"$1" = X"OFPR_PACKET_OUT"; then shift;
3495 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via packet_out) data_len=14 (unbuffered)
3496 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3499 # OFPT_PACKET_IN, OFPR_ACTION_SET (controller_id=0)
3500 ovs-ofctl -O OpenFlow14 add-flow br0 'in_port=10 actions=write_actions(output(CONTROLLER))'
3501 ovs-appctl netdev-dummy/receive p1 'in_port(10),eth(src=00:10:20:30:40:50,dst=00:01:02:03:04:05),eth_type(0x1234)'
3502 if test X"$1" = X"OFPR_ACTION_SET"; then shift;
3503 echo >>expout "OFPT_PACKET_IN (OF1.4): cookie=0x0 total_len=14 in_port=10 (via action_set) data_len=14 (unbuffered)
3504 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3507 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
3508 ovs-ofctl -O OpenFlow14 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
3509 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
3510 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
3511 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3514 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
3515 ovs-ofctl -O OpenFlow14 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
3516 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
3517 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
3518 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"
3521 # OFPT_PORT_STATUS, OFPPR_ADD
3522 ovs-vsctl add-port br0 test -- set Interface test type=dummy
3523 if test X"$1" = X"OFPPR_ADD"; then shift;
3524 echo >>expout "OFPT_PORT_STATUS (OF1.4): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3527 speed: 0 Mbps now, 0 Mbps max"
3530 # OFPT_PORT_STATUS, OFPPR_MODIFY
3531 ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 test up
3532 if test X"$1" = X"OFPPR_MODIFY"; then shift;
3533 echo >>expout "OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3536 speed: 0 Mbps now, 0 Mbps max
3537 OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3540 speed: 0 Mbps now, 0 Mbps max"
3543 # OFPT_PORT_STATUS, OFPPR_DELETE
3544 ovs-vsctl del-port br0 test
3545 if test X"$1" = X"OFPPR_DELETE"; then shift;
3546 echo >>expout "OFPT_PORT_STATUS (OF1.4): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3549 speed: 0 Mbps now, 0 Mbps max"
3552 # OFPT_FLOW_REMOVED, OFPRR_DELETE
3553 ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=drop
3554 ovs-ofctl -O OpenFlow14 --strict del-flows br0 ''
3555 if test X"$1" = X"OFPRR_DELETE"; then shift;
3556 echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=delete table_id=0"
3559 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
3560 ovs-ofctl -O OpenFlow14 add-group br0 group_id=1234,type=all,bucket=output:10
3561 ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=group:1234
3562 ovs-ofctl -O OpenFlow14 --strict del-groups br0 group_id=1234
3563 if test X"$1" = X"OFPRR_GROUP_DELETE"; then shift;
3564 echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=group_delete table_id=0"
3567 # OFPT_TABLE_STATUS, OFPTR_VACANCY_UP
3568 if test X"$1" = X"OFPTR_VACANCY_UP"; then shift;
3569 ovs-vsctl -- --id=@t1 create Flow_Table flow-limit=10 -- set bridge br0 flow_tables:1=@t1
3571 # Turn on vacancy events, then add flows until we're full.
3572 # With initial vacancy of 100% and vacancy_up of 80%, so that
3573 # vacancy >= vacancy_up, this enables VACANY_DOWN events, so
3574 # we get a single such message when vacancy dips below 20%.
3575 ovs-ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80
3576 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2
3577 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2
3578 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2
3579 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2
3580 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2
3581 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2
3582 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2
3583 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2
3584 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2
3585 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2
3586 echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_DOWN
3589 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
3590 vacancy=on vacancy_down=20% vacancy_up=80% vacancy=10%"
3591 # Then delete flows until we're empty. Sending the
3592 # VACANCY_DOWN message enabled VACANCY_UP events, so we get a
3593 # single such message when vacancy rises above 80%.
3594 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1
3595 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2
3596 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3
3597 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4
3598 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5
3599 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6
3600 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7
3601 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8
3602 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9
3603 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10
3604 echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_UP
3607 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
3608 vacancy=on vacancy_down=20% vacancy_up=80% vacancy=90%"
3610 # Now approach vacancy from the other direction. First
3611 # disable vacancy events. With initial vacancy of 70%, so
3612 # that vacancy < vacancy_up, this enables VACANCY_UP events.
3613 # That means that filling up the table generates no message,
3614 # but deleting all the flows generates VACANCY_UP at the point
3615 # vacancy rises above 80%.
3616 ovs-ofctl -O OpenFlow14 mod-table br0 1 novacancy
3617 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2
3618 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2
3619 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2
3620 ovs-ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80
3621 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2
3622 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2
3623 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2
3624 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2
3625 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2
3626 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2
3627 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2
3628 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1
3629 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2
3630 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3
3631 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4
3632 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5
3633 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6
3634 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7
3635 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8
3636 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9
3637 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10
3638 echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_UP
3641 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
3642 vacancy=on vacancy_down=20% vacancy_up=80% vacancy=90%"
3645 AT_FAIL_IF([test X"$1" != X])
3647 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3651 s/ (xid=0x[0-9a-fA-F]*)//
3653 s/00:0.$/00:0x/' < monitor.log]],
3657 # It's a service connection so initially there should be no async messages.
3660 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3661 ovs-appctl -t ovs-ofctl ofctl/send 0509000c0123456700000080
3662 check_async 2 OFPR_PACKET_OUT OFPR_ACTION_SET OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
3664 # Become slave (OF 1.4), which should disable everything except port status.
3665 ovs-appctl -t ovs-ofctl ofctl/send 051800180000000200000003000000000000000000000001
3666 check_async 3 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
3668 # Use OF 1.4 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
3669 ovs-appctl -t ovs-ofctl ofctl/send 051c0040000000020000000800000005000100080000002000020008000000020003000800000005000400080000001c00050008000000050008000800000018
3670 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE OFPTR_VACANCY_UP
3672 # Set controller ID 123.
3673 ovs-appctl -t ovs-ofctl ofctl/send 05040018000000030000232000000014000000000000007b
3674 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
3676 # Restore controller ID 0.
3677 ovs-appctl -t ovs-ofctl ofctl/send 050400180000000300002320000000140000000000000000
3679 # Become master (OF 1.4).
3680 ovs-appctl -t ovs-ofctl ofctl/send 051800180000000400000002000000000000000000000002
3681 check_async 6 OFPR_PACKET_OUT OFPPR_ADD OFPPR_MODIFY OFPRR_DELETE
3683 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3687 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.5)])
3689 AT_CHECK([ovs-ofctl -O OpenFlow15 -P standard monitor br0 --detach --no-chdir --pidfile])
3691 printf '\n\n--- check_async %d ---\n\n\n' $1
3695 ovs-appctl -t ovs-ofctl ofctl/barrier
3696 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3699 # Other tests are not working with OF 1.5, and message
3700 # format may change, so leave them out.
3702 # OFPT_PORT_STATUS, OFPPR_ADD
3703 ovs-vsctl add-port br0 test -- set Interface test type=dummy
3704 if test X"$1" = X"OFPPR_ADD"; then shift;
3705 echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3708 speed: 0 Mbps now, 0 Mbps max"
3711 # OFPT_PORT_STATUS, OFPPR_MODIFY
3712 ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test up
3713 if test X"$1" = X"OFPPR_MODIFY"; then shift;
3714 echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3717 speed: 0 Mbps now, 0 Mbps max
3718 OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x
3721 speed: 0 Mbps now, 0 Mbps max"
3724 # OFPT_PORT_STATUS, OFPPR_DELETE
3725 ovs-vsctl del-port br0 test
3726 if test X"$1" = X"OFPPR_DELETE"; then shift;
3727 echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3730 speed: 0 Mbps now, 0 Mbps max"
3733 AT_FAIL_IF([test X"$1" != X])
3735 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3739 s/ (xid=0x[0-9a-fA-F]*)//
3741 s/00:0.$/00:0x/' < monitor.log]],
3745 # It's a service connection so initially there should be no async messages.
3748 # If we don't set this, async messages are not received.
3749 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3750 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
3751 check_async 2 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
3753 # Set-async has changed in OF 1.4 and is not yet implemented.
3755 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3759 dnl This test checks that the role request/response messaging works
3760 dnl and that generation_id is handled properly.
3761 AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
3763 on_exit 'kill `cat c1.pid c2.pid`'
3765 # Start two ovs-ofctl controller processes.
3766 AT_CAPTURE_FILE([monitor1.log])
3767 AT_CAPTURE_FILE([expout1])
3768 AT_CAPTURE_FILE([experr1])
3769 AT_CAPTURE_FILE([monitor2.log])
3770 AT_CAPTURE_FILE([expout2])
3771 AT_CAPTURE_FILE([experr2])
3773 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=c$i.pid --unixctl=c$i])
3774 ovs-appctl -t `pwd`/c$i ofctl/barrier
3775 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
3779 # find out current role
3780 ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000
3781 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange"
3782 echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
3785 # controller 1: Become slave (generation_id is initially undefined, so
3786 # 2^63+2 should not be stale)
3787 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
3788 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
3789 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
3791 # controller 2: Become master.
3792 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
3793 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
3794 echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
3796 # controller 1: Try to become the master using a stale generation ID
3797 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
3798 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
3799 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
3800 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
3802 # controller 1: Become master using a valid generation ID
3803 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
3804 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
3805 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
3808 ovs-appctl -t `pwd`/c$i ofctl/barrier
3809 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):"
3815 AT_CHECK([grep -v '^send:' monitor$i.log | strip_xids], [0], [expout])
3817 AT_CHECK([grep '^send:' monitor$i.log | strip_xids], [0], [expout])
3822 dnl This test checks that the role request/response messaging works,
3823 dnl that generation_id is handled properly, and that role status update
3824 dnl messages are sent when a controller's role gets changed from master
3826 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
3828 on_exit 'kill `cat c1.pid c2.pid`'
3830 # Start two ovs-ofctl controller processes.
3831 AT_CAPTURE_FILE([monitor1.log])
3832 AT_CAPTURE_FILE([expout1])
3833 AT_CAPTURE_FILE([experr1])
3834 AT_CAPTURE_FILE([monitor2.log])
3835 AT_CAPTURE_FILE([expout2])
3836 AT_CAPTURE_FILE([experr2])
3838 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=c$i.pid --unixctl=c$i])
3839 ovs-appctl -t `pwd`/c$i ofctl/barrier
3840 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
3844 # find out current role
3845 ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000
3846 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange"
3847 echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
3850 # controller 1: Become slave (generation_id is initially undefined, so
3851 # 2^63+2 should not be stale)
3852 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
3853 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
3854 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
3856 # controller 2: Become master.
3857 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
3858 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
3859 echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
3861 # controller 1: Try to become the master using a stale generation ID
3862 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
3863 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
3864 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
3865 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
3867 # controller 1: Become master using a valid generation ID
3868 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
3869 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
3870 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
3871 echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
3874 ovs-appctl -t `pwd`/c$i ofctl/barrier
3875 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):"
3881 AT_CHECK([grep -v '^send:' monitor$i.log | strip_xids], [0], [expout])
3883 AT_CHECK([grep '^send:' monitor$i.log | strip_xids], [0], [expout])
3888 dnl This test checks the Group and meter notifications when a group mod
3889 dnl command is sent from one controller and the reply is received by
3890 dnl other controllers.
3891 AT_SETUP([ofproto - requestforward (OpenFlow 1.4)])
3893 on_exit 'kill `cat c1.pid c2.pid c3.pid`'
3895 # Start two ovs-ofctl controller processes.
3896 AT_CAPTURE_FILE([monitor1.log])
3897 AT_CAPTURE_FILE([expout1])
3898 AT_CAPTURE_FILE([monitor2.log])
3899 AT_CAPTURE_FILE([expout2])
3900 AT_CAPTURE_FILE([monitor3.log])
3901 AT_CAPTURE_FILE([expout3])
3903 ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile=c1.pid --unixctl=c1
3904 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=c2.pid --unixctl=c2
3905 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=c3.pid --unixctl=c3
3909 ovs-appctl -t `pwd`/c$i ofctl/barrier
3910 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
3914 printf '\n\n--- check_async %d ---\n\n\n' $1
3919 ovs-appctl -t `pwd`/c2 ofctl/send "050f0020000000020000000000000001 00100000 ffffffffffffffff 00000000"
3920 if test X"$1" = X"OFPGC_ADD"; then shift;
3921 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
3922 ADD group_id=1,type=all,bucket=actions=drop"
3923 echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
3924 ADD group_id=1,type=all,bucket=bucket_id:0,actions=drop"
3925 echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
3926 ADD group_id=1,type=all,bucket=actions=drop"
3930 ovs-appctl -t `pwd`/c2 ofctl/send "050f0020000000020001010000000001 00100000 ffffffffffffffff 00000000"
3931 if test X"$1" = X"OFPGC_MODIFY"; then shift;
3932 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
3933 MOD group_id=1,type=select,bucket=weight:0,actions=drop"
3934 echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
3935 MOD group_id=1,type=select,bucket=bucket_id:0,weight:0,actions=drop"
3936 echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
3937 MOD group_id=1,type=select,bucket=weight:0,actions=drop"
3940 ovs-appctl -t `pwd`/c1 ofctl/barrier
3941 echo >>expout1 "OFPT_BARRIER_REPLY (OF1.5):"
3942 ovs-appctl -t `pwd`/c2 ofctl/barrier
3943 echo >>expout2 "OFPT_BARRIER_REPLY (OF1.4):"
3944 ovs-appctl -t `pwd`/c3 ofctl/barrier
3945 echo >>expout3 "OFPT_BARRIER_REPLY (OF1.4):"
3952 s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
3957 # controller 1: Become slave
3958 ovs-appctl -t `pwd`/c1 ofctl/send 061800180000000300000003000000008000000000000002
3960 # controller 2: Become master
3961 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
3963 # controller 1: Become slave
3964 ovs-appctl -t `pwd`/c3 ofctl/send 051800180000000300000003000000008000000000000004
3966 # controller 1: Enabled requestforward using set Asynchronous message
3967 ovs-appctl -t `pwd`/c1 ofctl/send 061c00280000000200000008000000050002000800000002000400080000001a000a000800000003
3969 # controller 2: Enabled requestforward using set Asynchronous message
3970 ovs-appctl -t `pwd`/c2 ofctl/send 051c002800000002000100080000000200030008000000050005000800000005000b000800000003
3972 # controller 1: Enabled requestforward using set Asynchronous message
3973 ovs-appctl -t `pwd`/c3 ofctl/send 051c00280000000200000008000000050002000800000002000400080000001a000a000800000003
3974 check_async 1 OFPGC_ADD OFPGC_MODIFY
3979 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
3980 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
3981 dnl controllers despite the spec) as meaning a packet that was generated
3982 dnl by the controller.
3983 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
3987 # Start a monitor listening for packet-ins.
3988 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
3989 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
3990 ovs-appctl -t ovs-ofctl ofctl/barrier
3991 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3992 AT_CAPTURE_FILE([monitor.log])
3994 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
3995 AT_CHECK([ovs-ofctl packet-out br0 "in_port=none packet=0001020304050010203040501234 actions=controller,1"])
3996 AT_CHECK([ovs-ofctl packet-out br0 "in_port=controller packet=0001020304050010203040505678 actions=controller,1"])
3998 # Stop the monitor and check its output.
3999 ovs-appctl -t ovs-ofctl ofctl/barrier
4000 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4002 ovs-ofctl dump-ports br0
4004 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4005 OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
4006 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4007 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4008 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
4015 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
4016 dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
4017 dnl controllers despite the spec) as meaning a packet that was generated
4018 dnl by the controller.
4019 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
4022 # Start a monitor listening for packet-ins.
4023 AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile])
4024 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
4025 ovs-appctl -t ovs-ofctl ofctl/barrier
4026 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4027 AT_CAPTURE_FILE([monitor.log])
4029 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
4030 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
4031 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
4033 # Stop the monitor and check its output.
4034 ovs-appctl -t ovs-ofctl ofctl/barrier
4035 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4037 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4038 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
4039 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4040 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4041 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
4042 OFPT_BARRIER_REPLY (OF1.2):
4048 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
4049 dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some
4050 dnl controllers despite the spec) as meaning a packet that was generated
4051 dnl by the controller.
4052 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)])
4055 # Start a monitor listening for packet-ins.
4056 AT_CHECK([ovs-ofctl -O OpenFlow11 -P standard monitor br0 --detach --no-chdir --pidfile])
4057 ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080
4058 ovs-appctl -t ovs-ofctl ofctl/barrier
4059 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4060 AT_CAPTURE_FILE([monitor.log])
4062 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER as in_port.
4063 AT_CHECK([ovs-appctl -t ovs-ofctl ofctl/packet-out "in_port=none, packet=0001020304050010203040501234 actions=controller"])
4064 AT_CHECK([ovs-appctl -t ovs-ofctl ofctl/packet-out "in_port=controller packet=0001020304050010203040505678 actions=controller"])
4066 # Stop the monitor and check its output.
4067 ovs-appctl -t ovs-ofctl ofctl/barrier
4068 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4070 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//
4071 /PACKET_OUT/d' monitor.log], [0], [dnl
4072 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
4073 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4074 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4075 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
4076 OFPT_BARRIER_REPLY (OF1.1):
4082 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.5)])
4085 # Start a monitor listening for packet-ins.
4086 AT_CHECK([ovs-ofctl -O OpenFlow15 -P standard monitor br0 --detach --no-chdir --pidfile])
4087 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
4088 ovs-appctl -t ovs-ofctl ofctl/barrier
4089 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4090 AT_CAPTURE_FILE([monitor.log])
4092 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
4093 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=none tun_id=0x11 metadata=0x22 packet=0001020304050010203040501234 actions=controller"])
4094 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=controller tun_id=0x11 metadata=0x33 packet=0001020304050010203040505678 actions=controller"])
4096 # Stop the monitor and check its output.
4097 ovs-appctl -t ovs-ofctl ofctl/barrier
4098 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4100 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4101 OFPT_PACKET_IN (OF1.5): total_len=14 tun_id=0x11,metadata=0x22,in_port=ANY (via packet_out) data_len=14 (unbuffered)
4102 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4103 OFPT_PACKET_IN (OF1.5): total_len=14 tun_id=0x11,metadata=0x33,in_port=CONTROLLER (via packet_out) data_len=14 (unbuffered)
4104 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
4105 OFPT_BARRIER_REPLY (OF1.5):
4111 dnl This test checks that metadata and userdata are encoded in NXT_PACKET_IN2.
4112 AT_SETUP([ofproto - packet-out with metadata and userdata (NXT_PACKET_IN2)])
4115 # Start a monitor listening for packet-ins.
4116 AT_CHECK([ovs-ofctl -P nxt_packet_in2 monitor br0 --detach --no-chdir --pidfile])
4117 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
4118 ovs-appctl -t ovs-ofctl ofctl/barrier
4119 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4120 AT_CAPTURE_FILE([monitor.log])
4122 # Send a packet-out with a load action to set some metadata, and forward to controller
4123 AT_CHECK([ovs-ofctl packet-out br0 "in_port=controller packet=0001020304050010203040501234 actions=load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]),load(0xaa->NXM_NX_PKT_MARK[[]]),controller(userdata=01.02.03.04.05)"])
4125 # Stop the monitor and check its output.
4126 ovs-appctl -t ovs-ofctl ofctl/barrier
4127 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4129 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4130 NXT_PACKET_IN2: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4131 userdata=01.02.03.04.05
4132 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4139 dnl This test checks that metadata is encoded in packet_in structures,
4140 dnl supported by NXAST.
4141 AT_SETUP([ofproto - packet-out with metadata (NXM)])
4144 # Start a monitor listening for packet-ins.
4145 AT_CHECK([ovs-ofctl -P nxt_packet_in monitor br0 --detach --no-chdir --pidfile])
4146 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
4147 ovs-appctl -t ovs-ofctl ofctl/barrier
4148 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4149 AT_CAPTURE_FILE([monitor.log])
4151 # Send a packet-out with a load action to set some metadata, and forward to controller
4152 AT_CHECK([ovs-ofctl packet-out br0 "in_port=controller packet=0001020304050010203040501234 actions=load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]),load(0xaa->NXM_NX_PKT_MARK[[]]),controller"])
4154 # Stop the monitor and check its output.
4155 ovs-appctl -t ovs-ofctl ofctl/barrier
4156 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4158 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4159 NXT_PACKET_IN: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4160 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4167 dnl This test checks that metadata is encoded in packet_in structures,
4168 dnl supported by NXAST.
4169 AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
4172 # Start a monitor listening for packet-ins.
4173 AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile])
4174 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
4175 ovs-appctl -t ovs-ofctl ofctl/barrier
4176 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4177 AT_CAPTURE_FILE([monitor.log])
4179 # Send a packet-out with a set-field action to set some metadata, and forward to controller
4180 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234'])
4182 # Stop the monitor and check its output.
4183 ovs-appctl -t ovs-ofctl ofctl/barrier
4184 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4186 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4187 OFPT_PACKET_IN (OF1.2): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=ANY (via action) data_len=14 (unbuffered)
4188 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4189 OFPT_BARRIER_REPLY (OF1.2):
4195 dnl This test checks that metadata is encoded in packet_in structures,
4196 dnl supported by NXAST.
4197 AT_SETUP([ofproto - packet-out with metadata and dual set_field (OpenFlow 1.3)])
4200 # Start a monitor listening for packet-ins.
4201 AT_CHECK([ovs-ofctl -O OpenFlow13 -P standard monitor br0 --detach --no-chdir --pidfile])
4202 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
4203 ovs-appctl -t ovs-ofctl ofctl/barrier
4204 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4205 AT_CAPTURE_FILE([monitor.log])
4207 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
4208 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, set_field:0x6b->metadata, controller' '0001020304050010203040501234'])
4210 # Stop the monitor and check its output.
4211 ovs-appctl -t ovs-ofctl ofctl/barrier
4212 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4214 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4215 OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0x6b,in_port=ANY (via action) data_len=14 (unbuffered)
4216 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4217 OFPT_BARRIER_REPLY (OF1.3):
4223 dnl This test checks that tunnel metadata is encoded in packet_in structures.
4224 AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
4227 # Start a monitor listening for packet-ins.
4228 AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile])
4229 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
4230 ovs-appctl -t ovs-ofctl ofctl/barrier
4231 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4232 AT_CAPTURE_FILE([monitor.log])
4234 # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
4235 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'])
4237 # Stop the monitor and check its output.
4238 ovs-appctl -t ovs-ofctl ofctl/barrier
4239 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4241 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4242 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)
4243 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4244 OFPT_BARRIER_REPLY (OF1.2):
4250 m4_divert_push([PREPARE_TESTS])
4251 # Sorts groups of lines that start with a space, without moving them
4252 # past the nearest line that does not start with a space.
4262 print $_ foreach sort(@buffer);
4267 print $_ foreach sort(@buffer);
4270 m4_divert_pop([PREPARE_TESTS])
4272 AT_SETUP([ofproto - flow monitoring])
4273 AT_KEYWORDS([monitor])
4276 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
4278 # Start a monitor watching the flow table and check the initial reply.
4279 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
4280 AT_CAPTURE_FILE([monitor.log])
4281 ovs-appctl -t ovs-ofctl ofctl/barrier
4282 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4283 [NXST_FLOW_MONITOR reply:
4284 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
4288 # Add, delete, and modify some flows and check the updates.
4289 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4290 ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
4291 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
4292 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
4293 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
4294 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
4295 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
4296 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
4297 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
4298 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
4299 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
4300 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
4301 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
4302 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
4303 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
4304 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
4305 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
4306 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
4307 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
4308 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
4309 ovs-ofctl add-flow br0 in_port=0,actions=output:23
4310 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
4311 ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
4312 ovs-ofctl del-flows br0 dl_vlan=123
4313 ovs-ofctl del-flows br0
4314 ovs-appctl -t ovs-ofctl ofctl/barrier
4315 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
4316 [NXST_FLOW_MONITOR reply (xid=0x0):
4317 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
4318 NXST_FLOW_MONITOR reply (xid=0x0):
4319 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
4320 NXST_FLOW_MONITOR reply (xid=0x0):
4321 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
4322 NXST_FLOW_MONITOR reply (xid=0x0):
4323 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
4324 NXST_FLOW_MONITOR reply (xid=0x0):
4325 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
4326 NXST_FLOW_MONITOR reply (xid=0x0):
4327 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
4328 NXST_FLOW_MONITOR reply (xid=0x0):
4329 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
4330 NXST_FLOW_MONITOR reply (xid=0x0):
4331 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
4332 NXST_FLOW_MONITOR reply (xid=0x0):
4333 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
4334 NXST_FLOW_MONITOR reply (xid=0x0):
4335 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
4336 NXST_FLOW_MONITOR reply (xid=0x0):
4337 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
4338 NXST_FLOW_MONITOR reply (xid=0x0):
4339 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
4340 NXST_FLOW_MONITOR reply (xid=0x0):
4341 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
4342 NXST_FLOW_MONITOR reply (xid=0x0):
4343 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
4344 NXST_FLOW_MONITOR reply (xid=0x0):
4345 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
4346 NXST_FLOW_MONITOR reply (xid=0x0):
4347 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
4348 NXST_FLOW_MONITOR reply (xid=0x0):
4349 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
4350 NXST_FLOW_MONITOR reply (xid=0x0):
4351 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
4352 NXST_FLOW_MONITOR reply (xid=0x0):
4353 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
4354 NXST_FLOW_MONITOR reply (xid=0x0):
4355 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
4356 NXST_FLOW_MONITOR reply (xid=0x0):
4357 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
4358 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
4359 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
4360 NXST_FLOW_MONITOR reply (xid=0x0):
4361 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
4362 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
4363 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
4364 NXST_FLOW_MONITOR reply (xid=0x0):
4365 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
4366 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
4367 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
4368 NXST_FLOW_MONITOR reply (xid=0x0):
4369 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
4370 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
4371 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
4372 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
4373 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
4374 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
4375 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
4376 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
4377 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
4378 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
4379 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
4383 # Check that our own changes are reported as full updates.
4384 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4385 ovs-ofctl add-flow br0 in_port=1,actions=output:2
4386 ovs-ofctl add-flow br0 in_port=2,actions=output:1
4387 ovs-appctl -t ovs-ofctl ofctl/barrier
4388 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
4389 ovs-appctl -t ovs-ofctl ofctl/barrier
4390 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
4392 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
4393 [NXST_FLOW_MONITOR reply (xid=0x0):
4394 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
4395 NXST_FLOW_MONITOR reply (xid=0x0):
4396 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
4398 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
4399 NXST_FLOW_MONITOR reply (xid=0x0):
4400 event=DELETED reason=delete table=0 cookie=0 in_port=1 actions=output:2
4401 event=DELETED reason=delete table=0 cookie=0 in_port=2 actions=output:1
4405 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4409 AT_SETUP([ofproto - flow monitoring with !own])
4410 AT_KEYWORDS([monitor])
4413 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
4415 # Start a monitor watching the flow table and check the initial reply.
4416 ovs-ofctl monitor br0 watch:\!own --detach --no-chdir --pidfile >monitor.log 2>&1
4417 AT_CAPTURE_FILE([monitor.log])
4418 ovs-appctl -t ovs-ofctl ofctl/barrier
4419 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4420 [NXST_FLOW_MONITOR reply:
4421 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
4425 # Check that our own changes are reported as abbreviations.
4426 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4427 ovs-ofctl add-flow br0 in_port=1,actions=output:2
4428 ovs-ofctl add-flow br0 in_port=2,actions=output:1
4429 ovs-appctl -t ovs-ofctl ofctl/barrier
4430 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
4431 ovs-appctl -t ovs-ofctl ofctl/barrier
4432 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
4434 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4435 [NXST_FLOW_MONITOR reply (xid=0x0):
4436 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
4437 NXST_FLOW_MONITOR reply (xid=0x0):
4438 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
4440 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
4441 NXST_FLOW_MONITOR reply (xid=0x0):
4442 event=ABBREV xid=0x12345678
4446 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4450 AT_SETUP([ofproto - flow monitoring with out_port])
4451 AT_KEYWORDS([monitor])
4454 ovs-ofctl add-flow br0 in_port=0,dl_vlan=121,actions=output:1
4455 ovs-ofctl add-flow br0 in_port=0,dl_vlan=122,actions=output:1
4456 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:2
4458 # Start a monitor watching the flow table and check the initial reply.
4459 ovs-ofctl monitor br0 watch:out_port=2 --detach --no-chdir --pidfile >monitor.log 2>&1
4460 AT_CAPTURE_FILE([monitor.log])
4461 ovs-appctl -t ovs-ofctl ofctl/barrier
4462 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4463 [NXST_FLOW_MONITOR reply:
4464 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
4468 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4470 # Add, modify flows and check the updates.
4471 ovs-ofctl mod-flows br0 dl_vlan=121,actions=drop
4472 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1,output:2
4473 ovs-appctl -t ovs-ofctl ofctl/barrier
4475 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:1,output:2
4476 ovs-appctl -t ovs-ofctl ofctl/barrier
4478 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1
4479 ovs-appctl -t ovs-ofctl ofctl/barrier
4480 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:2
4481 ovs-appctl -t ovs-ofctl ofctl/barrier
4483 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4484 [NXST_FLOW_MONITOR reply (xid=0x0):
4485 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1,output:2
4487 NXST_FLOW_MONITOR reply (xid=0x0):
4488 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1,output:2
4490 NXST_FLOW_MONITOR reply (xid=0x0):
4491 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1
4493 NXST_FLOW_MONITOR reply (xid=0x0):
4494 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
4498 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4502 AT_SETUP([ofproto - flow monitoring pause and resume])
4503 AT_KEYWORDS([monitor])
4505 # The maximum socket receive buffer size is important for this test, which
4506 # tests behavior when the receive buffer overflows.
4507 if test -e /proc/sys/net/core/rmem_max; then
4509 rmem_max=`cat /proc/sys/net/core/rmem_max`
4510 elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
4513 # Don't know how to get maximum socket receive buffer on this OS
4516 # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
4517 # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
4518 queue_size=`expr $rmem_max + 128 \* 1024`
4519 echo rmem_max=$rmem_max queue_size=$queue_size
4521 # If there's too much queuing skip the test to avoid timing out.
4522 AT_SKIP_IF([test $rmem_max -gt 1048576])
4524 # Each flow update message takes up at least 48 bytes of space in queues
4525 # and in practice more than that.
4526 n_msgs=`expr $queue_size / 48`
4531 # Start a monitor watching the flow table, then make it block.
4532 on_exit 'kill `cat ovs-ofctl.pid`'
4533 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
4534 AT_CAPTURE_FILE([monitor.log])
4535 ovs-appctl -t ovs-ofctl ofctl/block
4537 # Add $n_msgs flows.
4538 (echo "in_port=2,actions=output:2"
4540 for ($i = 0; $i < '$n_msgs'; $i++) {
4541 print "cookie=1,reg1=$i,actions=drop\n";
4544 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4545 # Check that multipart flow dumps work properly:
4546 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
4547 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
4548 AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
4549 AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
4551 ovs-appctl -t ovs-ofctl ofctl/unblock
4553 # Wait for the connection resumed.
4554 # A barrier doesn't work for this purpose.
4555 # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html
4556 # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html
4557 OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log])
4559 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4561 # Check that the flow monitor reported the same number of flows
4562 # added and deleted, but fewer than we actually added and deleted.
4563 adds=`grep -c 'ADDED.*reg1=' monitor.log`
4564 deletes=`grep -c 'DELETED.*reg1=' monitor.log`
4565 echo adds=$adds deletes=$deletes
4566 AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
4567 AT_CHECK([test $adds = $deletes])
4569 # Check that the flow monitor reported everything in the expected order:
4571 # event=ADDED table=0 cookie=0x1 reg1=0x22
4573 # NXT_FLOW_MONITOR_PAUSED:
4575 # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
4577 # event=ADDED table=0 cookie=0x3 in_port=1
4578 # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
4579 # NXT_FLOW_MONITOR_RESUMED:
4581 # except that, between the PAUSED and RESUMED, the order of the ADDED
4582 # and MODIFIED lines lines depends on hash order, that is, it varies
4583 # as we change the hash function or change architecture. Therefore,
4584 # we use a couple of tests below to accept both orders.
4585 AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
4588 /NXT_FLOW_MONITOR_PAUSED:/p
4589 /NXT_FLOW_MONITOR_RESUMED:/p
4590 ' > monitor.log.subset])
4591 AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
4592 event=ADDED table=0 cookie=0x1 reg1=0x22
4593 NXT_FLOW_MONITOR_PAUSED:
4594 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
4595 event=ADDED table=0 cookie=0x3 in_port=1
4596 NXT_FLOW_MONITOR_RESUMED:
4598 AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
4599 NXT_FLOW_MONITOR_PAUSED:
4600 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
4601 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
4602 NXT_FLOW_MONITOR_RESUMED:
4608 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
4609 AT_KEYWORDS([monitor])
4612 # Start a monitor, use the required protocol version
4613 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
4614 AT_CAPTURE_FILE([monitor.log])
4616 # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a)
4617 ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a
4618 ovs-appctl -t ovs-ofctl ofctl/barrier
4620 # Check default setting
4621 read -r -d '' expected <<'EOF'
4624 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
4625 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
4626 OFPT_GET_ASYNC_REPLY (OF1.3):
4628 PACKET_IN: no_match action
4629 PORT_STATUS: add delete modify
4630 FLOW_REMOVED: idle hard delete
4633 REQUESTFORWARD: (off)
4637 PORT_STATUS: add delete modify
4641 REQUESTFORWARD: (off)
4642 OFPT_BARRIER_REPLY (OF1.3):
4648 AT_SETUP([ofproto - ofport_request])
4650 add_of_ports br0 1 2 3
4652 set_and_check_specific_ofports () {
4653 ovs-vsctl set Interface p1 ofport_request="$1" -- \
4654 set Interface p2 ofport_request="$2" -- \
4655 set Interface p3 ofport_request="$3"
4656 ofports=`ovs-vsctl get Interface p1 ofport -- \
4657 get Interface p2 ofport -- \
4658 get Interface p3 ofport`
4659 AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
4662 for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
4663 for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
4664 echo -----------------------------------------------------------
4665 echo "Check changing port numbers from $pre to $post"
4666 set_and_check_specific_ofports $pre
4667 set_and_check_specific_ofports $post
4671 ovs-vsctl del-port p3
4673 set_and_check_poorly_specified_ofports () {
4674 ovs-vsctl set Interface p1 ofport_request="$1" -- \
4675 set Interface p2 ofport_request="$2"
4676 p1=`ovs-vsctl get Interface p1 ofport`
4677 p2=`ovs-vsctl get Interface p2 ofport`
4680 AT_CHECK([test "$p1" != "$p2"])
4681 if test "$1" = "$2" && test "$1" != '[[]]'; then
4682 # One port number must be the requested one.
4683 AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
4684 # The other port number must be different (already tested above).
4686 AT_CHECK([test "$1" = '[[]]' || test "$p1" = "$1"])
4687 AT_CHECK([test "$2" = '[[]]' || test "$p2" = "$2"])
4690 for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
4692 for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
4694 echo -----------------------------------------------------------
4695 echo "Check changing port numbers from $pre to $post"
4696 set_and_check_poorly_specified_ofports $pre
4697 set_and_check_poorly_specified_ofports $post
4704 AT_SETUP([ofproto - bundle open (OpenFlow 1.4)])
4705 AT_KEYWORDS([monitor])
4708 # Start a monitor, use the required protocol version
4709 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
4710 AT_CAPTURE_FILE([monitor.log])
4712 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
4713 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
4714 ovs-appctl -t ovs-ofctl ofctl/barrier
4715 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4717 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
4718 send: OFPT_BUNDLE_CONTROL (OF1.4):
4719 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
4720 OFPT_BUNDLE_CONTROL (OF1.4):
4721 bundle_id=0x1 type=OPEN_REPLY flags=0
4722 OFPT_BARRIER_REPLY (OF1.4):
4728 AT_SETUP([ofproto - bundle double open (OpenFlow 1.4)])
4729 AT_KEYWORDS([monitor])
4732 # Start a monitor, use the required protocol version
4733 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
4734 AT_CAPTURE_FILE([monitor.log])
4736 # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
4737 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
4738 ovs-appctl -t ovs-ofctl ofctl/barrier
4739 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
4740 ovs-appctl -t ovs-ofctl ofctl/barrier
4741 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4743 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
4744 send: OFPT_BUNDLE_CONTROL (OF1.4):
4745 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
4746 OFPT_BUNDLE_CONTROL (OF1.4):
4747 bundle_id=0x1 type=OPEN_REPLY flags=0
4748 OFPT_BARRIER_REPLY (OF1.4):
4749 send: OFPT_BUNDLE_CONTROL (OF1.4):
4750 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
4751 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
4752 OFPT_BUNDLE_CONTROL (OF1.4):
4753 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
4754 OFPT_BARRIER_REPLY (OF1.4):
4760 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)])
4761 AT_KEYWORDS([monitor])
4764 # Start a monitor, use the required protocol version
4765 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
4766 AT_CAPTURE_FILE([monitor.log])
4768 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
4769 ovs-appctl -t ovs-ofctl ofctl/barrier
4770 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4772 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
4773 send: OFPT_BUNDLE_CONTROL (OF1.4):
4774 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
4775 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
4776 OFPT_BUNDLE_CONTROL (OF1.4):
4777 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
4778 OFPT_BARRIER_REPLY (OF1.4):
4784 AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)])
4785 AT_KEYWORDS([monitor])
4788 # Start a monitor, use the required protocol version
4789 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
4790 AT_CAPTURE_FILE([monitor.log])
4792 # Open, Close, Close
4793 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
4794 ovs-appctl -t ovs-ofctl ofctl/barrier
4795 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
4796 ovs-appctl -t ovs-ofctl ofctl/barrier
4797 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
4798 ovs-appctl -t ovs-ofctl ofctl/barrier
4799 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4801 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
4802 send: OFPT_BUNDLE_CONTROL (OF1.4):
4803 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
4804 OFPT_BUNDLE_CONTROL (OF1.4):
4805 bundle_id=0x1 type=OPEN_REPLY flags=0
4806 OFPT_BARRIER_REPLY (OF1.4):
4807 send: OFPT_BUNDLE_CONTROL (OF1.4):
4808 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
4809 OFPT_BUNDLE_CONTROL (OF1.4):
4810 bundle_id=0x1 type=CLOSE_REPLY flags=0
4811 OFPT_BARRIER_REPLY (OF1.4):
4812 send: OFPT_BUNDLE_CONTROL (OF1.4):
4813 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
4814 OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED
4815 OFPT_BUNDLE_CONTROL (OF1.4):
4816 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
4817 OFPT_BARRIER_REPLY (OF1.4):
4823 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)])
4824 AT_KEYWORDS([monitor])
4827 # Start a monitor, use the required protocol version
4828 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
4829 AT_CAPTURE_FILE([monitor.log])
4832 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
4833 ovs-appctl -t ovs-ofctl ofctl/barrier
4834 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
4835 ovs-appctl -t ovs-ofctl ofctl/barrier
4836 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4838 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
4839 send: OFPT_BUNDLE_CONTROL (OF1.4):
4840 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
4841 OFPT_BUNDLE_CONTROL (OF1.4):
4842 bundle_id=0x1 type=OPEN_REPLY flags=0
4843 OFPT_BARRIER_REPLY (OF1.4):
4844 send: OFPT_BUNDLE_CONTROL (OF1.4):
4845 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
4846 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
4847 OFPT_BUNDLE_CONTROL (OF1.4):
4848 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
4849 OFPT_BARRIER_REPLY (OF1.4):
4855 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)])
4856 AT_KEYWORDS([monitor])
4859 # Start a monitor, use the required protocol version
4860 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
4861 AT_CAPTURE_FILE([monitor.log])
4864 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02"
4865 ovs-appctl -t ovs-ofctl ofctl/barrier
4866 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4868 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
4869 send: OFPT_BUNDLE_CONTROL (OF1.4):
4870 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
4871 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
4872 OFPT_BUNDLE_CONTROL (OF1.4):
4873 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
4874 OFPT_BARRIER_REPLY (OF1.4):
4880 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)])
4881 AT_KEYWORDS([monitor])
4884 # Start a monitor, use the required protocol version
4885 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
4886 AT_CAPTURE_FILE([monitor.log])
4889 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
4890 ovs-appctl -t ovs-ofctl ofctl/barrier
4891 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01"
4892 ovs-appctl -t ovs-ofctl ofctl/barrier
4893 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4895 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
4896 send: OFPT_BUNDLE_CONTROL (OF1.4):
4897 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
4898 OFPT_BUNDLE_CONTROL (OF1.4):
4899 bundle_id=0x1 type=OPEN_REPLY flags=0
4900 OFPT_BARRIER_REPLY (OF1.4):
4901 send: OFPT_BUNDLE_CONTROL (OF1.4):
4902 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
4903 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
4904 OFPT_BUNDLE_CONTROL (OF1.4):
4905 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
4906 OFPT_BARRIER_REPLY (OF1.4):
4912 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)])
4913 AT_KEYWORDS([monitor])
4916 # Start a monitor, use the required protocol version
4917 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
4918 AT_CAPTURE_FILE([monitor.log])
4921 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 02"
4922 ovs-appctl -t ovs-ofctl ofctl/barrier
4923 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4925 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
4926 send: OFPT_BUNDLE_CONTROL (OF1.4):
4927 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
4928 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
4929 OFPT_BUNDLE_CONTROL (OF1.4):
4930 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
4931 OFPT_BARRIER_REPLY (OF1.4):
4938 AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.4)])
4941 AT_CHECK([ovs-appctl vlog/set vconn:dbg])
4943 AT_CHECK([ovs-ofctl --no-names del-flows br0])
4945 AT_DATA([flows.txt], [dnl
4946 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
4947 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
4948 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
4949 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
4951 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
4952 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
4953 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
4954 delete in_port=2 dl_src=00:88:99:aa:bb:cc
4957 AT_CHECK([ovs-ofctl --no-names --bundle add-flows br0 flows.txt])
4959 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
4960 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
4961 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
4965 AT_DATA([flows.txt], [dnl
4967 modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7
4970 AT_CHECK([ovs-ofctl --no-names --bundle add-flows br0 flows.txt])
4972 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
4973 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4974 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
4978 # Adding an existing flow acts as a modify, and delete_strict also works.
4979 AT_DATA([flows.txt], [dnl
4980 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8
4981 delete_strict in_port=2 dl_src=00:66:77:88:99:aa
4982 add in_port=2 dl_src=00:66:77:88:99:aa actions=drop
4985 AT_CHECK([ovs-ofctl --no-names --bundle add-flows br0 flows.txt])
4987 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
4988 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
4989 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4993 dnl Check logs for OpenFlow trace
4995 OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3])
4996 AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl
4997 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
4998 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
4999 vconn|DBG|unix: received: OFPT_HELLO:
5000 version bitmap: 0x01
5001 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
5002 vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop
5003 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5004 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5005 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5006 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5007 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
5008 version bitmap: 0x05
5009 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x07 and earlier, peer supports version 0x05)
5010 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5011 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
5012 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5013 bundle_id=0 type=OPEN_REPLY flags=0
5014 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5015 bundle_id=0 flags=atomic ordered
5016 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1
5017 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5018 bundle_id=0 flags=atomic ordered
5019 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2
5020 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5021 bundle_id=0 flags=atomic ordered
5022 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3
5023 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5024 bundle_id=0 flags=atomic ordered
5025 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:4
5026 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5027 bundle_id=0 flags=atomic ordered
5028 OFPT_FLOW_MOD (OF1.4): DEL table:255 actions=drop
5029 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5030 bundle_id=0 flags=atomic ordered
5031 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:5
5032 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5033 bundle_id=0 flags=atomic ordered
5034 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:6
5035 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5036 bundle_id=0 flags=atomic ordered
5037 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7
5038 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5039 bundle_id=0 flags=atomic ordered
5040 OFPT_FLOW_MOD (OF1.4): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
5041 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
5042 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
5043 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5044 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5045 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5046 bundle_id=0 type=COMMIT_REPLY flags=0
5047 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5048 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5049 vconn|DBG|unix: received: OFPT_HELLO:
5050 version bitmap: 0x01
5051 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
5052 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
5053 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5054 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5055 vconn|DBG|unix: received: NXST_FLOW request:
5056 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
5057 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
5058 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
5059 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5060 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5061 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
5062 version bitmap: 0x05
5063 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x07 and earlier, peer supports version 0x05)
5064 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5065 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
5066 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5067 bundle_id=0 type=OPEN_REPLY flags=0
5068 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5069 bundle_id=0 flags=atomic ordered
5070 OFPT_FLOW_MOD (OF1.4): MOD actions=drop
5071 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5072 bundle_id=0 flags=atomic ordered
5073 OFPT_FLOW_MOD (OF1.4): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
5074 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
5075 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
5076 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5077 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5078 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5079 bundle_id=0 type=COMMIT_REPLY flags=0
5080 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5081 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5082 vconn|DBG|unix: received: OFPT_HELLO:
5083 version bitmap: 0x01
5084 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
5085 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
5086 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5087 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5088 vconn|DBG|unix: received: NXST_FLOW request:
5089 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
5090 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5091 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
5092 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5093 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5094 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
5095 version bitmap: 0x05
5096 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x07 and earlier, peer supports version 0x05)
5097 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5098 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
5099 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5100 bundle_id=0 type=OPEN_REPLY flags=0
5101 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5102 bundle_id=0 flags=atomic ordered
5103 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8
5104 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5105 bundle_id=0 flags=atomic ordered
5106 OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5107 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5108 bundle_id=0 flags=atomic ordered
5109 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5110 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
5111 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
5112 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5113 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5114 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5115 bundle_id=0 type=COMMIT_REPLY flags=0
5116 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5117 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5118 vconn|DBG|unix: received: OFPT_HELLO:
5119 version bitmap: 0x01
5120 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
5121 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
5122 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5123 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5124 vconn|DBG|unix: received: NXST_FLOW request:
5125 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
5126 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
5127 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5130 AT_CHECK([grep " flow_mods in the last " ovs-vswitchd.log | sed -e 's/^.*connmgr|INFO|//'], [0], [dnl
5131 br0<->unix: 1 flow_mods in the last 0 s (1 deletes)
5132 br0<->unix: 9 flow_mods in the last 0 s (7 adds, 2 deletes)
5133 br0<->unix: 2 flow_mods in the last 0 s (2 modifications)
5134 br0<->unix: 3 flow_mods in the last 0 s (2 adds, 1 deletes)
5141 AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.4)])
5144 AT_CHECK([ovs-ofctl del-flows br0])
5146 ovs-ofctl add-flows br0 - <<EOF
5147 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=11
5148 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=22
5149 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=33
5151 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5152 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
5153 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
5154 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
5158 # last line uses illegal table number (OVS internal table)
5159 AT_DATA([flows.txt], [dnl
5160 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
5161 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
5162 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
5163 modify idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
5165 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
5166 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
5167 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
5168 delete in_port=2 dl_src=00:88:99:aa:bb:cc
5169 add table=254 actions=drop
5172 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt 2>&1 | sed '/talking to/,$d' | strip_xids],
5174 Error OFPBRC_EPERM for: OFPT_FLOW_MOD (OF1.4): ADD table:254 actions=drop
5177 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5178 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
5179 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
5180 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
5188 AT_SETUP([ofproto - bundle timeout (OpenFlow 1.4)])
5189 AT_KEYWORDS([monitor])
5192 # Start a monitor, use the required protocol version
5193 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5194 AT_CAPTURE_FILE([monitor.log])
5196 ovs-appctl time/stop
5198 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (01)
5199 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 01 00 00 00 01 00 00 00 03"
5200 ovs-appctl time/warp 8000
5201 # Send a bundle flow mod, it should keep the bundle alive.
5202 ovs-appctl -t ovs-ofctl ofctl/send "05 22 00 a0 00 00 00 02 00 00 00 01 00 00 00 03 \
5203 05 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \
5204 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \
5205 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \
5206 00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \
5207 50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \
5208 80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \
5209 00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \
5210 00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \
5211 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \
5213 ovs-appctl time/warp 8000
5214 # Send a bundle close, it should keep the bundle alive.
5215 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 03 00 00 00 01 00 02 00 03"
5216 ovs-appctl time/warp 11000
5217 # Make sure that timeouts are processed after the expiry
5218 ovs-appctl time/warp 1000
5219 # Send a Commit, but too late.
5220 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 04 00 00 00 01 00 04 00 03"
5221 ovs-appctl -t ovs-ofctl ofctl/barrier
5222 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5224 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5225 send: OFPT_BUNDLE_CONTROL (OF1.4):
5226 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5227 OFPT_BUNDLE_CONTROL (OF1.4):
5228 bundle_id=0x1 type=OPEN_REPLY flags=0
5229 send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5230 bundle_id=0x1 flags=atomic ordered
5231 OFPT_FLOW_MOD (OF1.4): ADD table:1 priority=65535,arp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2 actions=output:3
5232 send: OFPT_BUNDLE_CONTROL (OF1.4):
5233 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic ordered
5234 OFPT_BUNDLE_CONTROL (OF1.4):
5235 bundle_id=0x1 type=CLOSE_REPLY flags=0
5236 OFPT_ERROR (OF1.4): OFPBFC_TIMEOUT
5237 OFPT_BUNDLE_CONTROL (OF1.4):
5238 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5239 send: OFPT_BUNDLE_CONTROL (OF1.4):
5240 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5241 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5242 OFPT_BUNDLE_CONTROL (OF1.4):
5243 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5244 OFPT_BARRIER_REPLY (OF1.4):
5251 AT_SETUP([ofproto - bundle open (OpenFlow 1.3)])
5252 AT_KEYWORDS([monitor])
5255 # Start a monitor, use the required protocol version
5256 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5257 AT_CAPTURE_FILE([monitor.log])
5259 # Send an OpenFlow13 message (04), OFPT_EXPERIMENTER (04), length (0018),
5260 # xid (0000000a), ONF_EXPERIMENTER_ID (4F4E4600),
5261 # ONFT_BUNDLE_CONTROL (2300 = 0x08FC), bundle id (00000001),
5262 # message type (0000), and flags (0002)
5263 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 00 00 02"
5264 ovs-appctl -t ovs-ofctl ofctl/barrier
5265 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5267 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5268 send: ONFT_BUNDLE_CONTROL (OF1.3):
5269 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5270 ONFT_BUNDLE_CONTROL (OF1.3):
5271 bundle_id=0x1 type=OPEN_REPLY flags=0
5272 OFPT_BARRIER_REPLY (OF1.3):
5278 AT_SETUP([ofproto - bundle double open (OpenFlow 1.3)])
5279 AT_KEYWORDS([monitor])
5282 # Start a monitor, use the required protocol version
5283 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5284 AT_CAPTURE_FILE([monitor.log])
5286 # Send twice an OpenFlow13 message (04), OFPT_EXPERIMENTER (04), length (0018),
5287 # xid (0000000a), ONF_EXPERIMENTER_ID (4F4E4600),
5288 # ONFT_BUNDLE_CONTROL (2300 = 0x08FC), bundle id (00000001),
5289 # message type (0000), and flags (0002)
5290 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 00 00 02"
5291 ovs-appctl -t ovs-ofctl ofctl/barrier
5292 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 00 00 02"
5293 ovs-appctl -t ovs-ofctl ofctl/barrier
5294 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5296 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5297 send: ONFT_BUNDLE_CONTROL (OF1.3):
5298 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5299 ONFT_BUNDLE_CONTROL (OF1.3):
5300 bundle_id=0x1 type=OPEN_REPLY flags=0
5301 OFPT_BARRIER_REPLY (OF1.3):
5302 send: ONFT_BUNDLE_CONTROL (OF1.3):
5303 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5304 OFPT_ERROR (OF1.3): OFPBFC_BAD_ID
5305 ONFT_BUNDLE_CONTROL (OF1.3):
5306 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5307 OFPT_BARRIER_REPLY (OF1.3):
5313 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.3)])
5314 AT_KEYWORDS([monitor])
5317 # Start a monitor, use the required protocol version
5318 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5319 AT_CAPTURE_FILE([monitor.log])
5321 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 02 00 02"
5322 ovs-appctl -t ovs-ofctl ofctl/barrier
5323 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5325 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5326 send: ONFT_BUNDLE_CONTROL (OF1.3):
5327 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5328 OFPT_ERROR (OF1.3): OFPBFC_BAD_ID
5329 ONFT_BUNDLE_CONTROL (OF1.3):
5330 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5331 OFPT_BARRIER_REPLY (OF1.3):
5337 AT_SETUP([ofproto - bundle double close (OpenFlow 1.3)])
5338 AT_KEYWORDS([monitor])
5341 # Start a monitor, use the required protocol version
5342 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5343 AT_CAPTURE_FILE([monitor.log])
5345 # Open, Close, Close
5346 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 00 00 02"
5347 ovs-appctl -t ovs-ofctl ofctl/barrier
5348 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 02 00 02"
5349 ovs-appctl -t ovs-ofctl ofctl/barrier
5350 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 02 00 02"
5351 ovs-appctl -t ovs-ofctl ofctl/barrier
5352 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5354 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5355 send: ONFT_BUNDLE_CONTROL (OF1.3):
5356 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5357 ONFT_BUNDLE_CONTROL (OF1.3):
5358 bundle_id=0x1 type=OPEN_REPLY flags=0
5359 OFPT_BARRIER_REPLY (OF1.3):
5360 send: ONFT_BUNDLE_CONTROL (OF1.3):
5361 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5362 ONFT_BUNDLE_CONTROL (OF1.3):
5363 bundle_id=0x1 type=CLOSE_REPLY flags=0
5364 OFPT_BARRIER_REPLY (OF1.3):
5365 send: ONFT_BUNDLE_CONTROL (OF1.3):
5366 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5367 OFPT_ERROR (OF1.3): OFPBFC_BUNDLE_CLOSED
5368 ONFT_BUNDLE_CONTROL (OF1.3):
5369 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5370 OFPT_BARRIER_REPLY (OF1.3):
5376 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.3)])
5377 AT_KEYWORDS([monitor])
5380 # Start a monitor, use the required protocol version
5381 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5382 AT_CAPTURE_FILE([monitor.log])
5385 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 00 00 02"
5386 ovs-appctl -t ovs-ofctl ofctl/barrier
5387 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 02 00 01"
5388 ovs-appctl -t ovs-ofctl ofctl/barrier
5389 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5391 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5392 send: ONFT_BUNDLE_CONTROL (OF1.3):
5393 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5394 ONFT_BUNDLE_CONTROL (OF1.3):
5395 bundle_id=0x1 type=OPEN_REPLY flags=0
5396 OFPT_BARRIER_REPLY (OF1.3):
5397 send: ONFT_BUNDLE_CONTROL (OF1.3):
5398 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
5399 OFPT_ERROR (OF1.3): OFPBFC_BAD_FLAGS
5400 ONFT_BUNDLE_CONTROL (OF1.3):
5401 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
5402 OFPT_BARRIER_REPLY (OF1.3):
5408 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.3)])
5409 AT_KEYWORDS([monitor])
5412 # Start a monitor, use the required protocol version
5413 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5414 AT_CAPTURE_FILE([monitor.log])
5417 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 04 00 02"
5418 ovs-appctl -t ovs-ofctl ofctl/barrier
5419 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5421 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5422 send: ONFT_BUNDLE_CONTROL (OF1.3):
5423 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
5424 OFPT_ERROR (OF1.3): OFPBFC_BAD_ID
5425 ONFT_BUNDLE_CONTROL (OF1.3):
5426 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
5427 OFPT_BARRIER_REPLY (OF1.3):
5433 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.3)])
5434 AT_KEYWORDS([monitor])
5437 # Start a monitor, use the required protocol version
5438 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5439 AT_CAPTURE_FILE([monitor.log])
5442 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 00 00 02"
5443 ovs-appctl -t ovs-ofctl ofctl/barrier
5444 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 04 00 01"
5445 ovs-appctl -t ovs-ofctl ofctl/barrier
5446 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5448 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5449 send: ONFT_BUNDLE_CONTROL (OF1.3):
5450 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5451 ONFT_BUNDLE_CONTROL (OF1.3):
5452 bundle_id=0x1 type=OPEN_REPLY flags=0
5453 OFPT_BARRIER_REPLY (OF1.3):
5454 send: ONFT_BUNDLE_CONTROL (OF1.3):
5455 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
5456 OFPT_ERROR (OF1.3): OFPBFC_BAD_FLAGS
5457 ONFT_BUNDLE_CONTROL (OF1.3):
5458 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
5459 OFPT_BARRIER_REPLY (OF1.3):
5465 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.3)])
5466 AT_KEYWORDS([monitor])
5469 # Start a monitor, use the required protocol version
5470 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5471 AT_CAPTURE_FILE([monitor.log])
5474 ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 06 00 02"
5475 ovs-appctl -t ovs-ofctl ofctl/barrier
5476 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5478 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5479 send: ONFT_BUNDLE_CONTROL (OF1.3):
5480 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
5481 OFPT_ERROR (OF1.3): OFPBFC_BAD_ID
5482 ONFT_BUNDLE_CONTROL (OF1.3):
5483 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
5484 OFPT_BARRIER_REPLY (OF1.3):
5491 AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.3)])
5494 AT_CHECK([ovs-appctl vlog/set vconn:dbg])
5496 AT_CHECK([ovs-ofctl --no-names del-flows br0])
5498 AT_DATA([flows.txt], [dnl
5499 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
5500 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
5501 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
5502 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
5504 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
5505 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
5506 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
5507 delete in_port=2 dl_src=00:88:99:aa:bb:cc
5510 AT_CHECK([ovs-ofctl -O OpenFlow13 --no-names --bundle add-flows br0 flows.txt])
5512 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5513 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
5514 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
5518 AT_DATA([flows.txt], [dnl
5520 modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7
5523 AT_CHECK([ovs-ofctl -O OpenFlow13 --no-names --bundle add-flows br0 flows.txt])
5525 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5526 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5527 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
5531 # Adding an existing flow acts as a modify, and delete_strict also works.
5532 AT_DATA([flows.txt], [dnl
5533 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8
5534 delete_strict in_port=2 dl_src=00:66:77:88:99:aa
5535 add in_port=2 dl_src=00:66:77:88:99:aa actions=drop
5538 AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle --no-names add-flows br0 flows.txt])
5540 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5541 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
5542 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5546 dnl Check logs for OpenFlow trace
5548 OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3])
5549 AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl
5550 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5551 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5552 vconn|DBG|unix: received: OFPT_HELLO:
5553 version bitmap: 0x01
5554 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
5555 vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop
5556 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5557 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5558 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5559 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5560 vconn|DBG|unix: received: OFPT_HELLO (OF1.3):
5561 version bitmap: 0x04
5562 vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x07 and earlier, peer supports version 0x04)
5563 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
5564 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
5565 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
5566 bundle_id=0 type=OPEN_REPLY flags=0
5567 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5568 bundle_id=0 flags=atomic ordered
5569 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1
5570 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5571 bundle_id=0 flags=atomic ordered
5572 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2
5573 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5574 bundle_id=0 flags=atomic ordered
5575 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3
5576 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5577 bundle_id=0 flags=atomic ordered
5578 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:4
5579 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5580 bundle_id=0 flags=atomic ordered
5581 OFPT_FLOW_MOD (OF1.3): DEL table:255 actions=drop
5582 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5583 bundle_id=0 flags=atomic ordered
5584 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:5
5585 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5586 bundle_id=0 flags=atomic ordered
5587 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:6
5588 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5589 bundle_id=0 flags=atomic ordered
5590 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7
5591 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5592 bundle_id=0 flags=atomic ordered
5593 OFPT_FLOW_MOD (OF1.3): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
5594 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.3):
5595 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.3):
5596 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
5597 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5598 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
5599 bundle_id=0 type=COMMIT_REPLY flags=0
5600 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5601 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5602 vconn|DBG|unix: received: OFPT_HELLO:
5603 version bitmap: 0x01
5604 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
5605 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
5606 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5607 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5608 vconn|DBG|unix: received: NXST_FLOW request:
5609 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
5610 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
5611 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
5612 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5613 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5614 vconn|DBG|unix: received: OFPT_HELLO (OF1.3):
5615 version bitmap: 0x04
5616 vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x07 and earlier, peer supports version 0x04)
5617 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
5618 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
5619 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
5620 bundle_id=0 type=OPEN_REPLY flags=0
5621 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5622 bundle_id=0 flags=atomic ordered
5623 OFPT_FLOW_MOD (OF1.3): MOD actions=drop
5624 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5625 bundle_id=0 flags=atomic ordered
5626 OFPT_FLOW_MOD (OF1.3): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
5627 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.3):
5628 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.3):
5629 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
5630 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5631 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
5632 bundle_id=0 type=COMMIT_REPLY flags=0
5633 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5634 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5635 vconn|DBG|unix: received: OFPT_HELLO:
5636 version bitmap: 0x01
5637 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
5638 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
5639 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5640 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5641 vconn|DBG|unix: received: NXST_FLOW request:
5642 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
5643 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5644 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
5645 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5646 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5647 vconn|DBG|unix: received: OFPT_HELLO (OF1.3):
5648 version bitmap: 0x04
5649 vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x07 and earlier, peer supports version 0x04)
5650 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
5651 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
5652 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
5653 bundle_id=0 type=OPEN_REPLY flags=0
5654 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5655 bundle_id=0 flags=atomic ordered
5656 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8
5657 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5658 bundle_id=0 flags=atomic ordered
5659 OFPT_FLOW_MOD (OF1.3): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5660 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
5661 bundle_id=0 flags=atomic ordered
5662 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5663 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.3):
5664 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.3):
5665 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
5666 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5667 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
5668 bundle_id=0 type=COMMIT_REPLY flags=0
5669 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
5670 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
5671 vconn|DBG|unix: received: OFPT_HELLO:
5672 version bitmap: 0x01
5673 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
5674 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
5675 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5676 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5677 vconn|DBG|unix: received: NXST_FLOW request:
5678 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
5679 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
5680 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5687 AT_SETUP([ofproto - failing bundle add message (OpenFlow 1.3)])
5690 AT_CHECK([ovs-ofctl del-flows br0])
5692 ovs-ofctl add-flows br0 - <<EOF
5693 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=11
5694 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=22
5695 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=33
5697 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5698 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
5699 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
5700 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
5704 # last line uses illegal table number (OVS internal table)
5705 AT_DATA([flows.txt], [dnl
5706 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
5707 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
5708 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
5709 modify idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
5711 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
5712 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
5713 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
5714 delete in_port=2 dl_src=00:88:99:aa:bb:cc
5715 add table=254 actions=drop
5718 AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle add-flows br0 flows.txt 2>&1 | sed '/talking to/,$d' | strip_xids],
5720 Error OFPBRC_EPERM for: OFPT_FLOW_MOD (OF1.3): ADD table:254 actions=drop
5723 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5724 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
5725 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
5726 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
5734 AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.3)])
5737 AT_CHECK([ovs-ofctl del-flows br0])
5739 # Invalid group numbers are detected at commit time
5740 AT_DATA([flows.txt], [dnl
5741 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=group:1
5742 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=group:2
5743 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=group:3
5746 AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle add-flows br0 flows.txt 2>&1 | sed '/talking to/,$d' | strip_xids],
5748 Error OFPBAC_BAD_OUT_GROUP for: OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=group:1
5749 Error OFPBFC_MSG_FAILED for: ONFT_BUNDLE_CONTROL (OF1.3):
5750 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5753 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5760 AT_SETUP([ofproto - monitor flows with tun_md])
5763 AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"])
5764 AT_CHECK([ovs-ofctl add-flow br0 tun_metadata0=0x1,actions=drop])
5766 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
5768 tun_metadata0=0x1 actions=drop
5771 AT_CAPTURE_FILE([ofctl_monitor.log])
5772 dnl Usually ovs-ofctl monitor outputs on stderr, but the first message here
5773 dnl is put on stdout, because it is handled by ofctl in dump_transaction()
5774 dnl and not in monitor_vconn().
5775 AT_CHECK([ovs-ofctl monitor br0 65534 watch: --detach --no-chdir --pidfile >ofctl_monitor.log 2>&1])
5777 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2])
5779 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
5780 NXST_FLOW_MONITOR reply:
5781 event=ADDED table=0 cookie=0 tun_metadata0=0x1
5784 AT_CHECK([ovs-ofctl del-flows br0])
5786 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
5788 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
5789 NXST_FLOW_MONITOR reply:
5790 event=ADDED table=0 cookie=0 tun_metadata0=0x1
5791 NXST_FLOW_MONITOR reply:
5792 event=DELETED reason=delete table=0 cookie=0 tun_metadata0=0x1
5795 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5797 dnl Check that vswitchd hasn't crashed
5798 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
5805 AT_SETUP([ofproto - flow mod with tunnel metadata])
5806 AT_KEYWORDS([ofp-actions])
5809 AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"])
5810 AT_CHECK([ovs-ofctl add-flow br0 "in_port=1 actions=move:tun_metadata0[[0..31]]->NXM_NX_REG0[[]]"])
5812 dnl Check the length of tun_metadata0 in the replied OXM header.
5813 dnl Ignore the first 0x50 bytes of hex dump from the reply msg since the NXM
5814 dnl header that describes the tunnel metadata starts at offset 0x50.
5815 AT_CHECK([ovs-ofctl dump-flows br0 -mmmm], [0], [stdout])
5816 AT_CHECK([sed -e 's/duration=[[0-9.]]*s/duration=?s/' -e 's/idle_age=[[0-9]]*/idle_age=?/' -e '/^000000[[0-4]]0 / d' stdout | strip_xids], [0], [dnl
5818 cookie=0x0, duration=?s, table=0, n_packets=0, n_bytes=0, idle_age=?, in_port=1 actions=move:NXM_NX_TUN_METADATA0[[0..31]]->NXM_NX_REG0[[]]
5819 00000050 ff ff 00 18 00 00 23 20-00 06 00 20 00 00 00 00 |......# ... ....|
5820 00000060 00 01 50 04 00 01 00 04- |..P..... |
5823 dnl Check actions that may use tun_metadata
5824 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=move:tun_metadata1[[0..31]]->NXM_NX_REG0[[]]"], [1], [], [stderr])
5825 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5826 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
5829 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=move:tun_metadata0[[32..63]]->NXM_NX_REG0[[]]"], [1], [], [stderr])
5830 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5831 OFPT_ERROR: OFPBAC_BAD_SET_LEN
5834 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=push:tun_metadata1[[0..31]]"], [1], [], [stderr])
5835 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5836 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
5839 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=pop:tun_metadata0[[32..63]]"], [1], [], [stderr])
5840 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5841 OFPT_ERROR: OFPBAC_BAD_SET_LEN
5844 AT_CHECK([ovs-ofctl add-flow br0 "in_port=3, actions=load:0x11223344->tun_metadata1"], [1], [], [stderr])
5845 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5846 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
5849 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=output:tun_metadata1[[0..31]]"], [1], [], [stderr])
5850 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5851 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
5854 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=output:tun_metadata0[[32..63]]"], [1], [], [stderr])
5855 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5856 OFPT_ERROR: OFPBAC_BAD_SET_LEN
5859 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=multipath(eth_src,50,modulo_n,1,0,tun_metadata1[[0..31]])"], [1], [], [stderr])
5860 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5861 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
5864 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=multipath(eth_src,50,modulo_n,1,0,tun_metadata0[[32..63]])"], [1], [], [stderr])
5865 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5866 OFPT_ERROR: OFPBAC_BAD_SET_LEN
5869 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=bundle_load(eth_src,50,hrw,ofport,tun_metadata1[[0..31]], slaves:4,8)"], [1], [], [stderr])
5870 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5871 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
5874 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=bundle_load(eth_src,50,hrw,ofport,tun_metadata0[[32..63]], slaves:4,8)"], [1], [], [stderr])
5875 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5876 OFPT_ERROR: OFPBAC_BAD_SET_LEN
5879 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=learn(tun_metadata1[[0..31]]=reg0[[0..31]])"], [1], [], [stderr])
5880 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5881 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
5884 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=learn(tun_metadata0[[32..63]]=reg0[[0..31]])"], [1], [], [stderr])
5885 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5886 OFPT_ERROR: OFPBAC_BAD_SET_LEN
5889 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=clone(move:tun_metadata1[[0..31]]->reg0[[0..31]])"], [1], [], [stderr])
5890 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5891 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
5894 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=clone(move:tun_metadata0[[32..63]]->reg0[[0..31]])"], [1], [], [stderr])
5895 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5896 OFPT_ERROR: OFPBAC_BAD_SET_LEN
5899 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=ct(commit,zone=tun_metadata1[[0..15]],exec(set_field:0x01->ct_mark))"], [1], [], [stderr])
5900 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5901 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
5904 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=ct(commit,zone=tun_metadata0[[32..47]],exec(set_field:0x01->ct_mark))"], [1], [], [stderr])
5905 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5906 OFPT_ERROR: OFPBAC_BAD_SET_LEN
5909 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=ct(commit,zone=1,exec(move:tun_metadata1[[0..31]]->ct_mark))"], [1], [], [stderr])
5910 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5911 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
5914 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=ct(commit,zone=1,exec(move:tun_metadata0[[32..63]]->ct_mark))"], [1], [], [stderr])
5915 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5916 OFPT_ERROR: OFPBAC_BAD_SET_LEN
5919 dnl Check match field with tun_metadata
5920 AT_CHECK([ovs-ofctl add-flow br0 "tun_metadata0=0x11223344 actions=output:2"], [0], [], [stderr])
5921 AT_CHECK([ovs-ofctl add-flow br0 "tun_metadata1=0x11223344 actions=output:2"], [1], [], [stderr])
5922 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
5923 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
5926 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl)
5928 in_port=1 actions=move:NXM_NX_TUN_METADATA0[[0..31]]->NXM_NX_REG0[[]]
5929 tun_metadata0=0x11223344 actions=output:2
5932 OVS_VSWITCHD_STOP(["/NXFMFC_INVALID_TLV_FIELD/d
5934 /OFPBAC_BAD_SET_LEN/d"])