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=?
115 rx_custom_packets_1=0, rx_custom_packets_2=0,
120 dnl This is really bare-bones.
121 dnl It at least checks request and reply serialization and deserialization.
122 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.0)])
124 AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], [stdout])
125 AT_CHECK([strip_xids < stdout], [0], [dnl
126 OFPST_PORT_DESC reply:
127 LOCAL(br0): addr:aa:55:aa:55:00:00
130 speed: 0 Mbps now, 0 Mbps max
135 dnl This is really bare-bones.
136 dnl It at least checks request and reply serialization and deserialization.
137 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.2)])
139 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc br0], [0], [stdout])
140 AT_CHECK([strip_xids < stdout], [0], [dnl
141 OFPST_PORT_DESC reply (OF1.2):
142 LOCAL(br0): addr:aa:55:aa:55:00:00
145 speed: 0 Mbps now, 0 Mbps max
150 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.5)])
152 add_of_ports br0 1 2 3
153 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0], [0], [stdout])
154 AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl
155 OFPST_PORT_DESC reply (OF1.5):
156 1(p1): addr:aa:55:aa:55:00:0x
159 speed: 0 Mbps now, 0 Mbps max
160 2(p2): addr:aa:55:aa:55:00:0x
163 speed: 0 Mbps now, 0 Mbps max
164 3(p3): addr:aa:55:aa:55:00:0x
167 speed: 0 Mbps now, 0 Mbps max
168 LOCAL(br0): addr:aa:55:aa:55:00:0x
171 speed: 0 Mbps now, 0 Mbps max
173 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0 2], [0], [stdout])
174 AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl
175 OFPST_PORT_DESC reply (OF1.5):
176 2(p2): addr:aa:55:aa:55:00:0x
179 speed: 0 Mbps now, 0 Mbps max
184 dnl CHECK_QUEUE_STATS(label, option, format)
185 m4_define([CHECK_QUEUE_STATS], [
186 AT_SETUP([ofproto - queue stats - (OpenFlow $1)])
189 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 | strip_xids], [0],
190 [OFPST_QUEUE reply$3: 1 queues
191 port LOCAL queue 0: bytes=?, pkts=?, errors=?, duration=?
194 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 LOCAL | strip_xids], [0],
195 [OFPST_QUEUE reply$3: 1 queues
196 port LOCAL queue 0: bytes=?, pkts=?, errors=?, duration=?
199 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 LOCAL 0 | strip_xids], [0],
200 [OFPST_QUEUE reply$3: 1 queues
201 port LOCAL queue 0: bytes=?, pkts=?, errors=?, duration=?
204 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 ANY 0 | strip_xids], [0],
205 [OFPST_QUEUE reply$3: 1 queues
206 port LOCAL queue 0: bytes=?, pkts=?, errors=?, duration=?
209 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 LOCAL 5 | strip_xids], [0],
210 [OFPT_ERROR$3: OFPQOFC_BAD_QUEUE
211 OFPST_QUEUE request$3: port=LOCAL queue=5
214 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 ANY 5 | strip_xids], [0],
215 [OFPT_ERROR$3: OFPQOFC_BAD_QUEUE
216 OFPST_QUEUE request$3: port=ANY queue=5
219 AT_CHECK([ovs-ofctl -O $2 queue-stats br0 10 | strip_xids], [0],
220 [OFPT_ERROR$3: OFPQOFC_BAD_PORT
221 OFPST_QUEUE request$3: port=10 queue=ALL
226 CHECK_QUEUE_STATS([1.0], [OpenFlow10], [])
227 CHECK_QUEUE_STATS([1.1], [OpenFlow11], [ (OF1.1)])
228 CHECK_QUEUE_STATS([1.2], [OpenFlow12], [ (OF1.2)])
229 CHECK_QUEUE_STATS([1.3], [OpenFlow13], [ (OF1.3)])
230 CHECK_QUEUE_STATS([1.4], [OpenFlow14], [ (OF1.4)])
232 dnl This is really bare-bones.
233 dnl It at least checks request and reply serialization and deserialization.
234 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.0)])
237 AT_CHECK([ovs-ofctl queue-get-config br0 1], [0], [stdout])
238 AT_CHECK([strip_xids < stdout], [0], [dnl
239 OFPT_QUEUE_GET_CONFIG_REPLY: port=1
242 AT_CHECK([ovs-ofctl queue-get-config br0], [0], [stdout])
243 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
244 OFPT_QUEUE_GET_CONFIG_REPLY: port=1
245 OFPT_QUEUE_GET_CONFIG_REPLY: port=2
249 AT_CHECK([ovs-ofctl queue-get-config br0 10], [0],
250 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT
251 OFPT_QUEUE_GET_CONFIG_REQUEST (xid=0x2): port=10
256 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.1)])
259 AT_CHECK([ovs-ofctl -O OpenFlow11 queue-get-config br0 1], [0], [stdout])
260 AT_CHECK([strip_xids < stdout], [0], [dnl
261 OFPT_QUEUE_GET_CONFIG_REPLY (OF1.1): port=1
264 AT_CHECK([ovs-ofctl -O OpenFlow11 queue-get-config br0 10 | strip_xids], [0],
265 [OFPT_ERROR (OF1.1): OFPQOFC_BAD_PORT
266 OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.1): port=10
271 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.2)])
274 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 1], [0], [stdout])
275 AT_CHECK([strip_xids < stdout], [0], [dnl
276 OFPT_QUEUE_GET_CONFIG_REPLY (OF1.2): port=1
279 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 ANY], [0], [stdout])
280 AT_CHECK([strip_xids < stdout], [0], [dnl
281 OFPT_QUEUE_GET_CONFIG_REPLY (OF1.2): port=ANY
286 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 10 | strip_xids], [0],
287 [OFPT_ERROR (OF1.2): OFPQOFC_BAD_PORT
288 OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.2): port=10
293 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.4)])
297 AT_CHECK([ovs-ofctl -O OpenFlow14 queue-get-config br0 any | strip_xids], [0],
298 [OFPST_QUEUE_DESC reply (OF1.4): port=1
306 AT_CHECK([ovs-ofctl -O OpenFlow14 queue-get-config br0 1 | strip_xids], [0],
307 [OFPST_QUEUE_DESC reply (OF1.4): port=1
311 AT_CHECK([ovs-ofctl -O OpenFlow14 queue-get-config br0 10 | strip_xids], [0],
312 [OFPT_ERROR (OF1.4): OFPQOFC_BAD_PORT
313 OFPST_QUEUE_DESC request (OF1.4): port=10
316 AT_CHECK([ovs-ofctl -O OpenFlow14 queue-get-config br0 1 2 | strip_xids], [0],
317 [OFPT_ERROR (OF1.4): OFPQOFC_BAD_QUEUE
318 OFPST_QUEUE_DESC request (OF1.4): port=1 queue=2
323 dnl This is really bare-bones.
324 dnl It at least checks request and reply serialization and deserialization.
325 dnl Actions definition listed in both supported formats (w/ actions=)
326 AT_SETUP([ofproto - del group (OpenFlow 1.0 extension)])
328 AT_DATA([groups.txt], [dnl
329 group_id=1233,type=select,selection_method=hash,bucket=output:10,bucket=output:11
330 group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11
331 group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
332 group_id=1236,type=select,selection_method=dp_hash,bucket=output:10,bucket=output:11
334 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-groups br0 groups.txt])
335 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0 1234], [0], [stdout])
336 AT_CHECK([strip_xids < stdout], [0], [dnl
337 NXST_GROUP_DESC reply:
338 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
340 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0 group_id=1234])
341 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0], [0], [stdout])
342 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
343 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
344 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
345 group_id=1236,type=select,selection_method=dp_hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
346 NXST_GROUP_DESC reply:
348 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0 group_id=1234])
349 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0], [0], [stdout])
350 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
351 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
352 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
353 group_id=1236,type=select,selection_method=dp_hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
354 NXST_GROUP_DESC reply:
356 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0], [0])
357 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0], [0], [stdout])
358 AT_CHECK([strip_xids < stdout], [0], [dnl
359 NXST_GROUP_DESC reply:
364 dnl This is really bare-bones.
365 dnl It at least checks request and reply serialization and deserialization.
366 dnl Actions definition listed in both supported formats (w/ actions=)
367 AT_SETUP([ofproto - del group (OpenFlow 1.1)])
369 AT_DATA([groups.txt], [dnl
370 group_id=1234,type=all,bucket=output:10
371 group_id=1235,type=all,bucket=actions=output:10
373 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
374 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0 ], [0], [stdout])
375 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
376 group_id=1234,type=all,bucket=actions=output:10
377 group_id=1235,type=all,bucket=actions=output:10
378 OFPST_GROUP_DESC reply (OF1.1):
380 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
381 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
382 AT_CHECK([strip_xids < stdout], [0], [dnl
383 OFPST_GROUP_DESC reply (OF1.1):
384 group_id=1235,type=all,bucket=actions=output:10
386 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
387 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
388 AT_CHECK([strip_xids < stdout], [0], [dnl
389 OFPST_GROUP_DESC reply (OF1.1):
390 group_id=1235,type=all,bucket=actions=output:10
392 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0], [0])
393 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
394 AT_CHECK([strip_xids < stdout], [0], [dnl
395 OFPST_GROUP_DESC reply (OF1.1):
399 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=0xfffffff0],
400 [1], [], [ovs-ofctl: invalid group id 4294967280
405 dnl This is really bare-bones.
406 dnl It at least checks request and reply serialization and deserialization.
407 dnl Actions definition listed in both supported formats (w/ actions=)
408 AT_SETUP([ofproto - add indirect group])
410 dnl indirect group must have exactly one bucket
411 AT_DATA([stderr], [dnl
412 OFPT_ERROR (OF1.1) (xid=0x2): OFPGMFC_INVALID_GROUP
413 OFPT_GROUP_MOD (OF1.1) (xid=0x2): ***decode error: OFPGMFC_INVALID_GROUP***
415 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1234,type=indirect'], [1], , [stderr])
416 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1235,type=indirect,bucket=output:10'])
417 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1236,type=indirect,bucket=output:10,bucket=output:11'], [1], , [stderr])
421 AT_SETUP([ofproto - group mod with mod and add_or_mod command])
423 dnl Check that mod-group for non-existing group fails without --may-create
424 AT_DATA([stderr], [dnl
425 OFPT_ERROR (OF1.3) (xid=0x2): OFPGMFC_UNKNOWN_GROUP
426 OFPT_GROUP_MOD (OF1.3) (xid=0x2):
427 MOD group_id=1234,type=indirect,bucket=actions=output:2
429 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn mod-group br0 'group_id=1234,type=indirect,bucket=actions=2'], [1], , [stderr])
430 dnl Check that mod-group for non-existing group succeeds with --may-create
431 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn --may-create mod-group br0 'group_id=1234,type=indirect,bucket=actions=2'])
432 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout])
433 AT_CHECK([strip_xids < stdout], [0], [dnl
434 OFPST_GROUP_DESC reply (OF1.3):
435 group_id=1234,type=indirect,bucket=actions=output:2
437 dnl Check that mod-group for existing group succeeds with --may-create
438 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn --may-create mod-group br0 'group_id=1234,type=indirect,bucket=actions=3'])
439 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout])
440 AT_CHECK([strip_xids < stdout], [0], [dnl
441 OFPST_GROUP_DESC reply (OF1.3):
442 group_id=1234,type=indirect,bucket=actions=output:3
447 dnl This is really bare-bones.
448 dnl It at least checks request and reply serialization and deserialization.
449 dnl Actions definition listed in both supported formats (w/ actions=)
450 AT_SETUP([ofproto - del group (OpenFlow 1.5)])
452 AT_DATA([groups.txt], [dnl
453 group_id=1233,type=select,selection_method=hash,bucket=output:10,bucket=output:11
454 group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11
455 group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
456 group_id=1236,type=select,selection_method=dp_hash,bucket=output:10,bucket=output:11
458 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
459 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
460 AT_CHECK([strip_xids < stdout], [0], [dnl
461 OFPST_GROUP_DESC reply (OF1.5):
462 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
464 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
465 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
466 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
467 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
468 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
469 group_id=1236,type=select,selection_method=dp_hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
470 OFPST_GROUP_DESC reply (OF1.5):
472 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
473 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
474 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
475 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
476 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
477 group_id=1236,type=select,selection_method=dp_hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
478 OFPST_GROUP_DESC reply (OF1.5):
480 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0], [0])
481 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
482 AT_CHECK([strip_xids < stdout], [0], [dnl
483 OFPST_GROUP_DESC reply (OF1.5):
488 dnl This is really bare-bones.
489 dnl It at least checks request and reply serialization and deserialization.
490 AT_SETUP([ofproto - del group deletes flows])
492 AT_DATA([groups.txt], [dnl
493 group_id=1234,type=all,bucket=output:10
494 group_id=1235,type=all,bucket=output:10
496 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
497 AT_DATA([flows.txt], [dnl
498 tcp actions=group:1234
499 table=2 udp actions=group:1235
501 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt])
502 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
504 table=2, udp actions=group:1235
505 tcp actions=group:1234
506 OFPST_FLOW reply (OF1.1):
508 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
509 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
511 table=2, udp actions=group:1235
512 OFPST_FLOW reply (OF1.1):
514 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
515 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
517 table=2, udp actions=group:1235
518 OFPST_FLOW reply (OF1.1):
520 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0])
521 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
523 OFPST_FLOW reply (OF1.1):
528 dnl This is really bare-bones.
529 dnl It at least checks request and reply serialization and deserialization.
530 dnl Actions definition listed in both supported formats (w/ actions=)
531 AT_SETUP([ofproto - insert group buckets])
533 # Add group with no buckets.
534 AT_DATA([groups.txt], [dnl
535 group_id=1234,type=all
537 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
538 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
539 AT_CHECK([strip_xids < stdout], [0], [dnl
540 OFPST_GROUP_DESC reply (OF1.5):
541 group_id=1234,type=all
544 # Add two buckets, using "last".
545 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])
546 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
547 AT_CHECK([strip_xids < stdout], [0], [dnl
548 OFPST_GROUP_DESC reply (OF1.5):
549 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
552 # Start over again, then add two buckets using "first".
553 AT_CHECK([ovs-ofctl -O OpenFlow15 --strict del-groups br0 group_id=1234])
554 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-group br0 group_id=1234,type=all])
555 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])
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 # Add two more buckets before the existing ones.
563 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])
564 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
565 AT_CHECK([strip_xids < stdout], [0], [dnl
566 OFPST_GROUP_DESC reply (OF1.5):
567 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
570 # Add another bucket at the end.
571 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])
572 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
573 AT_CHECK([strip_xids < stdout], [0], [dnl
574 OFPST_GROUP_DESC reply (OF1.5):
575 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
578 # Verify that duplicate bucket IDs are rejected.
579 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])
580 AT_CHECK([strip_xids < stderr | sed '/truncated/,$d'], [0], [dnl
581 OFPT_ERROR (OF1.5): OFPGMFC_BUCKET_EXISTS
582 OFPT_GROUP_MOD (OF1.5):
583 INSERT_BUCKET command_bucket_id:last,group_id=1234,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
587 # Add another bucket just before bucket 15.
588 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15])
589 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
590 AT_CHECK([strip_xids < stdout], [0], [dnl
591 OFPST_GROUP_DESC reply (OF1.5):
592 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
595 # Add two more buckets just before bucket 11,
596 # getting the command from a file.
597 AT_DATA([buckets.txt], [dnl
598 group_id=1234,command_bucket_id=11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13
600 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 - < buckets.txt])
601 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
602 AT_CHECK([strip_xids < stdout], [0], [dnl
603 OFPST_GROUP_DESC reply (OF1.5):
604 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
607 # Add yet two more buckets.
608 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])
609 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
610 AT_CHECK([strip_xids < stdout], [0], [dnl
611 OFPST_GROUP_DESC reply (OF1.5):
612 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
616 AT_CHECK([ovs-ofctl -O OpenFlow15 del-groups br0])
618 # Add "fast_failover" group, then insert a bucket into it and make
619 # sure that the type of the group doesn't change. (There was a bug
620 # that caused this to happen.)
621 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-group br0 group_id=1234,type=ff])
622 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
623 AT_CHECK([strip_xids < stdout], [0], [dnl
624 OFPST_GROUP_DESC reply (OF1.5):
625 group_id=1234,type=ff
627 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:20,actions=output:20,bucket=bucket_id:21,actions=output:21])
628 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
629 AT_CHECK([strip_xids < stdout], [0], [dnl
630 OFPST_GROUP_DESC reply (OF1.5):
631 group_id=1234,type=ff,bucket=bucket_id:20,actions=output:20,bucket=bucket_id:21,actions=output:21
635 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=123,type=indirect,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [],
636 [ovs-ofctl: type is not needed
638 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=123,selection_method=dp_hash,type=indirect,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [],
639 [ovs-ofctl: selection method is not needed
641 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], [],
642 [ovs-ofctl: invalid command bucket id 4294967041
644 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], [],
645 [ovs-ofctl: insert-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
648 # Verify insert-buckets command to insert bucket with weight value for select group.
649 AT_CHECK([ovs-ofctl -O OpenFlow15 --strict del-groups br0 group_id=1234])
650 AT_DATA([groups.txt], [dnl
651 group_id=1234,type=select,selection_method=hash,bucket=bucket_id=1,weight:100,output:11
653 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
654 AT_CHECK([ovs-ofctl -O OpenFlow15 insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id=2,weight=100,actions=output:11])
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=select,selection_method=hash,bucket=bucket_id:1,weight:100,actions=output:11,bucket=bucket_id:2,weight:100,actions=output:11
664 dnl This is really bare-bones.
665 dnl It at least checks request and reply serialization and deserialization.
666 dnl Actions definition listed in both supported formats (w/ actions=)
667 AT_SETUP([ofproto - remove group buckets])
669 AT_DATA([groups.txt], [dnl
670 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
672 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
673 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
674 AT_CHECK([strip_xids < stdout], [0], [dnl
675 OFPST_GROUP_DESC reply (OF1.5):
676 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
678 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
679 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
680 AT_CHECK([strip_xids < stdout], [0], [dnl
681 OFPST_GROUP_DESC reply (OF1.5):
682 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
684 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
685 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
686 AT_CHECK([strip_xids < stdout], [0], [dnl
687 OFPST_GROUP_DESC reply (OF1.5):
688 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
690 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=13])
691 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
692 AT_CHECK([strip_xids < stdout], [0], [dnl
693 OFPST_GROUP_DESC reply (OF1.5):
694 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
696 AT_DATA([buckets.txt], [dnl
699 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 - < buckets.txt])
700 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
701 AT_CHECK([strip_xids < stdout], [0], [dnl
702 OFPST_GROUP_DESC reply (OF1.5):
703 group_id=1234,type=all
705 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
706 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
707 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=all])
708 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=1], [1], [], [stderr])
709 AT_CHECK([ofctl_strip < stderr], [0], [dnl
710 OFPT_ERROR (OF1.5): OFPGMFC_UNKNOWN_BUCKET
711 OFPT_GROUP_MOD (OF1.5):
712 REMOVE_BUCKET command_bucket_id:1,group_id=1234
715 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [],
716 [ovs-ofctl: none of the usable flow formats (OpenFlow10,NXM,OXM-OpenFlow15) is among the allowed flow formats (OpenFlow11)
721 AT_SETUP([ofproto - bundle del group (OpenFlow 1.3)])
723 AT_DATA([groups.txt], [dnl
724 group_id=1234,type=all,bucket=output:10
725 group_id=1235,type=all,bucket=actions=output:10
727 AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn add-groups br0 groups.txt])
728 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0 ], [0], [stdout])
729 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
730 group_id=1234,type=all,bucket=actions=output:10
731 group_id=1235,type=all,bucket=actions=output:10
732 OFPST_GROUP_DESC reply (OF1.3):
734 AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn del-groups br0 group_id=1234])
735 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout])
736 AT_CHECK([strip_xids < stdout], [0], [dnl
737 OFPST_GROUP_DESC reply (OF1.3):
738 group_id=1235,type=all,bucket=actions=output:10
740 AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn del-groups br0 group_id=1234])
741 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout])
742 AT_CHECK([strip_xids < stdout], [0], [dnl
743 OFPST_GROUP_DESC reply (OF1.3):
744 group_id=1235,type=all,bucket=actions=output:10
746 AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn del-groups br0], [0])
747 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout])
748 AT_CHECK([strip_xids < stdout], [0], [dnl
749 OFPST_GROUP_DESC reply (OF1.3):
753 AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn del-groups br0 group_id=0xfffffff0],
754 [1], [], [ovs-ofctl: invalid group id 4294967280
759 AT_SETUP([ofproto - bundle add indirect group])
761 dnl indirect group must have exactly one bucket
762 AT_DATA([stderr], [dnl
763 OFPT_ERROR (OF1.4) (xid=0x2): OFPGMFC_INVALID_GROUP
764 OFPT_BUNDLE_ADD_MESSAGE (OF1.4) (xid=0x2):
765 bundle_id=0 flags=atomic ordered
766 OFPT_GROUP_MOD (OF1.4) (xid=0x2): ***decode error: OFPGMFC_INVALID_GROUP***
768 AT_CHECK([ovs-ofctl --bundle -vwarn add-group br0 'group_id=1234,type=indirect'], [1], , [stderr])
769 AT_CHECK([ovs-ofctl --bundle -vwarn add-group br0 'group_id=1235,type=indirect,bucket=output:10'])
770 AT_CHECK([ovs-ofctl --bundle -vwarn add-group br0 'group_id=1236,type=indirect,bucket=output:10,bucket=output:11'], [1], , [stderr])
774 AT_SETUP([ofproto - bundle group mod with mod and add_or_mod command])
776 dnl Check that mod-group for non-existing group fails without --may-create
777 AT_DATA([stderr], [dnl
778 OFPT_ERROR (OF1.4) (xid=0x2): OFPGMFC_UNKNOWN_GROUP
779 OFPT_GROUP_MOD (OF1.4) (xid=0x2):
780 MOD group_id=1234,type=indirect,bucket=actions=output:2
782 AT_CHECK([ovs-ofctl --bundle -vwarn mod-group br0 'group_id=1234,type=indirect,bucket=actions=2'], [1], , [stderr])
783 dnl Check that mod-group for non-existing group succeeds with --may-create
784 AT_CHECK([ovs-ofctl --bundle -vwarn --may-create mod-group br0 'group_id=1234,type=indirect,bucket=actions=2'])
785 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-groups br0], [0], [stdout])
786 AT_CHECK([strip_xids < stdout], [0], [dnl
787 OFPST_GROUP_DESC reply (OF1.4):
788 group_id=1234,type=indirect,bucket=actions=output:2
790 dnl Check that mod-group for existing group succeeds with --may-create
791 AT_CHECK([ovs-ofctl --bundle -vwarn --may-create mod-group br0 'group_id=1234,type=indirect,bucket=actions=3'])
792 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-groups br0], [0], [stdout])
793 AT_CHECK([strip_xids < stdout], [0], [dnl
794 OFPST_GROUP_DESC reply (OF1.4):
795 group_id=1234,type=indirect,bucket=actions=output:3
800 AT_SETUP([ofproto - bundle del group (OpenFlow 1.5)])
802 AT_DATA([groups.txt], [dnl
803 group_id=1233,type=select,selection_method=hash,bucket=output:10,bucket=output:11
804 group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11
805 group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
807 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn add-groups br0 groups.txt])
808 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
809 AT_CHECK([strip_xids < stdout], [0], [dnl
810 OFPST_GROUP_DESC reply (OF1.5):
811 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
813 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
814 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
815 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
816 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
817 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
818 OFPST_GROUP_DESC reply (OF1.5):
820 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
821 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
822 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
823 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
824 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
825 OFPST_GROUP_DESC reply (OF1.5):
827 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn del-groups br0], [0])
828 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
829 AT_CHECK([strip_xids < stdout], [0], [dnl
830 OFPST_GROUP_DESC reply (OF1.5):
835 AT_SETUP([ofproto - bundle del group deletes flows])
837 AT_DATA([groups.txt], [dnl
838 group_id=1234,type=all,bucket=output:10
839 group_id=1235,type=all,bucket=output:10
841 AT_CHECK([ovs-ofctl --bundle -vwarn add-groups br0 groups.txt])
842 AT_DATA([flows.txt], [dnl
843 tcp actions=group:1234
844 table=2 udp actions=group:1235
846 AT_CHECK([ovs-ofctl --bundle -vwarn add-flows br0 flows.txt])
847 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-flows br0 | ofctl_strip | sort],
849 table=2, udp actions=group:1235
850 tcp actions=group:1234
851 OFPST_FLOW reply (OF1.4):
853 AT_CHECK([ovs-ofctl --bundle -vwarn del-groups br0 group_id=1234])
854 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-flows br0 | ofctl_strip | sort],
856 table=2, udp actions=group:1235
857 OFPST_FLOW reply (OF1.4):
859 AT_CHECK([ovs-ofctl --bundle -vwarn del-groups br0 group_id=1234])
860 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-flows br0 | ofctl_strip | sort],
862 table=2, udp actions=group:1235
863 OFPST_FLOW reply (OF1.4):
865 AT_CHECK([ovs-ofctl --bundle -vwarn del-groups br0])
866 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-flows br0 | ofctl_strip | sort],
868 OFPST_FLOW reply (OF1.4):
873 dnl This is really bare-bones.
874 dnl It at least checks request and reply serialization and deserialization.
875 dnl Actions definition listed in both supported formats (w/ actions=)
876 AT_SETUP([ofproto - bundle insert group buckets])
878 # Add group with no buckets.
879 AT_DATA([groups.txt], [dnl
880 group_id=1234,type=all
882 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn add-groups br0 groups.txt])
883 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
884 AT_CHECK([strip_xids < stdout], [0], [dnl
885 OFPST_GROUP_DESC reply (OF1.5):
886 group_id=1234,type=all
889 # Add two buckets, using "last".
890 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])
891 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
892 AT_CHECK([strip_xids < stdout], [0], [dnl
893 OFPST_GROUP_DESC reply (OF1.5):
894 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
897 # Start over again, then add two buckets using "first".
898 AT_DATA([groups.txt], [dnl
900 add group_id=1234,type=all
901 insert_bucket group_id=1234,command_bucket_id=first,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
903 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn add-groups br0 groups.txt])
904 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
905 AT_CHECK([strip_xids < stdout], [0], [dnl
906 OFPST_GROUP_DESC reply (OF1.5):
907 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
910 # Add two more buckets before the existing ones.
911 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])
912 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
913 AT_CHECK([strip_xids < stdout], [0], [dnl
914 OFPST_GROUP_DESC reply (OF1.5):
915 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
918 # Add another bucket at the end.
919 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])
920 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
921 AT_CHECK([strip_xids < stdout], [0], [dnl
922 OFPST_GROUP_DESC reply (OF1.5):
923 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
926 # Verify that duplicate bucket IDs are rejected.
927 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])
928 AT_CHECK([strip_xids < stderr | sed '/talking to/,$d'], [0], [dnl
929 Error OFPGMFC_BUCKET_EXISTS for: OFPT_GROUP_MOD (OF1.5):
930 INSERT_BUCKET command_bucket_id:last,group_id=1234,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
931 Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.5):
932 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
935 # Add another bucket just before bucket 15.
936 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15])
937 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
938 AT_CHECK([strip_xids < stdout], [0], [dnl
939 OFPST_GROUP_DESC reply (OF1.5):
940 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
943 # Add two more buckets just before bucket 11,
944 # getting the command from a file.
945 AT_DATA([buckets.txt], [dnl
946 group_id=1234,command_bucket_id=11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13
948 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 - < buckets.txt])
949 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [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: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
955 # Add yet two more buckets.
956 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])
957 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
958 AT_CHECK([strip_xids < stdout], [0], [dnl
959 OFPST_GROUP_DESC reply (OF1.5):
960 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
964 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], [],
965 [ovs-ofctl: invalid command bucket id 4294967041
967 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], [],
968 [ovs-ofctl: insert-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
973 AT_SETUP([ofproto - bundle remove group buckets])
975 AT_DATA([groups.txt], [dnl
976 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
978 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn add-groups br0 groups.txt])
979 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
980 AT_CHECK([strip_xids < stdout], [0], [dnl
981 OFPST_GROUP_DESC reply (OF1.5):
982 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
984 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
985 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
986 AT_CHECK([strip_xids < stdout], [0], [dnl
987 OFPST_GROUP_DESC reply (OF1.5):
988 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
990 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
991 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
992 AT_CHECK([strip_xids < stdout], [0], [dnl
993 OFPST_GROUP_DESC reply (OF1.5):
994 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
996 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=13])
997 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
998 AT_CHECK([strip_xids < stdout], [0], [dnl
999 OFPST_GROUP_DESC reply (OF1.5):
1000 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
1002 AT_DATA([buckets.txt], [dnl
1005 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 - < buckets.txt])
1006 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
1007 AT_CHECK([strip_xids < stdout], [0], [dnl
1008 OFPST_GROUP_DESC reply (OF1.5):
1009 group_id=1234,type=all
1011 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
1012 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
1013 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=all])
1014 AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=1], [1], [], [stderr])
1015 AT_CHECK([ofctl_strip < stderr | sed '/talking to/,$d'], [0], [dnl
1016 Error OFPGMFC_UNKNOWN_BUCKET for: OFPT_GROUP_MOD (OF1.5):
1017 REMOVE_BUCKET command_bucket_id:1,group_id=1234
1018 Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.5):
1019 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
1022 AT_CHECK([ovs-ofctl --bundle -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [],
1023 [ovs-ofctl: none of the usable flow formats (OXM-OpenFlow15) is among the allowed flow formats (OXM-OpenFlow14)
1028 dnl This is really bare-bones.
1029 dnl It at least checks request and reply serialization and deserialization.
1030 AT_SETUP([ofproto - flow mod checks group availability])
1032 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
1033 AT_DATA([flows.txt], [dnl
1034 tcp actions=group:1234
1035 udp actions=group:1235
1037 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
1038 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'], [1], [], [stderr])
1040 AT_CHECK([strip_xids < stderr], [0],
1041 [OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP
1042 OFPT_FLOW_MOD (OF1.1): ADD tcp actions=group:1235
1047 AT_SETUP([ofproto - bundle flow mod checks group availability])
1049 AT_DATA([bundle.txt], [dnl
1050 group add group_id=1234,type=all,bucket=output:10
1051 flow add tcp actions=group:1234
1052 flow add udp actions=group:1235
1054 AT_CHECK([ovs-ofctl -vwarn bundle br0 bundle.txt], [1], [], [stderr])
1056 AT_CHECK([ofctl_strip < stderr | sed '/talking to/,$d'], [0],
1058 Error OFPBAC_BAD_OUT_GROUP for: OFPT_FLOW_MOD (OF1.4): ADD udp actions=group:1235
1059 Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.4):
1060 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
1065 dnl This is really bare-bones.
1066 dnl It at least checks request and reply serialization and deserialization.
1067 AT_SETUP([ofproto - group description])
1069 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10], [0], [stdout])
1070 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
1071 AT_CHECK([strip_xids < stdout], [0], [dnl
1072 OFPST_GROUP_DESC reply (OF1.1):
1073 group_id=1234,type=all,bucket=actions=output:10
1078 dnl This is really bare-bones.
1079 dnl It at least checks request and reply serialization and deserialization.
1080 AT_SETUP([ofproto - group features (OpenFlow 1.0 extension)])
1082 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-group-features br0], [0], [stdout])
1083 AT_CHECK([strip_xids < stdout], [0], [dnl
1084 NXST_GROUP_FEATURES reply:
1089 max_groups=0xffffff00
1090 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
1092 max_groups=0xffffff00
1093 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
1095 max_groups=0xffffff00
1096 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
1097 fast failover group:
1098 max_groups=0xffffff00
1099 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
1104 dnl This is really bare-bones.
1105 dnl It at least checks request and reply serialization and deserialization.
1106 AT_SETUP([ofproto - group features (OpenFlow 1.2)])
1108 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout])
1109 AT_CHECK([strip_xids < stdout], [0], [dnl
1110 OFPST_GROUP_FEATURES reply (OF1.2):
1115 max_groups=0xffffff00
1116 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
1118 max_groups=0xffffff00
1119 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
1121 max_groups=0xffffff00
1122 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
1123 fast failover group:
1124 max_groups=0xffffff00
1125 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
1130 dnl This is really bare-bones.
1131 dnl It at least checks request and reply serialization and deserialization.
1132 AT_SETUP([ofproto - group stats (OpenFlow 1.0 extension)])
1134 AT_DATA([groups.txt], [dnl
1135 group_id=1234,type=all,bucket=output:10
1136 group_id=1235,type=all,bucket=output:10
1138 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-groups br0 groups.txt])
1139 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-flow br0 'tcp actions=group:1234'])
1140 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
1141 AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
1142 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1145 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-group-stats br0], [0], [stdout])
1146 AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
1147 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1148 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1154 dnl This is really bare-bones.
1155 dnl It at least checks request and reply serialization and deserialization.
1156 AT_SETUP([ofproto - group stats (OpenFlow 1.1)])
1158 AT_DATA([groups.txt], [dnl
1159 group_id=1234,type=all,bucket=output:10
1160 group_id=1235,type=all,bucket=output:10
1162 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
1163 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
1164 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
1165 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
1166 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1167 OFPST_GROUP reply (OF1.1):
1169 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0], [0], [stdout])
1170 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
1171 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1172 group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1173 OFPST_GROUP reply (OF1.1):
1178 dnl This is really bare-bones.
1179 dnl It at least checks request and reply serialization and deserialization.
1180 AT_SETUP([ofproto - group stats (OpenFlow 1.3)])
1182 AT_DATA([groups.txt], [dnl
1183 group_id=1234,type=all,bucket=output:10
1184 group_id=1235,type=all,bucket=output:10
1186 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
1187 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-flow br0 'tcp actions=group:1234'])
1188 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
1189 AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
1190 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1191 OFPST_GROUP reply (OF1.3):
1193 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0], [0], [stdout])
1194 AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
1195 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1196 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1197 OFPST_GROUP reply (OF1.3):
1202 dnl This is really bare-bones.
1203 dnl It at least checks request and reply serialization and deserialization.
1204 AT_SETUP([ofproto - group stats (OpenFlow 1.5)])
1206 AT_DATA([groups.txt], [dnl
1207 group_id=1234,type=all,bucket=output:10
1208 group_id=1235,type=all,bucket=output:10
1210 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
1211 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-flow br0 'tcp actions=group:1234'])
1212 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
1213 AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
1214 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1215 OFPST_GROUP reply (OF1.5):
1217 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0], [0], [stdout])
1218 AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
1219 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1220 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
1221 OFPST_GROUP reply (OF1.5):
1226 dnl This is used to find that the bucket counter is not updated.
1227 AT_SETUP([ofproto - group stats after insert a new bucket (OpenFlow 1.5)])
1229 AT_DATA([groups.txt], [dnl
1230 group_id=1234,type=select,selection_method=hash bucket=bucket_id=1,weight:100,actions=output:10
1232 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
1233 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 'group_id=1234, command_bucket_id=last, bucket=bucket_id=2,weight:100,actions=output:10'])
1234 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
1235 AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
1236 group_id=1234,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0,bucket1:packet_count=0,byte_count=0
1237 OFPST_GROUP reply (OF1.5):
1242 dnl This found a use-after-free error in bridge destruction in the
1243 dnl presence of groups.
1244 AT_SETUP([ofproto - group add then bridge delete (OpenFlow 1.3)])
1246 AT_DATA([groups.txt], [dnl
1247 group_id=1234,type=all,bucket=output:10
1248 group_id=1235,type=all,bucket=output:10
1250 dnl This checks for regression against a parser bug such that
1251 dnl "actions=resbmit(,1)" etc. was rejected as a syntax error.
1252 group_id=2345,type=select,bucket=weight:10,actions=resubmit(,1),bucket=weight:10,actions=resubmit(,2),bucket=weight:1,actions=resubmit(,3)
1254 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
1255 AT_CHECK([ovs-vsctl del-br br0])
1259 AT_SETUP([ofproto - mod-port (OpenFlow 1.0)])
1261 for command_config_state in \
1263 'noflood NO_FLOOD 0' \
1265 'no-receive NO_RECV 0' \
1266 'no-forward NO_RECV,NO_FWD 0' \
1267 'no-packet-in NO_RECV,NO_FWD,NO_PACKET_IN 0' \
1268 'forward NO_RECV,NO_PACKET_IN 0' \
1269 'packet-in NO_RECV 0' \
1272 'down PORT_DOWN LINK_DOWN'
1274 printf '\n--- %s --- \n\n' "$command_config_state"
1275 set $command_config_state
1276 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
1277 AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
1278 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
1279 AT_CHECK_UNQUOTED([strip_xids < stdout], [0], [dnl
1280 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
1281 n_tables:254, n_buffers:0
1282 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
1283 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
1284 LOCAL(br0): addr:aa:55:aa:55:00:00
1287 speed: 0 Mbps now, 0 Mbps max
1288 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
1294 AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
1296 for command_config_state in \
1298 'no-receive NO_RECV LIVE' \
1299 'no-forward NO_RECV,NO_FWD LIVE' \
1300 'no-packet-in NO_RECV,NO_FWD,NO_PACKET_IN LIVE' \
1301 'forward NO_RECV,NO_PACKET_IN LIVE' \
1302 'packet-in NO_RECV LIVE' \
1305 'down PORT_DOWN LINK_DOWN'
1307 printf '\n--- %s --- \n\n' "$command_config_state"
1308 set $command_config_state
1309 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
1310 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
1311 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout])
1312 AT_CHECK_UNQUOTED([strip_xids < stdout], [0], [dnl
1313 OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210
1314 n_tables:254, n_buffers:0
1315 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
1316 LOCAL(br0): addr:aa:55:aa:55:00:00
1319 speed: 0 Mbps now, 0 Mbps max
1320 OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0
1326 AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
1328 for command_config_state in \
1330 'no-receive NO_RECV LIVE' \
1331 'no-forward NO_RECV,NO_FWD LIVE' \
1332 'no-packet-in NO_RECV,NO_FWD,NO_PACKET_IN LIVE' \
1333 'forward NO_RECV,NO_PACKET_IN LIVE' \
1334 'packet-in NO_RECV LIVE' \
1337 'down PORT_DOWN LINK_DOWN'
1339 printf '\n--- %s --- \n\n' "$command_config_state"
1340 set $command_config_state
1341 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
1342 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command])
1343 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn show br0], [0], [stdout])
1344 AT_CHECK_UNQUOTED([strip_xids < stdout], [0], [dnl
1345 OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210
1346 n_tables:254, n_buffers:0
1347 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS BUNDLES
1348 OFPST_PORT_DESC reply (OF1.4):
1349 LOCAL(br0): addr:aa:55:aa:55:00:00
1352 speed: 0 Mbps now, 0 Mbps max
1353 OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0
1359 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
1361 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
1363 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -])
1364 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
1365 AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3])
1366 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1367 in_port=1 actions=output:2
1368 in_port=2 actions=output:1
1369 table=1, in_port=4 actions=output:3
1372 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | strip_xids], [0], [dnl
1373 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
1375 AT_CHECK([ovs-ofctl del-flows br0])
1376 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
1381 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
1383 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
1385 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -])
1386 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2])
1387 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3])
1388 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1389 in_port=1 actions=output:2
1390 in_port=2 actions=output:1
1391 table=1, in_port=4 actions=output:3
1394 AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | strip_xids], [0], [dnl
1395 OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
1397 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
1398 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
1403 # It's really dumb that check_overlap and reset_counts are considered
1404 # part of flow state, but OpenFlow implies that it is, and OFTest and
1405 # some users insist on it.
1406 AT_SETUP([ofproto - add-flow and flags])
1408 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 check_overlap,in_port=1,actions=drop])
1409 # Prior to OF1.3, flow dumps didn't include a "flags" field.
1410 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [dnl
1412 in_port=1 actions=drop
1414 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
1415 OFPST_FLOW reply (OF1.1):
1416 in_port=1 actions=drop
1418 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [dnl
1419 OFPST_FLOW reply (OF1.2):
1420 in_port=1 actions=drop
1422 # OF1.3 makes the flags visible.
1423 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip], [0], [dnl
1424 OFPST_FLOW reply (OF1.3):
1425 check_overlap reset_counts in_port=1 actions=drop
1427 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip], [0], [dnl
1428 OFPST_FLOW reply (OF1.4):
1429 check_overlap reset_counts in_port=1 actions=drop
1431 # OF1.5 makes the flags invisible.
1432 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-flows br0 | ofctl_strip], [0], [dnl
1433 OFPST_FLOW reply (OF1.5):
1434 check_overlap reset_counts in_port=1 actions=drop
1439 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)])
1441 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
1443 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -])
1444 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2])
1445 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3])
1446 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1447 in_port=1 actions=output:2
1448 in_port=2 actions=output:1
1449 table=1, in_port=4 actions=output:3
1450 OFPST_FLOW reply (OF1.1):
1452 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | strip_xids], [0], [dnl
1453 OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2
1455 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
1456 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
1457 table=1, in_port=4 actions=output:3
1462 AT_SETUP([ofproto - flow_mod negative test (OpenFlow 1.1)])
1464 [set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13])
1465 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2])
1467 # The error message here actually comes from ovs-ofctl, not from ovs-vswitchd,
1468 # but at least it's the same code in ofpacts_check() that issues the error.
1469 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1],
1471 [ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID)
1476 AT_SETUP([ofproto - set-field flow_mod commands (NXM)])
1478 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop])
1479 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])
1480 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])
1481 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1482 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[[]]
1483 table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]]
1489 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)])
1491 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
1493 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -])
1494 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2])
1495 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3])
1496 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1497 in_port=1 actions=output:2
1498 in_port=2 actions=output:1
1499 table=1, in_port=4 actions=output:3
1500 OFPST_FLOW reply (OF1.2):
1502 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
1503 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
1508 AT_SETUP([ofproto - set-field flow_mod commands (OF1.2)])
1510 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 ipv6,table=1,in_port=3,actions=drop])
1511 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])
1512 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])
1513 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1514 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
1515 table=1, ipv6,in_port=3 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
1516 OFPST_FLOW reply (OF1.2):
1521 AT_SETUP([ofproto - dump flows with cookie])
1523 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1524 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1525 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1526 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1527 cookie=0x1, in_port=1 actions=output:1
1528 cookie=0x2, in_port=2 actions=output:1
1529 cookie=0x3, in_port=3 actions=output:1
1532 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | strip_xids], [0], [dnl
1533 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
1535 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl
1536 cookie=0x3, in_port=3 actions=output:1
1539 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | strip_xids], [0], [dnl
1540 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
1545 AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)])
1547 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1])
1548 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1549 cookie=0x1, in_port=1 actions=output:1
1553 AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1])
1554 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1555 cookie=0x2, in_port=1 actions=output:1
1561 AT_SETUP([ofproto - mod flow with cookie change (NXM)])
1563 AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1])
1564 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1565 cookie=0x1, in_port=1 actions=output:1
1569 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1])
1570 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1571 cookie=0x2, in_port=1 actions=output:1
1577 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)])
1579 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1580 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1581 cookie=0x1, in_port=1 actions=output:1
1582 OFPST_FLOW reply (OF1.1):
1584 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1])
1585 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1586 cookie=0x1, in_port=1 actions=output:1
1587 OFPST_FLOW reply (OF1.1):
1592 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
1593 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)])
1595 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1596 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1597 cookie=0x1, in_port=1 actions=output:1
1598 OFPST_FLOW reply (OF1.2):
1601 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1])
1602 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1603 cookie=0x1, in_port=1 actions=output:1
1604 OFPST_FLOW reply (OF1.2):
1609 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)])
1611 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1612 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
1613 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
1614 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1615 cookie=0x1, in_port=1 actions=output:1
1616 cookie=0x1, in_port=2 actions=output:1
1617 cookie=0x2, in_port=3 actions=output:1
1621 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4])
1622 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1623 cookie=0x1, in_port=1 actions=output:4
1624 cookie=0x1, in_port=2 actions=output:4
1625 cookie=0x2, in_port=3 actions=output:1
1631 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)])
1633 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1634 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1])
1635 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1])
1636 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1637 cookie=0x1, in_port=1 actions=output:1
1638 cookie=0x1, in_port=2 actions=output:1
1639 cookie=0x2, in_port=3 actions=output:1
1640 OFPST_FLOW reply (OF1.1):
1643 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4])
1644 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1645 cookie=0x1, in_port=1 actions=output:4
1646 cookie=0x1, in_port=2 actions=output:4
1647 cookie=0x2, in_port=3 actions=output:1
1648 OFPST_FLOW reply (OF1.1):
1653 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)])
1655 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1656 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1])
1657 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1])
1658 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1659 cookie=0x1, in_port=1 actions=output:1
1660 cookie=0x1, in_port=2 actions=output:1
1661 cookie=0x2, in_port=3 actions=output:1
1662 OFPST_FLOW reply (OF1.2):
1665 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4])
1666 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1667 cookie=0x1, in_port=1 actions=output:4
1668 cookie=0x1, in_port=2 actions=output:4
1669 cookie=0x2, in_port=3 actions=output:1
1670 OFPST_FLOW reply (OF1.2):
1675 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
1676 AT_SETUP([ofproto - mod flows based on cookie mask with cookie change])
1678 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1679 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
1680 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
1681 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1682 cookie=0x1, in_port=1 actions=output:1
1683 cookie=0x1, in_port=2 actions=output:1
1684 cookie=0x2, in_port=3 actions=output:1
1688 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4])
1689 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1690 cookie=0x2, in_port=3 actions=output:1
1691 cookie=0x4, in_port=1 actions=output:4
1692 cookie=0x4, in_port=2 actions=output:4
1698 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM])
1700 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1])
1701 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1702 in_port=1 actions=output:1
1708 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1])
1710 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1])
1711 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1712 in_port=1 actions=output:1
1713 OFPST_FLOW reply (OF1.1):
1718 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2])
1720 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1])
1721 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1722 OFPST_FLOW reply (OF1.2):
1727 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM])
1729 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1])
1730 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1736 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1])
1738 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1739 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1740 OFPST_FLOW reply (OF1.1):
1745 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2])
1747 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1748 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1749 OFPST_FLOW reply (OF1.2):
1754 AT_SETUP([ofproto - del flows with cookies])
1756 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1757 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1758 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1759 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1760 cookie=0x1, in_port=1 actions=output:1
1761 cookie=0x2, in_port=2 actions=output:1
1762 cookie=0x3, in_port=3 actions=output:1
1766 AT_CHECK([ovs-ofctl del-flows br0])
1767 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1773 AT_SETUP([ofproto - del flows based on cookie])
1775 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1776 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1777 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1778 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1779 cookie=0x1, in_port=1 actions=output:1
1780 cookie=0x2, in_port=2 actions=output:1
1781 cookie=0x3, in_port=3 actions=output:1
1785 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1])
1786 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1787 cookie=0x1, in_port=1 actions=output:1
1788 cookie=0x2, in_port=2 actions=output:1
1794 AT_SETUP([ofproto - del flows based on cookie mask])
1796 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1797 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1798 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1799 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1800 cookie=0x1, in_port=1 actions=output:1
1801 cookie=0x2, in_port=2 actions=output:1
1802 cookie=0x3, in_port=3 actions=output:1
1805 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
1806 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1807 cookie=0x2, in_port=2 actions=output:1
1813 AT_SETUP([ofproto - del flows based on table id (NXM)])
1815 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1816 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1817 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1818 cookie=0x1, in_port=1 actions=output:1
1819 cookie=0x2, table=1, in_port=2 actions=output:1
1822 AT_CHECK([ovs-ofctl del-flows br0 table=0])
1823 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1824 cookie=0x2, table=1, in_port=2 actions=output:1
1827 AT_CHECK([ovs-ofctl del-flows br0 table=1])
1828 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1831 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1832 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1833 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1834 cookie=0x1, in_port=1 actions=output:1
1835 cookie=0x2, table=1, in_port=2 actions=output:1
1838 AT_CHECK([ovs-ofctl del-flows br0])
1839 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1845 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)])
1847 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1848 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1849 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1850 cookie=0x1, in_port=1 actions=output:1
1851 cookie=0x2, table=1, in_port=2 actions=output:1
1852 OFPST_FLOW reply (OF1.1):
1854 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0])
1855 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1856 cookie=0x2, table=1, in_port=2 actions=output:1
1857 OFPST_FLOW reply (OF1.1):
1859 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1])
1860 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1861 OFPST_FLOW reply (OF1.1):
1863 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1864 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1865 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1866 cookie=0x1, in_port=1 actions=output:1
1867 cookie=0x2, table=1, in_port=2 actions=output:1
1868 OFPST_FLOW reply (OF1.1):
1870 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
1871 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
1872 OFPST_FLOW reply (OF1.1):
1873 cookie=0x2, table=1, in_port=2 actions=output:1
1878 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)])
1880 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1881 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1882 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1883 cookie=0x1, in_port=1 actions=output:1
1884 cookie=0x2, table=1, in_port=2 actions=output:1
1885 OFPST_FLOW reply (OF1.2):
1887 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0])
1888 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1889 cookie=0x2, table=1, in_port=2 actions=output:1
1890 OFPST_FLOW reply (OF1.2):
1892 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1])
1893 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1894 OFPST_FLOW reply (OF1.2):
1896 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1897 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1898 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1899 cookie=0x1, in_port=1 actions=output:1
1900 cookie=0x2, table=1, in_port=2 actions=output:1
1901 OFPST_FLOW reply (OF1.2):
1903 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
1904 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1905 OFPST_FLOW reply (OF1.2):
1910 AT_SETUP([ofproto - flow_mod with out_port matching (OpenFlow 1.0)])
1912 AT_DATA([flows.txt], [dnl
1913 in_port=1 actions=output:2
1914 in_port=2 actions=output:1,output:2,output:3
1915 in_port=3 actions=output:3,output:1,output:2
1916 in_port=4 actions=drop
1917 in_port=5 actions=output:3
1918 in_port=6 actions=output:1
1920 AT_CHECK([ovs-ofctl -F openflow10 add-flows br0 flows.txt])
1921 (cat flows.txt; echo 'OFPST_FLOW reply:') > expout
1922 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0],
1925 (grep 'output:2' flows.txt; echo 'OFPST_FLOW reply:') > expout
1926 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 out_port=2 | ofctl_strip | sort], [0], [expout])
1928 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0 out_port=2])
1929 (grep -v 'output:2' flows.txt; echo 'OFPST_FLOW reply:') > expout
1930 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0],
1933 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0 out_port=3])
1934 (grep -v 'output:[[23]]' flows.txt; echo 'OFPST_FLOW reply:') > expout
1935 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0],
1938 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0 out_port=1])
1939 (grep -v 'output:[[123]]' flows.txt; echo 'OFPST_FLOW reply:') > expout
1940 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0],
1946 AT_SETUP([ofproto - flow_mod with out_port matching (OpenFlow 1.1)])
1948 AT_DATA([flows.txt], [dnl
1949 in_port=1 actions=output:2
1950 in_port=2 actions=output:1,write_actions(output:2,output:3)
1951 in_port=3 actions=output:3,output:1,write_actions(output:2)
1952 in_port=4 actions=drop
1953 in_port=5 actions=write_actions(output:3)
1954 in_port=6 actions=output:1
1956 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flows br0 flows.txt])
1957 (cat flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1958 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
1961 (grep 'output:2' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1962 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 out_port=2 | ofctl_strip | sort], [0], [expout])
1964 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_port=2])
1965 (grep -v 'output:2' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1966 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
1969 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_port=3])
1970 (grep -v 'output:[[23]]' 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_port=1])
1975 (grep -v 'output:[[123]]' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
1976 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
1982 AT_SETUP([ofproto - flow_mod with out_group matching (OpenFlow 1.1)])
1984 AT_DATA([groups.txt], [dnl
1985 group_id=1,type=all,bucket=output:10
1986 group_id=2,type=all,bucket=output:10
1987 group_id=3,type=all,bucket=output:10
1989 AT_CHECK([ovs-ofctl -O OpenFlow11 add-groups br0 groups.txt])
1990 AT_DATA([flows.txt], [dnl
1991 in_port=1 actions=group:2,output:5
1992 in_port=2 actions=group:1,write_actions(group:2,group:3,output:6)
1993 in_port=3 actions=group:3,group:1,write_actions(group:2,output:3)
1994 in_port=4 actions=output:4
1995 in_port=5 actions=write_actions(output:4,group:3)
1996 in_port=6 actions=group:1
1998 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flows br0 flows.txt])
1999 (cat flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
2000 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
2003 (grep 'output:3' flows.txt | grep 'group:2'; echo 'OFPST_FLOW reply (OF1.1):') > expout
2004 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 out_port=3,out_group=2 | ofctl_strip | sort], [0], [expout])
2006 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_group=2])
2007 (grep -v 'group:2' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
2008 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
2011 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_group=3])
2012 (grep -v 'group:[[23]]' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
2013 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
2016 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_group=1])
2017 (grep -v 'group:[[123]]' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout
2018 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0],
2024 AT_SETUP([ofproto - bundle flow_mod with out group matching (OpenFlow 1.4)])
2026 AT_DATA([bundle.txt], [dnl
2027 group group_id=1,type=all,bucket=output:10
2028 group group_id=2,type=all,bucket=output:10
2029 group group_id=3,type=all,bucket=output:10
2030 flow in_port=1 actions=group:2,output:5
2031 flow in_port=2 actions=group:1,write_actions(group:2,group:3,output:6)
2032 flow in_port=3 actions=group:3,group:1,write_actions(group:2,output:3)
2033 flow in_port=4 actions=output:4
2034 flow in_port=5 actions=write_actions(output:4,group:3)
2035 flow in_port=6 actions=group:1
2037 AT_CHECK([ovs-ofctl bundle br0 bundle.txt])
2040 AT_DATA([flows.txt], [dnl
2041 in_port=1 actions=group:2,output:5
2042 in_port=2 actions=group:1,write_actions(group:2,group:3,output:6)
2043 in_port=3 actions=group:3,group:1,write_actions(group:2,output:3)
2044 in_port=4 actions=output:4
2045 in_port=5 actions=write_actions(output:4,group:3)
2046 in_port=6 actions=group:1
2049 (cat flows.txt; echo 'OFPST_FLOW reply (OF1.4):') > expout
2050 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2053 (grep 'output:3' flows.txt | grep 'group:2'; echo 'OFPST_FLOW reply (OF1.4):') > expout
2054 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 out_port=3,out_group=2 | ofctl_strip | sort], [0], [expout])
2056 AT_CHECK([ovs-ofctl -O OpenFlow14 del-flows br0 out_group=2])
2057 (grep -v 'group:2' flows.txt; echo 'OFPST_FLOW reply (OF1.4):') > expout
2058 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2061 AT_CHECK([ovs-ofctl -O OpenFlow14 del-flows br0 out_group=3])
2062 (grep -v 'group:[[23]]' flows.txt; echo 'OFPST_FLOW reply (OF1.4):') > expout
2063 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2066 AT_CHECK([ovs-ofctl -O OpenFlow14 del-flows br0 out_group=1])
2067 (grep -v 'group:[[123]]' flows.txt; echo 'OFPST_FLOW reply (OF1.4):') > expout
2068 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2074 AT_SETUP([ofproto - bundle packet-out (OpenFlow 1.4)])
2077 ovs-ofctl del-flows br0
2078 ovs-ofctl add-flow br0 priority=0,actions=drop
2080 # Start a monitor listening for packet-ins.
2081 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
2082 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2083 ovs-appctl -t ovs-ofctl ofctl/barrier
2084 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2085 AT_CAPTURE_FILE([monitor.log])
2087 # This bundle adds a group, a flow using that group and then a
2088 # packet-out that needs them both. Finally the bundle deletes all
2089 # groups, which also deletes the flow, leaving only the drop flow in
2090 # the table. If this works properly, the packet-out should get
2091 # translated and processed before the flow disappears. Also, if the
2092 # bundle were to fail, the packet-in should not get executed.
2093 AT_DATA([bundle.txt], [dnl
2094 group group_id=1,type=all,bucket=output:controller
2095 flow in_port=6 actions=group:1
2096 packet-out in_port=6, packet=0001020304050010203040501234 actions=table
2099 AT_CHECK([ovs-ofctl bundle br0 bundle.txt])
2101 # Verify that only the drop flow remains.
2102 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2103 [ reset_counts priority=0 actions=drop
2104 OFPST_FLOW reply (OF1.4):
2107 # Verify that the packet-in was received via controller action.
2108 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2109 [OFPT_PACKET_IN (xid=0x0): total_len=14 in_port=6 (via action) data_len=14 (unbuffered)
2110 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2116 AT_SETUP([ofproto - bundle packet-out, failing bundle commit (OpenFlow 1.4)])
2119 ovs-ofctl del-flows br0
2120 ovs-ofctl add-flow br0 priority=0,actions=drop
2122 # Start a monitor listening for packet-ins.
2123 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
2124 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2125 ovs-appctl -t ovs-ofctl ofctl/barrier
2126 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2127 AT_CAPTURE_FILE([monitor.log])
2129 # This bundle adds a flow using that group and then a packet-out that
2130 # needs them both. Finally the bundle adds another flow that referes
2131 # to a non-existing group, causing the bundle to fail, and the
2132 # packet-in should not get executed.
2133 AT_DATA([bundle.txt], [dnl
2134 group group_id=1,type=all,bucket=output:controller
2135 flow in_port=6 actions=group:1
2136 packet-out in_port=6, packet=0001020304050010203040501234 actions=table
2137 flow in_port=7 actions=group:2
2139 AT_CHECK([ovs-ofctl bundle br0 bundle.txt 2>&1 | sed '/talking to/,$d' | strip_xids], [], [dnl
2140 Error OFPBAC_BAD_OUT_GROUP for: OFPT_FLOW_MOD (OF1.4): ADD in_port=7 actions=group:2
2141 Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.4):
2142 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
2145 # Verify that only the drop flow remains.
2146 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2147 [ reset_counts priority=0 actions=drop
2148 OFPST_FLOW reply (OF1.4):
2151 # Verify that the packet-in was NOT received via controller action.
2152 AT_CHECK([strip_xids < monitor.log], [0], [])
2157 AT_SETUP([ofproto - bundle packet-out makes bundle commit to fail(OpenFlow 1.4)])
2160 ovs-ofctl del-flows br0
2161 ovs-ofctl add-flow br0 priority=0,actions=drop
2163 # Start a monitor listening for packet-ins.
2164 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
2165 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2166 ovs-appctl -t ovs-ofctl ofctl/barrier
2167 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2168 AT_CAPTURE_FILE([monitor.log])
2170 # This bundle adds a flow using that group and then a packet-out that
2171 # needs them both. Finally the bundle adds another flow that referes
2172 # to a non-existing group, causing the bundle to fail, and the
2173 # packet-in should not get executed.
2174 AT_DATA([bundle.txt], [dnl
2175 group group_id=1,type=all,bucket=output:controller
2176 flow in_port=6 actions=group:1
2177 packet-out in_port=6, packet=0001020304050010203040501234 actions=table
2178 packet-out in_port=6, packet=0001020304050010203040501234 actions=group:2
2180 AT_CHECK([ovs-ofctl bundle br0 bundle.txt 2>&1 | sed '/talking to/,$d' | strip_xids], [], [dnl
2181 Error OFPBAC_BAD_OUT_GROUP for: OFPT_PACKET_OUT (OF1.4): in_port=6 actions=group:2 data_len=14
2182 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2183 Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.4):
2184 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
2187 # Verify that only the drop flow remains.
2188 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0],
2189 [ reset_counts priority=0 actions=drop
2190 OFPST_FLOW reply (OF1.4):
2193 # Verify that the packet-in was NOT received via controller action.
2194 AT_CHECK([strip_xids < monitor.log], [0], [])
2199 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)])
2201 # Check the default configuration.
2203 printf 'OFPST_TABLE reply (xid=0x2):
2205 active=0, lookup=0, matched=0
2208 exact match or wildcard: in_port eth_{src,dst,type} vlan_{vid,pcp} ip_{src,dst} nw_{proto,tos} tcp_{src,dst}
2212 (head_table; echo ' tables 1...253: ditto') > expout
2213 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
2214 # Change the configuration.
2217 -- --id=@t0 create Flow_Table name=main \
2218 -- --id=@t1 create Flow_Table flow-limit=1024 \
2219 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
2224 # Check that the configuration was updated.
2225 (head_table ' ("main")'; echo ' table 1:
2226 active=0, lookup=0, matched=0
2231 active=0, lookup=0, matched=0
2234 '; echo ' tables 3...253: ditto') > expout
2235 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
2239 dnl In-band and fail-open add "hidden rules" to table 0. These rules shouldn't
2240 dnl be visible to OpenFlow. This test checks that "dump-flows" and
2241 dnl "dump-tables" don't make them visible.
2242 AT_SETUP([ofproto - hidden rules not in table stats])
2243 # Use an IP address for a controller that won't actually exist: we
2244 # want to create in-band rules but we do not want to actually connect
2245 # to a controller (because that could mess about with our test). The
2246 # Class E range 240.0.0.0 - 255.255.255.255 seems like a good choice.
2247 OVS_VSWITCHD_START([set-controller br0 tcp:240.0.0.1:6653])
2248 for i in 1 2 3 4 5; do ovs-appctl time/warp 1000; done
2250 # Check that no hidden flows are visible in OpenFlow.
2251 AT_CHECK([ovs-ofctl dump-flows br0 | strip_xids], [0], [NXST_FLOW reply:
2254 # Check that some hidden flows related to 240.0.0.1 are actually in table 0.
2256 # We discard flows that mention table_id because we only want table 0 flows,
2257 # which in OVS is implied by the absence of a table_id.
2258 AT_CHECK([ovs-appctl bridge/dump-flows br0], [0], [stdout])
2259 AT_CHECK([test `grep '240\.0\.0\.1' stdout | grep -v table_id= | wc -l` -gt 0])
2261 # Check that dump-tables doesn't count the hidden flows.
2263 printf 'OFPST_TABLE reply:
2265 active=0, lookup=0, matched=0
2268 exact match or wildcard: in_port eth_{src,dst,type} vlan_{vid,pcp} ip_{src,dst} nw_{proto,tos} tcp_{src,dst}
2272 (head_table; echo ' tables 1...253: ditto') > expout
2273 AT_CHECK([ovs-ofctl dump-tables br0 | strip_xids], [0], [expout])
2274 OVS_VSWITCHD_STOP(["/240\.0\.0\.1/d"])
2277 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)])
2279 # Check the default configuration.
2281 printf 'OFPST_TABLE reply (OF1.2) (xid=0x2):
2283 active=0, lookup=0, matched=0
2284 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2287 instructions (table miss and others):
2288 instructions: apply_actions clear_actions write_actions write_metadata goto_table
2289 Write-Actions and Apply-Actions features:
2290 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
2291 supported on Set-Field: metadata in_port_oxm eth_{src,dst} vlan_{vid,pcp} mpls_{label,tc} ip_{src,dst} ipv6_{src,dst,label} ip_dscp nw_ecn arp_{op,spa,tpa,sha,tha} tcp_{src,dst} udp_{src,dst} sctp_{src,dst} icmp_{type,code} icmpv6_{type,code} nd_{target,sll,tll}
2293 exact match or wildcard: metadata in_port_oxm eth_{src,dst,type} vlan_{vid,pcp} mpls_{label,tc} ip_{src,dst} ipv6_{src,dst,label} nw_proto ip_dscp nw_ecn arp_{op,spa,tpa,sha,tha} tcp_{src,dst} udp_{src,dst} sctp_{src,dst} icmp_{type,code} icmpv6_{type,code} nd_{target,sll,tll}
2299 active=0, lookup=0, matched=0
2300 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2303 instructions (table miss and others):
2304 instructions: apply_actions clear_actions write_actions write_metadata
2309 (head_table; printf ' tables 1...252: ditto\n\n'; tail_table) > expout
2310 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
2311 # Change the configuration.
2314 -- --id=@t0 create Flow_Table name=main \
2315 -- --id=@t1 create Flow_Table flow-limit=1024 \
2316 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
2321 # Check that the configuration was updated.
2322 (head_table ' ("main")'; echo ' table 1:
2323 active=0, lookup=0, matched=0
2324 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2331 active=0, lookup=0, matched=0
2332 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2337 '; printf ' tables 3...252: ditto\n\n'; tail_table) > expout
2338 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
2342 AT_SETUP([ofproto - table features (OpenFlow 1.3)])
2346 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2348 instructions (table miss and others):
2350 instructions: meter apply_actions clear_actions write_actions write_metadata goto_table
2351 Write-Actions and Apply-Actions features:
2352 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
2353 supported on Set-Field: tun_{id,src,dst,ipv6_{src,dst},flags,gbp_{id,flags},erspan_{idx,ver,dir,hwid},metadata0...metadata63} metadata in_{port,port_oxm} pkt_mark ct_{mark,label} reg0...reg15 xreg0...xreg7 xxreg0...xxreg3 eth_{src,dst} vlan_{tci,vid,pcp} mpls_{label,tc,ttl} ip_{src,dst} ipv6_{src,dst,label} nw_tos ip_dscp nw_{ecn,ttl} arp_{op,spa,tpa,sha,tha} tcp_{src,dst} udp_{src,dst} sctp_{src,dst} icmp_{type,code} icmpv6_{type,code} nd_{target,sll,tll,reserved,options_type} nsh_{flags,spi,si,c1...c4,ttl}
2355 arbitrary mask: dp_hash tun_{id,src,dst,ipv6_{src,dst},flags,gbp_{id,flags},erspan_{idx,ver,dir,hwid},metadata0...metadata63} metadata pkt_mark ct_{state,mark,label,nw_{src,dst},ipv6_{src,dst},tp_{src,dst}} reg0...reg15 xreg0...xreg7 xxreg0...xxreg3 eth_{src,dst} vlan_{tci,vid} ip_{src,dst} ipv6_{src,dst,label} ip_frag arp_{spa,tpa,sha,tha} tcp_{src,dst,flags} udp_{src,dst} sctp_{src,dst} nd_{target,sll,tll} nsh_{flags,c1...c4}
2356 exact match or wildcard: recirc_id packet_type conj_id in_{port,port_oxm} actset_output ct_{zone,nw_proto} eth_type vlan_pcp mpls_{label,tc,bos,ttl} nw_{proto,tos} ip_dscp nw_{ecn,ttl} arp_op icmp_{type,code} icmpv6_{type,code} nd_{reserved,options_type} nsh_{mdtype,np,spi,si,ttl}
2362 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2364 instructions (table miss and others):
2365 instructions: meter apply_actions clear_actions write_actions write_metadata
2371 printf ' tables 1...252: ditto\n\n'
2372 tail_tables) > expout
2373 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
2374 # Change the configuration.
2377 -- --id=@t0 create Flow_Table name=main \
2378 -- --id=@t1 create Flow_Table flow-limit=1024 \
2379 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
2384 # Check that the configuration was updated.
2385 (head_table ' ("main")'
2387 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2393 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2398 tables 3...252: ditto
2400 tail_tables) > expout
2401 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
2405 AT_SETUP([ofproto - flow table names])
2407 add_of_ports br0 1 2
2409 # Set a table name via OpenFlow 1.3 and one via OpenFlow 1.5.
2410 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 0 name:xyzzy])
2411 AT_CHECK([ovs-ofctl -O OpenFlow15 mod-table br0 1 name:quux])
2412 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2415 table 1 ("quux"): ditto
2416 tables 2...252: ditto
2420 # Set some table names via OVSDB.
2423 -- --id=@t0 create Flow_Table name=zero \
2424 -- --id=@t1 create Flow_Table name=one \
2425 -- --id=@t2 create Flow_Table name=two \
2426 -- set bridge br0 'flow_tables={0=@t0,1=@t1,2=@t2}' \
2432 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2435 table 1 ("one"): ditto
2436 table 2 ("two"): ditto
2437 tables 3...252: ditto
2441 # Check that flow table parsing and dumping uses the names.
2442 AT_DATA([flows.txt], [dnl
2443 table=zero in_port=p2 actions=p1,resubmit(,one)
2444 table=one,in_port=p1,ip,actions=ct(table=two)
2445 table=one,in_port=p1,arp,actions=goto_table(two)
2447 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2448 AT_CHECK([ovs-ofctl --names --no-stats dump-flows br0], [0], [dnl
2449 table=zero, in_port=p2 actions=output:p1,resubmit(,one)
2450 table=one, ip,in_port=p1 actions=ct(table=two)
2451 table=one, arp,in_port=p1 actions=resubmit(,two)
2453 AT_CHECK([ovs-ofctl --no-names --no-stats dump-flows br0], [0], [dnl
2454 in_port=2 actions=output:1,resubmit(,1)
2455 table=1, ip,in_port=1 actions=ct(table=2)
2456 table=1, arp,in_port=1 actions=resubmit(,2)
2459 # Setting the same table names via OpenFlow 1.3 or OpenFlow 1.5 is a no-op.
2460 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 0 name:zero])
2461 AT_CHECK([ovs-ofctl -O OpenFlow15 mod-table br0 1 name:one])
2462 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2465 table 1 ("one"): ditto
2466 table 2 ("two"): ditto
2467 tables 3...252: ditto
2471 # Setting different tables names via OpenFlow 1.3 or OpenFlow 1.5 yield errors.
2472 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 0 name:xyzzy], 1, [], [stderr])
2473 AT_CHECK([head -1 stderr], [0], [OFPT_ERROR (OF1.3) (xid=0x5): OFPTFFC_EPERM
2475 AT_CHECK([ovs-ofctl -O OpenFlow15 mod-table br0 1 name:quux], 1, [], [stderr])
2476 AT_CHECK([head -1 stderr], [0], [OFPT_ERROR (OF1.5) (xid=0x5): OFPTFFC_EPERM
2479 # But we can still set table names for those not set via OVSDB.
2480 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 3 name:three])
2481 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2484 table 1 ("one"): ditto
2485 table 2 ("two"): ditto
2486 table 3 ("three"): ditto
2487 tables 4...252: ditto
2491 # Unsetting names via OVSDB then setting them via OpenFlow works too.
2492 AT_CHECK([ovs-vsctl remove bridge br0 Flow_Table 2])
2493 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2496 table 1 ("one"): ditto
2498 table 3 ("three"): ditto
2499 tables 4...252: ditto
2502 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 2 name:foobar])
2503 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2506 table 1 ("one"): ditto
2507 table 2 ("foobar"): ditto
2508 table 3 ("three"): ditto
2509 tables 4...252: ditto
2513 # We can clear names via OpenFlow, at least if they were set that way.
2514 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 2 name:])
2515 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2518 table 1 ("one"): ditto
2520 table 3 ("three"): ditto
2521 tables 4...252: ditto
2528 AT_SETUP([ofproto - table description (OpenFlow 1.4)])
2531 while test $x -lt 254; do
2534 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
2538 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
2539 /^OFPST_TABLE_DESC/d'], [0], [expout])
2541 # Change the configuration.
2542 AT_CHECK([ovs-ofctl -O Openflow14 mod-table br0 0 evict])
2543 # Check that the configuration was updated.
2544 mv expout orig-expout
2545 sed -e '2s/eviction=off/eviction=on/' <orig-expout > expout
2546 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
2547 /^OFPST_TABLE_DESC/d'], [0], [expout])
2549 AT_CHECK([ovs-ofctl -O Openflow14 mod-table br0 0 vacancy:20,80])
2550 # Check that the configuration was updated.
2551 mv expout orig-expout
2552 sed -e '3s/vacancy=off/vacancy=on vacancy_down=20% vacancy_up=80% vacancy=100%/' <orig-expout > expout
2553 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
2554 /^OFPST_TABLE_DESC/d'], [0], [expout])
2558 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)])
2560 # Configure a maximum of 4 flows.
2563 -- --id=@t0 create Flow_Table flow-limit=4 \
2564 -- set bridge br0 flow_tables:0=@t0 \
2569 for in_port in 1 2 3 4; do
2570 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
2572 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2573 in_port=1 actions=drop
2574 in_port=2 actions=drop
2575 in_port=3 actions=drop
2576 in_port=4 actions=drop
2579 # Adding another flow will be refused.
2580 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
2581 AT_CHECK([ofctl_strip < stderr], [0],
2582 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2583 OFPT_FLOW_MOD: ADD in_port=5 actions=drop
2585 # Also a mod-flow that would add a flow will be refused.
2586 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
2587 AT_CHECK([ofctl_strip < stderr], [0],
2588 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2589 OFPT_FLOW_MOD: MOD in_port=5 actions=drop
2591 # Replacing or modifying an existing flow is allowed.
2592 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
2593 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
2594 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2595 in_port=1 actions=drop
2596 in_port=2 actions=drop
2597 in_port=3 actions=output:1
2598 in_port=4 actions=NORMAL
2604 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)])
2606 # Configure a maximum of 4 flows.
2609 -- --id=@t0 create Flow_Table flow-limit=4 \
2610 -- set bridge br0 flow_tables:0=@t0 \
2615 for in_port in 1 2 3 4; do
2616 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
2618 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2619 in_port=1 actions=drop
2620 in_port=2 actions=drop
2621 in_port=3 actions=drop
2622 in_port=4 actions=drop
2623 OFPST_FLOW reply (OF1.2):
2625 # Adding another flow will be refused.
2626 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
2627 AT_CHECK([ofctl_strip < stderr], [0],
2628 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
2629 OFPT_FLOW_MOD (OF1.2): ADD in_port=5 actions=drop
2631 # Replacing or modifying an existing flow is allowed.
2632 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
2633 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
2634 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2635 in_port=1 actions=drop
2636 in_port=2 actions=drop
2637 in_port=3 actions=output:1
2638 in_port=4 actions=NORMAL
2639 OFPST_FLOW reply (OF1.2):
2644 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
2646 # Configure a maximum of 4 flows.
2649 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2650 -- set bridge br0 flow_tables:0=@t0 \
2655 for in_port in 4 3 2 1; do
2656 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
2658 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2659 idle_timeout=10, in_port=1 actions=drop
2660 idle_timeout=20, in_port=2 actions=drop
2661 idle_timeout=30, in_port=3 actions=drop
2662 idle_timeout=40, in_port=4 actions=drop
2665 # Adding another flow will cause the one that expires soonest to be evicted.
2666 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
2667 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2668 idle_timeout=20, in_port=2 actions=drop
2669 idle_timeout=30, in_port=3 actions=drop
2670 idle_timeout=40, in_port=4 actions=drop
2671 in_port=5 actions=drop
2674 # A mod-flow that adds a flow also causes eviction, but replacing or
2675 # modifying an existing flow doesn't.
2676 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
2677 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
2678 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
2679 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2680 idle_timeout=30, in_port=3 actions=output:1
2681 in_port=4 actions=NORMAL
2682 in_port=5 actions=drop
2683 in_port=6 actions=drop
2686 # Flows with no timeouts at all cannot be evicted.
2687 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
2688 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
2689 AT_CHECK([ofctl_strip < stderr], [0],
2690 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2691 OFPT_FLOW_MOD: ADD in_port=8 actions=drop
2693 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2694 in_port=4 actions=NORMAL
2695 in_port=5 actions=drop
2696 in_port=6 actions=drop
2697 in_port=7 actions=NORMAL
2703 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
2705 # Configure a maximum of 4 flows.
2708 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2709 -- set bridge br0 flow_tables:0=@t0 \
2714 for in_port in 4 3 2 1; do
2715 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
2717 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2718 idle_timeout=10, in_port=1 actions=drop
2719 idle_timeout=20, in_port=2 actions=drop
2720 idle_timeout=30, in_port=3 actions=drop
2721 idle_timeout=40, in_port=4 actions=drop
2722 OFPST_FLOW reply (OF1.2):
2724 # Adding another flow will cause the one that expires soonest to be evicted.
2725 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
2726 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2727 idle_timeout=20, in_port=2 actions=drop
2728 idle_timeout=30, in_port=3 actions=drop
2729 idle_timeout=40, in_port=4 actions=drop
2730 in_port=5 actions=drop
2731 OFPST_FLOW reply (OF1.2):
2733 # In OpenFlow 1.2 a mod-flow does not ever add a flow and thus
2734 # has no effect on eviction
2735 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
2736 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
2737 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
2738 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2739 idle_timeout=20, in_port=2 actions=drop
2740 idle_timeout=30, in_port=3 actions=output:1
2741 in_port=4 actions=NORMAL
2742 in_port=5 actions=drop
2743 OFPST_FLOW reply (OF1.2):
2745 # Flows with no timeouts at all cannot be evicted.
2746 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
2747 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
2748 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
2749 AT_CHECK([ofctl_strip < stderr], [0],
2750 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
2751 OFPT_FLOW_MOD (OF1.2): ADD in_port=8 actions=drop
2753 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2754 in_port=4 actions=NORMAL
2755 in_port=5 actions=drop
2756 in_port=6 actions=drop
2757 in_port=7 actions=NORMAL
2758 OFPST_FLOW reply (OF1.2):
2763 AT_SETUP([ofproto - eviction using importance upon table overflow (OpenFlow 1.4)])
2765 # Configure a maximum of 4 flows.
2768 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
2769 -- set bridge br0 flow_tables:0=@t0 \
2773 # Use mod-table to turn on eviction just to demonstrate that it works.
2774 AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 evict])
2776 for in_port in 4 3 2 1; do
2777 ovs-ofctl -O Openflow14 add-flow br0 importance=$((in_port + 30)),priority=$((in_port + 5)),hard_timeout=$((in_port + 500)),actions=drop
2779 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2780 hard_timeout=501, importance=31, priority=6 actions=drop
2781 hard_timeout=502, importance=32, priority=7 actions=drop
2782 hard_timeout=503, importance=33, priority=8 actions=drop
2783 hard_timeout=504, importance=34, priority=9 actions=drop
2784 OFPST_FLOW reply (OF1.4):
2786 # Adding another flow will cause the one with lowest importance to be evicted.
2787 AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=505,importance=35,priority=10,in_port=2,actions=drop])
2788 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2789 hard_timeout=502, importance=32, priority=7 actions=drop
2790 hard_timeout=503, importance=33, priority=8 actions=drop
2791 hard_timeout=504, importance=34, priority=9 actions=drop
2792 hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop
2793 OFPST_FLOW reply (OF1.4):
2795 # Disable the Eviction configuration.
2796 AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 noevict])
2797 # Adding another flow will cause the system to give error for FULL TABLE.
2798 AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=506,importance=36,priority=11,actions=drop],[1], [], [stderr])
2799 AT_CHECK([ofctl_strip < stderr], [0],
2800 [OFPT_ERROR (OF1.4): OFPFMFC_TABLE_FULL
2801 OFPT_FLOW_MOD (OF1.4): ADD priority=11 hard:506 importance:36 actions=drop
2803 #Dump flows. It should show only the old values
2804 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2805 hard_timeout=502, importance=32, priority=7 actions=drop
2806 hard_timeout=503, importance=33, priority=8 actions=drop
2807 hard_timeout=504, importance=34, priority=9 actions=drop
2808 hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop
2809 OFPST_FLOW reply (OF1.4):
2811 # mod-flow that would modify a flow will be done successfully.
2812 AT_CHECK([ovs-ofctl -O Openflow14 mod-flows br0 in_port=2,actions=NORMAL])
2813 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2814 hard_timeout=502, importance=32, priority=7 actions=drop
2815 hard_timeout=503, importance=33, priority=8 actions=drop
2816 hard_timeout=504, importance=34, priority=9 actions=drop
2817 hard_timeout=505, importance=35, priority=10,in_port=2 actions=NORMAL
2818 OFPST_FLOW reply (OF1.4):
2820 # Also a mod-flow that would add a flow will be refused.
2821 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
2822 AT_CHECK([ofctl_strip < stderr], [0],
2823 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2824 OFPT_FLOW_MOD: MOD in_port=5 actions=drop
2829 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
2831 # Configure a maximum of 4 flows.
2834 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
2835 overflow-policy=evict \
2836 groups='"NXM_OF_IN_PORT[[]]"' \
2837 -- set bridge br0 flow_tables:0=@t0 \
2842 ovs-ofctl add-flows br0 - <<EOF
2843 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
2844 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
2845 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
2846 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
2848 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2849 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2850 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
2851 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2852 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2855 # Adding another flow will cause the one that expires soonest within
2856 # the largest group (those with in_port=1) to be evicted. In this
2857 # case this is not the same as the one that expires soonest overall
2858 # (which is what makes the test interesting):
2859 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
2860 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2861 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2862 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2863 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2864 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2867 # Enlarge the flow limit, change the eviction policy back to strictly
2868 # based on expiration, and and add some flows.
2869 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
2870 ovs-ofctl add-flows br0 - <<EOF
2871 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
2872 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
2873 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
2875 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2876 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2877 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2878 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2879 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2880 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2881 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2882 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2885 # Adding another flow will cause the one that expires soonest overall
2887 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
2888 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2889 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2890 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2891 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2892 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2893 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2894 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2895 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2898 # Reducing the flow limit also causes the flows that expire soonest
2899 # overall to be evicted.
2900 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
2901 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2902 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2903 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2904 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2905 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2911 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
2913 # Configure a maximum of 4 flows.
2916 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
2917 overflow-policy=evict \
2918 groups='"NXM_OF_IN_PORT[[]]"' \
2919 -- set bridge br0 flow_tables:0=@t0 \
2924 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
2925 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
2926 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
2927 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
2928 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
2930 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2931 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2932 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
2933 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2934 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2935 OFPST_FLOW reply (OF1.2):
2937 # Adding another flow will cause the one that expires soonest within
2938 # the largest group (those with in_port=1) to be evicted. In this
2939 # case this is not the same as the one that expires soonest overall
2940 # (which is what makes the test interesting):
2941 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
2942 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2943 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2944 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2945 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2946 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2947 OFPST_FLOW reply (OF1.2):
2949 # Enlarge the flow limit, change the eviction policy back to strictly
2950 # based on expiration, and and add some flows.
2951 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
2952 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
2953 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
2954 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
2955 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
2957 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2958 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2959 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2960 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2961 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2962 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2963 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2964 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2965 OFPST_FLOW reply (OF1.2):
2967 # Adding another flow will cause the one that expires soonest overall
2969 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'])
2970 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2971 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2972 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2973 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2974 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2975 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2976 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2977 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2978 OFPST_FLOW reply (OF1.2):
2980 # Reducing the flow limit also causes the flows that expire soonest
2981 # overall to be evicted.
2982 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
2983 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2984 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2985 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2986 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2987 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2988 OFPST_FLOW reply (OF1.2):
2993 AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout])
2995 # Configure a maximum of 4 flows.
2998 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2999 -- set bridge br0 flow_tables:0=@t0 \
3003 ovs-appctl time/stop
3005 for in_port in 4 3 2 1; do
3006 ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
3008 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3009 hard_timeout=13, in_port=1 actions=drop
3010 hard_timeout=16, in_port=2 actions=drop
3011 hard_timeout=19, in_port=3 actions=drop
3012 hard_timeout=22, in_port=4 actions=drop
3015 # Sleep and modify the one that expires soonest
3016 ovs-appctl time/warp 5000
3017 AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop])
3018 # At this point the table would looks like:
3019 # in_port seconds to expire
3024 ovs-appctl time/warp 2000
3025 # Adding another flow will cause the one that expires soonest to be evicted.
3026 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
3027 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3028 hard_timeout=13, in_port=1 actions=drop
3029 hard_timeout=19, in_port=3 actions=drop
3030 hard_timeout=22, in_port=4 actions=drop
3031 in_port=5 actions=drop
3037 AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout])
3038 OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1])
3039 # Configure a maximum of 4 flows.
3042 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
3043 -- set bridge br0 flow_tables:0=@t0 \
3048 for in_port in 4 3 2 1; do
3049 ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
3051 ovs-appctl time/stop
3052 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3053 idle_timeout=13, in_port=1 actions=drop
3054 idle_timeout=16, in_port=2 actions=drop
3055 idle_timeout=19, in_port=3 actions=drop
3056 idle_timeout=22, in_port=4 actions=drop
3059 # Sleep and receive on the flow that expires soonest
3060 ovs-appctl time/warp 5000
3061 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)'])
3062 # At this point the table would looks like:
3063 # in_port seconds to expire
3068 ovs-appctl time/warp 2000
3069 # Adding another flow will cause the one that expires soonest to be evicted.
3070 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
3071 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3072 idle_timeout=19, in_port=3 actions=drop
3073 idle_timeout=22, in_port=4 actions=drop
3074 in_port=5 actions=drop
3075 n_packets=1, n_bytes=14, idle_timeout=13, in_port=1 actions=drop
3081 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
3082 OVS_VSWITCHD_START([set bridge br0 other_config:hwaddr=00:01:02:03:04:05])
3083 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
3085 printf '\n\n--- check_async %d ---\n\n\n' $1
3088 ovs-appctl -t ovs-ofctl ofctl/barrier
3089 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3092 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
3093 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
3094 if test X"$1" = X"OFPR_ACTION"; then shift;
3095 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3096 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3099 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
3100 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
3101 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
3102 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
3103 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3106 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
3107 ovs-ofctl packet-out br0 "in_port=controller packet=002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00 actions=dec_ttl"
3108 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
3109 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
3110 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"
3113 # OFPT_PORT_STATUS, OFPPR_ADD
3114 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
3115 if test X"$1" = X"OFPPR_ADD"; then shift;
3116 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
3119 speed: 0 Mbps now, 0 Mbps max"
3122 # OFPT_PORT_STATUS, OFPPR_DELETE
3123 ovs-vsctl del-port br0 test
3124 if test X"$1" = X"OFPPR_DELETE"; then shift;
3125 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
3128 speed: 0 Mbps now, 0 Mbps max"
3131 # OFPT_FLOW_REMOVED, OFPRR_DELETE
3132 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
3133 ovs-ofctl --strict del-flows br0 ''
3134 if test X"$1" = X"OFPRR_DELETE"; then shift;
3135 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
3137 AT_FAIL_IF([test X"$1" != X])
3139 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3143 s/ (xid=0x[0-9a-fA-F]*)//
3145 s/00:0.$/00:0x/' < monitor.log]],
3149 # It's a service connection so initially there should be no async messages.
3152 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3153 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
3154 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3156 # Set miss_send_len to 128 and enable invalid_ttl.
3157 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
3158 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3160 # Become slave, which should disable everything except port status.
3161 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
3162 check_async 4 OFPPR_ADD OFPPR_DELETE
3164 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
3165 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
3166 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
3168 # Set controller ID 123.
3169 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
3170 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
3172 # Restore controller ID 0.
3173 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
3176 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
3177 check_async 7 OFPR_ACTION OFPPR_ADD
3179 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3183 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
3185 AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile])
3187 printf '\n\n--- check_async %d ---\n\n\n' $1
3191 ovs-appctl -t ovs-ofctl ofctl/barrier
3192 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3195 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
3196 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
3197 if test X"$1" = X"OFPR_ACTION"; then shift;
3198 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3199 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3202 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
3203 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
3204 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
3205 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
3206 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3209 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
3210 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
3211 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
3212 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
3213 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"
3216 # OFPT_PORT_STATUS, OFPPR_ADD
3217 ovs-vsctl add-port br0 test -- set Interface test type=dummy
3218 if test X"$1" = X"OFPPR_ADD"; then shift;
3219 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3222 speed: 0 Mbps now, 0 Mbps max
3223 OFPT_PORT_STATUS (OF1.2): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3226 speed: 0 Mbps now, 0 Mbps max"
3229 # OFPT_PORT_STATUS, OFPPR_DELETE
3230 ovs-vsctl del-port br0 test
3231 if test X"$1" = X"OFPPR_DELETE"; then shift;
3232 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3235 speed: 0 Mbps now, 0 Mbps max"
3238 # OFPT_FLOW_REMOVED, OFPRR_DELETE
3239 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
3240 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
3241 if test X"$1" = X"OFPRR_DELETE"; then shift;
3242 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
3244 AT_FAIL_IF([test X"$1" != X])
3246 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3250 s/ (xid=0x[0-9a-fA-F]*)//
3252 s/00:0.$/00:0x/' < monitor.log]],
3256 # It's a service connection so initially there should be no async messages.
3259 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3260 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
3261 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3263 # Set miss_send_len to 128 and enable invalid_ttl.
3264 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
3265 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3267 # Become slave (OF 1.2), which should disable everything except port status.
3268 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
3269 check_async 4 OFPPR_ADD OFPPR_DELETE
3271 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
3272 ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
3273 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
3275 # Set controller ID 123.
3276 ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
3277 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
3279 # Restore controller ID 0.
3280 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
3282 # Become master (OF 1.2).
3283 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
3284 check_async 7 OFPR_ACTION OFPPR_ADD
3286 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3290 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
3291 OVS_VSWITCHD_START([dnl
3292 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=10
3294 AT_CHECK([ovs-ofctl -O OpenFlow13 -P standard monitor br0 --detach --no-chdir --pidfile])
3296 printf '\n\n--- check_async %d ---\n\n\n' $1
3300 ovs-appctl -t ovs-ofctl ofctl/barrier
3301 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3304 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
3305 # OFPR_ACTION_SET is treated as OFPR_ACTION in OpenFlow 1.3
3306 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
3307 ovs-ofctl -O OpenFlow13 add-flow br0 'in_port=10 actions=write_actions(output(CONTROLLER))'
3308 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)'
3309 if test X"$1" = X"OFPR_ACTION"; then shift;
3310 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3311 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3312 echo >>expout "OFPT_PACKET_IN (OF1.3): cookie=0x0 total_len=14 in_port=10 (via action) data_len=14 (unbuffered)
3313 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3316 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
3317 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
3318 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
3319 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
3320 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3323 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
3324 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
3325 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
3326 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
3327 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"
3330 # OFPT_PORT_STATUS, OFPPR_ADD
3331 ovs-vsctl add-port br0 test -- set Interface test type=dummy
3332 if test X"$1" = X"OFPPR_ADD"; then shift;
3333 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3336 speed: 0 Mbps now, 0 Mbps max
3337 OFPT_PORT_STATUS (OF1.3): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3340 speed: 0 Mbps now, 0 Mbps max"
3343 # OFPT_PORT_STATUS, OFPPR_DELETE
3344 ovs-vsctl del-port br0 test
3345 if test X"$1" = X"OFPPR_DELETE"; then shift;
3346 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3349 speed: 0 Mbps now, 0 Mbps max"
3352 # OFPT_FLOW_REMOVED, OFPRR_DELETE
3353 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
3354 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
3355 if test X"$1" = X"OFPRR_DELETE"; then shift;
3356 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
3359 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
3360 ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10
3361 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234
3362 ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234
3363 if test X"$1" = X"OFPRR_GROUP_DELETE"; then shift;
3364 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=group_delete table_id=0"
3367 AT_FAIL_IF([test X"$1" != X])
3369 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3373 s/ (xid=0x[0-9a-fA-F]*)//
3375 s/00:0.$/00:0x/' < monitor.log]],
3379 # It's a service connection so initially there should be no async messages.
3382 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3383 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
3384 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
3386 # Become slave (OF 1.3), which should disable everything except port status.
3387 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
3388 check_async 3 OFPPR_ADD OFPPR_DELETE
3390 # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
3391 ovs-appctl -t ovs-ofctl ofctl/send 041c00200000000200000002000000050000000500000002000000020000000d
3392 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
3394 # Set controller ID 123.
3395 ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
3396 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
3398 # Restore controller ID 0.
3399 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
3401 # Become master (OF 1.3).
3402 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
3403 check_async 6 OFPR_ACTION OFPPR_ADD
3405 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3409 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.4)])
3410 OVS_VSWITCHD_START([dnl
3411 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=10
3413 AT_CHECK([ovs-ofctl -O OpenFlow14 -P standard monitor br0 --detach --no-chdir --pidfile])
3415 printf '\n\n--- check_async %d ---\n\n\n' $1
3419 ovs-appctl -t ovs-ofctl ofctl/barrier
3420 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3423 # OFPT_PACKET_IN, OFPR_PACKET_OUT (controller_id=0)
3424 ovs-ofctl -O OpenFlow14 -v packet-out br0 none controller '0001020304050010203040501234'
3425 if test X"$1" = X"OFPR_PACKET_OUT"; then shift;
3426 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via packet_out) data_len=14 (unbuffered)
3427 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3430 # OFPT_PACKET_IN, OFPR_ACTION_SET (controller_id=0)
3431 ovs-ofctl -O OpenFlow14 add-flow br0 'in_port=10 actions=write_actions(output(CONTROLLER))'
3432 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)'
3433 if test X"$1" = X"OFPR_ACTION_SET"; then shift;
3434 echo >>expout "OFPT_PACKET_IN (OF1.4): cookie=0x0 total_len=14 in_port=10 (via action_set) data_len=14 (unbuffered)
3435 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3438 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
3439 ovs-ofctl -O OpenFlow14 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
3440 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
3441 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
3442 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3445 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
3446 ovs-ofctl -O OpenFlow14 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
3447 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
3448 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
3449 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"
3452 # OFPT_PORT_STATUS, OFPPR_ADD
3453 ovs-vsctl add-port br0 test -- set Interface test type=dummy
3454 if test X"$1" = X"OFPPR_ADD"; then shift;
3455 echo >>expout "OFPT_PORT_STATUS (OF1.4): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3458 speed: 0 Mbps now, 0 Mbps max
3459 OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3462 speed: 0 Mbps now, 0 Mbps max"
3465 # OFPT_PORT_STATUS, OFPPR_MODIFY
3466 ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 test down
3467 if test X"$1" = X"OFPPR_MODIFY"; then shift;
3468 echo >>expout "OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3471 speed: 0 Mbps now, 0 Mbps max
3472 OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3475 speed: 0 Mbps now, 0 Mbps max"
3478 # OFPT_PORT_STATUS, OFPPR_DELETE
3479 ovs-vsctl del-port br0 test
3480 if test X"$1" = X"OFPPR_DELETE"; then shift;
3481 echo >>expout "OFPT_PORT_STATUS (OF1.4): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3484 speed: 0 Mbps now, 0 Mbps max"
3487 # OFPT_FLOW_REMOVED, OFPRR_DELETE
3488 ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=drop
3489 ovs-ofctl -O OpenFlow14 --strict del-flows br0 ''
3490 if test X"$1" = X"OFPRR_DELETE"; then shift;
3491 echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=delete table_id=0"
3494 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
3495 ovs-ofctl -O OpenFlow14 add-group br0 group_id=1234,type=all,bucket=output:10
3496 ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=group:1234
3497 ovs-ofctl -O OpenFlow14 --strict del-groups br0 group_id=1234
3498 if test X"$1" = X"OFPRR_GROUP_DELETE"; then shift;
3499 echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=group_delete table_id=0"
3502 # OFPT_TABLE_STATUS, OFPTR_VACANCY_UP
3503 if test X"$1" = X"OFPTR_VACANCY_UP"; then shift;
3504 ovs-vsctl -- --id=@t1 create Flow_Table flow-limit=10 -- set bridge br0 flow_tables:1=@t1
3506 # Turn on vacancy events, then add flows until we're full.
3507 # With initial vacancy of 100% and vacancy_up of 80%, so that
3508 # vacancy >= vacancy_up, this enables VACANY_DOWN events, so
3509 # we get a single such message when vacancy dips below 20%.
3510 ovs-ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80
3511 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2
3512 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2
3513 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2
3514 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2
3515 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2
3516 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2
3517 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2
3518 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2
3519 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2
3520 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2
3521 echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_DOWN
3524 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
3525 vacancy=on vacancy_down=20% vacancy_up=80% vacancy=10%"
3526 # Then delete flows until we're empty. Sending the
3527 # VACANCY_DOWN message enabled VACANCY_UP events, so we get a
3528 # single such message when vacancy rises above 80%.
3529 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1
3530 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2
3531 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3
3532 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4
3533 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5
3534 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6
3535 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7
3536 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8
3537 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9
3538 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10
3539 echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_UP
3542 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
3543 vacancy=on vacancy_down=20% vacancy_up=80% vacancy=90%"
3545 # Now approach vacancy from the other direction. First
3546 # disable vacancy events. With initial vacancy of 70%, so
3547 # that vacancy < vacancy_up, this enables VACANCY_UP events.
3548 # That means that filling up the table generates no message,
3549 # but deleting all the flows generates VACANCY_UP at the point
3550 # vacancy rises above 80%.
3551 ovs-ofctl -O OpenFlow14 mod-table br0 1 novacancy
3552 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2
3553 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2
3554 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2
3555 ovs-ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80
3556 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2
3557 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2
3558 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2
3559 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2
3560 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2
3561 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2
3562 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2
3563 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1
3564 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2
3565 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3
3566 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4
3567 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5
3568 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6
3569 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7
3570 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8
3571 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9
3572 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10
3573 echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_UP
3576 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
3577 vacancy=on vacancy_down=20% vacancy_up=80% vacancy=90%"
3580 AT_FAIL_IF([test X"$1" != X])
3584 s/ (xid=0x[[0-9a-fA-F]]*)//
3586 s/00:0.$/00:0x/' < monitor.log
3589 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`],
3590 [normalize_log | diff -u - expout])
3597 # It's a service connection so initially there should be no async messages.
3600 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3601 ovs-appctl -t ovs-ofctl ofctl/send 0509000c0123456700000080
3602 check_async 2 OFPR_PACKET_OUT OFPR_ACTION_SET OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
3604 # Become slave (OF 1.4), which should disable everything except port status.
3605 ovs-appctl -t ovs-ofctl ofctl/send 051800180000000200000003000000000000000000000001
3606 check_async 3 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
3608 # Use OF 1.4 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
3609 ovs-appctl -t ovs-ofctl ofctl/send 051c0040000000020000000800000005000100080000002000020008000000020003000800000005000400080000001c00050008000000050008000800000018
3610 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE OFPTR_VACANCY_UP
3612 # Set controller ID 123.
3613 ovs-appctl -t ovs-ofctl ofctl/send 05040018000000030000232000000014000000000000007b
3614 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
3616 # Restore controller ID 0.
3617 ovs-appctl -t ovs-ofctl ofctl/send 050400180000000300002320000000140000000000000000
3619 # Become master (OF 1.4).
3620 ovs-appctl -t ovs-ofctl ofctl/send 051800180000000400000002000000000000000000000002
3621 check_async 6 OFPR_PACKET_OUT OFPPR_ADD OFPPR_MODIFY OFPRR_DELETE
3623 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3627 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.5)])
3629 AT_CHECK([ovs-ofctl -O OpenFlow15 -P standard monitor br0 --detach --no-chdir --pidfile])
3631 printf '\n\n--- check_async %d ---\n\n\n' $1
3635 ovs-appctl -t ovs-ofctl ofctl/barrier
3636 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3639 # Other tests are not working with OF 1.5, and message
3640 # format may change, so leave them out.
3642 # OFPT_PORT_STATUS, OFPPR_ADD
3643 ovs-vsctl add-port br0 test -- set Interface test type=dummy
3644 if test X"$1" = X"OFPPR_ADD"; then shift;
3645 echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3648 speed: 0 Mbps now, 0 Mbps max
3649 OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3652 speed: 0 Mbps now, 0 Mbps max"
3655 # OFPT_PORT_STATUS, OFPPR_MODIFY
3656 ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test down
3657 if test X"$1" = X"OFPPR_MODIFY"; then shift;
3658 echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3661 speed: 0 Mbps now, 0 Mbps max
3662 OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3665 speed: 0 Mbps now, 0 Mbps max"
3668 # OFPT_PORT_STATUS, OFPPR_DELETE
3669 ovs-vsctl del-port br0 test
3670 if test X"$1" = X"OFPPR_DELETE"; then shift;
3671 echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3674 speed: 0 Mbps now, 0 Mbps max"
3677 AT_FAIL_IF([test X"$1" != X])
3679 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3683 s/ (xid=0x[0-9a-fA-F]*)//
3685 s/00:0.$/00:0x/' < monitor.log]],
3689 # It's a service connection so initially there should be no async messages.
3692 # If we don't set this, async messages are not received.
3693 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3694 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
3695 check_async 2 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
3697 # Set-async has changed in OF 1.4 and is not yet implemented.
3699 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3703 dnl This test checks that the role request/response messaging works
3704 dnl and that generation_id is handled properly.
3705 AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
3707 on_exit 'kill `cat c1.pid c2.pid`'
3709 # Start two ovs-ofctl controller processes.
3710 AT_CAPTURE_FILE([monitor1.log])
3711 AT_CAPTURE_FILE([expout1])
3712 AT_CAPTURE_FILE([experr1])
3713 AT_CAPTURE_FILE([monitor2.log])
3714 AT_CAPTURE_FILE([expout2])
3715 AT_CAPTURE_FILE([experr2])
3717 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=c$i.pid --unixctl=c$i])
3718 ovs-appctl -t `pwd`/c$i ofctl/barrier
3719 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
3723 # find out current role
3724 ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000
3725 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange"
3726 echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
3729 # controller 1: Become slave (generation_id is initially undefined, so
3730 # 2^63+2 should not be stale)
3731 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
3732 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
3733 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
3735 # controller 2: Become master.
3736 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
3737 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
3738 echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
3740 # controller 1: Try to become the master using a stale generation ID
3741 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
3742 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
3743 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
3744 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
3746 # controller 1: Become master using a valid generation ID
3747 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
3748 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
3749 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
3752 ovs-appctl -t `pwd`/c$i ofctl/barrier
3753 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):"
3759 AT_CHECK([grep -v '^send:' monitor$i.log | strip_xids], [0], [expout])
3761 AT_CHECK([grep '^send:' monitor$i.log | strip_xids], [0], [expout])
3766 dnl This test checks that the role request/response messaging works,
3767 dnl that generation_id is handled properly, and that role status update
3768 dnl messages are sent when a controller's role gets changed from master
3770 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
3772 on_exit 'kill `cat c1.pid c2.pid`'
3774 # Start two ovs-ofctl controller processes.
3775 AT_CAPTURE_FILE([monitor1.log])
3776 AT_CAPTURE_FILE([expout1])
3777 AT_CAPTURE_FILE([experr1])
3778 AT_CAPTURE_FILE([monitor2.log])
3779 AT_CAPTURE_FILE([expout2])
3780 AT_CAPTURE_FILE([experr2])
3782 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=c$i.pid --unixctl=c$i])
3783 ovs-appctl -t `pwd`/c$i ofctl/barrier
3784 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
3788 # find out current role
3789 ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000
3790 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange"
3791 echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
3794 # controller 1: Become slave (generation_id is initially undefined, so
3795 # 2^63+2 should not be stale)
3796 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
3797 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
3798 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
3800 # controller 2: Become master.
3801 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
3802 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
3803 echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
3805 # controller 1: Try to become the master using a stale generation ID
3806 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
3807 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
3808 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
3809 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
3811 # controller 1: Become master using a valid generation ID
3812 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
3813 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
3814 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
3815 echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
3818 ovs-appctl -t `pwd`/c$i ofctl/barrier
3819 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):"
3825 AT_CHECK([grep -v '^send:' monitor$i.log | strip_xids], [0], [expout])
3827 AT_CHECK([grep '^send:' monitor$i.log | strip_xids], [0], [expout])
3832 dnl This test checks that the role request/response messaging works,
3833 dnl that generation_id is handled properly, and that role status update
3834 dnl messages are sent when a controller's role gets changed from master
3836 AT_SETUP([ofproto - controller role (OpenFlow 1.3)])
3838 on_exit 'kill `cat c1.pid c2.pid`'
3840 # Start two ovs-ofctl controller processes.
3841 AT_CAPTURE_FILE([monitor1.log])
3842 AT_CAPTURE_FILE([expout1])
3843 AT_CAPTURE_FILE([experr1])
3844 AT_CAPTURE_FILE([monitor2.log])
3845 AT_CAPTURE_FILE([expout2])
3846 AT_CAPTURE_FILE([experr2])
3848 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile=c$i.pid --unixctl=c$i])
3849 ovs-appctl -t `pwd`/c$i ofctl/barrier
3850 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
3854 # find out current role
3855 ovs-appctl -t `pwd`/c$i ofctl/send 041800180000000200000000000000000000000000000000
3856 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.3): role=nochange"
3857 echo >>expout$i "OFPT_ROLE_REPLY (OF1.3): role=equal"
3860 # controller 1: Become slave (generation_id is initially undefined, so
3861 # 2^63+2 should not be stale)
3862 ovs-appctl -t `pwd`/c1 ofctl/send 041800180000000300000003000000008000000000000002
3863 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.3): role=slave generation_id=9223372036854775810"
3864 echo >>expout1 "OFPT_ROLE_REPLY (OF1.3): role=slave generation_id=9223372036854775810"
3866 # controller 2: Become master.
3867 ovs-appctl -t `pwd`/c2 ofctl/send 041800180000000300000002000000008000000000000003
3868 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.3): role=master generation_id=9223372036854775811"
3869 echo >>expout2 "OFPT_ROLE_REPLY (OF1.3): role=master generation_id=9223372036854775811"
3871 # controller 1: Try to become the master using a stale generation ID
3872 ovs-appctl -t `pwd`/c1 ofctl/send 041800180000000400000002000000000000000000000003
3873 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.3): role=master generation_id=3"
3874 echo >>expout1 "OFPT_ERROR (OF1.3): OFPRRFC_STALE"
3875 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.3): role=master generation_id=3"
3877 # controller 1: Become master using a valid generation ID
3878 ovs-appctl -t `pwd`/c1 ofctl/send 041800180000000500000002000000000000000000000001
3879 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.3): role=master generation_id=1"
3880 echo >>expout1 "OFPT_ROLE_REPLY (OF1.3): role=master generation_id=1"
3881 echo >>expout2 "ONFT_ROLE_STATUS (OF1.3): role=slave generation_id=1 reason=master_request"
3884 ovs-appctl -t `pwd`/c$i ofctl/barrier
3885 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.3):"
3891 AT_CHECK([grep -v '^send:' monitor$i.log | strip_xids], [0], [expout])
3893 AT_CHECK([grep '^send:' monitor$i.log | strip_xids], [0], [expout])
3898 dnl This test checks the Group and meter notifications when a group mod
3899 dnl command is sent from one controller and the reply is received by
3900 dnl other controllers.
3901 AT_SETUP([ofproto - requestforward (OpenFlow 1.4)])
3903 on_exit 'kill `cat c1.pid c2.pid c3.pid`'
3905 # Start two ovs-ofctl controller processes.
3906 AT_CAPTURE_FILE([monitor1.log])
3907 AT_CAPTURE_FILE([expout1])
3908 AT_CAPTURE_FILE([monitor2.log])
3909 AT_CAPTURE_FILE([expout2])
3910 AT_CAPTURE_FILE([monitor3.log])
3911 AT_CAPTURE_FILE([expout3])
3913 ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile=c1.pid --unixctl=c1
3914 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=c2.pid --unixctl=c2
3915 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=c3.pid --unixctl=c3
3919 ovs-appctl -t `pwd`/c$i ofctl/barrier
3920 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
3924 printf '\n\n--- check_async %d ---\n\n\n' $1
3929 ovs-appctl -t `pwd`/c2 ofctl/send "050f0020000000020000000000000001 00100000 ffffffffffffffff 00000000"
3930 if test X"$1" = X"OFPGC_ADD"; then shift;
3931 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
3932 ADD group_id=1,type=all,bucket=actions=drop"
3933 echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
3934 ADD group_id=1,type=all,bucket=bucket_id:0,actions=drop"
3935 echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
3936 ADD group_id=1,type=all,bucket=actions=drop"
3940 ovs-appctl -t `pwd`/c2 ofctl/send "050f0020000000020001010000000001 00100000 ffffffffffffffff 00000000"
3941 if test X"$1" = X"OFPGC_MODIFY"; then shift;
3942 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
3943 MOD group_id=1,type=select,bucket=weight:0,actions=drop"
3944 echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
3945 MOD group_id=1,type=select,bucket=bucket_id:0,weight:0,actions=drop"
3946 echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
3947 MOD group_id=1,type=select,bucket=weight:0,actions=drop"
3950 ovs-appctl -t `pwd`/c1 ofctl/barrier
3951 echo >>expout1 "OFPT_BARRIER_REPLY (OF1.5):"
3952 ovs-appctl -t `pwd`/c2 ofctl/barrier
3953 echo >>expout2 "OFPT_BARRIER_REPLY (OF1.4):"
3954 ovs-appctl -t `pwd`/c3 ofctl/barrier
3955 echo >>expout3 "OFPT_BARRIER_REPLY (OF1.4):"
3962 s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
3967 # controller 1: Become slave
3968 ovs-appctl -t `pwd`/c1 ofctl/send 061800180000000300000003000000008000000000000002
3970 # controller 2: Become master
3971 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
3973 # controller 1: Become slave
3974 ovs-appctl -t `pwd`/c3 ofctl/send 051800180000000300000003000000008000000000000004
3976 # controller 1: Enabled requestforward using set Asynchronous message
3977 ovs-appctl -t `pwd`/c1 ofctl/send 061c00280000000200000008000000050002000800000002000400080000001a000a000800000003
3979 # controller 2: Enabled requestforward using set Asynchronous message
3980 ovs-appctl -t `pwd`/c2 ofctl/send 051c002800000002000100080000000200030008000000050005000800000005000b000800000003
3982 # controller 1: Enabled requestforward using set Asynchronous message
3983 ovs-appctl -t `pwd`/c3 ofctl/send 051c00280000000200000008000000050002000800000002000400080000001a000a000800000003
3984 check_async 1 OFPGC_ADD OFPGC_MODIFY
3989 dnl This test checks the backwards compatibility of the NXT_REQUESTFORWARD
3990 dnl message type to OpenFlow 1.0, also relying on the Nicira Extensions:
3991 dnl NXT_GROUP_MOD, NXT_ROLE_REQUEST, and OFPRAW_NXT_SET_ASYNC_CONFIG2,
3992 dnl while also testing the functionality of the previous test.
3993 AT_SETUP([ofproto - NXT requestforward (OpenFlow 1.0)])
3995 on_exit 'kill `cat c1.pid c2.pid c3.pid`'
3997 # Start two ovs-ofctl controller processes.
3998 AT_CAPTURE_FILE([monitor1.log])
3999 AT_CAPTURE_FILE([expout1])
4000 AT_CAPTURE_FILE([monitor2.log])
4001 AT_CAPTURE_FILE([expout2])
4002 AT_CAPTURE_FILE([monitor3.log])
4003 AT_CAPTURE_FILE([expout3])
4005 ovs-ofctl -O OpenFlow10 monitor br0 --detach --no-chdir --pidfile=c1.pid --unixctl=c1
4006 ovs-ofctl -O OpenFlow10 monitor br0 --detach --no-chdir --pidfile=c2.pid --unixctl=c2
4007 ovs-ofctl -O OpenFlow10 monitor br0 --detach --no-chdir --pidfile=c3.pid --unixctl=c3
4011 ovs-appctl -t `pwd`/c$i ofctl/barrier
4012 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
4016 printf '\n\n--- check_async %d ---\n\n\n' $1
4021 # NXT_GROUP_MOD (xid=0x2):
4022 # ADD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:100,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:200,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:200,watch_port:3,actions=output:3
4023 ovs-appctl -t `pwd`/c2 ofctl/send "01 04 00 a8 00 00 00 02 00 00 23 20 00 00 00 1f 00 00 01 00 87 65 43 21 00 60 00 00 ff ff ff ff 00 20 00 08 00 00 00 00 00 00 00 08 00 01 00 00 00 00 00 08 00 64 00 00 00 01 00 08 00 00 00 01 00 20 00 08 00 00 00 01 00 00 00 08 00 02 00 00 00 00 00 08 00 c8 00 00 00 01 00 08 00 00 00 02 00 20 00 08 00 00 00 02 00 00 00 08 00 03 00 00 00 00 00 08 00 c8 00 00 00 01 00 08 00 00 00 03 ff ff 00 28 00 00 15 40 00 00 00 01 00 00 00 00 68 61 73 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07"
4024 if test X"$1" = X"OFPGC_ADD"; then shift;
4025 echo >>expout2 "send: NXT_GROUP_MOD:
4026 ADD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:100,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:200,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:200,watch_port:3,actions=output:3"
4027 echo >>expout1 "NXT_REQUESTFORWARD: reason=group_mod
4028 ADD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:100,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:200,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:200,watch_port:3,actions=output:3"
4029 echo >>expout3 "NXT_REQUESTFORWARD: reason=group_mod
4030 ADD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:100,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:200,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:200,watch_port:3,actions=output:3"
4034 # NXT_GROUP_MOD (xid=0x2):
4035 # MOD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:150,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:150,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:150,watch_port:3,actions=output:3
4036 ovs-appctl -t `pwd`/c2 ofctl/send "01 04 00 a8 00 00 00 02 00 00 23 20 00 00 00 1f 00 01 01 00 87 65 43 21 00 60 00 00 ff ff ff ff 00 20 00 08 00 00 00 00 00 00 00 08 00 01 00 00 00 00 00 08 00 96 00 00 00 01 00 08 00 00 00 01 00 20 00 08 00 00 00 01 00 00 00 08 00 02 00 00 00 00 00 08 00 96 00 00 00 01 00 08 00 00 00 02 00 20 00 08 00 00 00 02 00 00 00 08 00 03 00 00 00 00 00 08 00 96 00 00 00 01 00 08 00 00 00 03 ff ff 00 28 00 00 15 40 00 00 00 01 00 00 00 00 68 61 73 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07"
4037 if test X"$1" = X"OFPGC_MODIFY"; then shift;
4038 echo >>expout2 "send: NXT_GROUP_MOD:
4039 MOD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:150,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:150,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:150,watch_port:3,actions=output:3"
4040 echo >>expout1 "NXT_REQUESTFORWARD: reason=group_mod
4041 MOD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:150,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:150,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:150,watch_port:3,actions=output:3"
4042 echo >>expout3 "NXT_REQUESTFORWARD: reason=group_mod
4043 MOD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:150,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:150,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:150,watch_port:3,actions=output:3"
4046 ovs-appctl -t `pwd`/c1 ofctl/barrier
4047 echo >>expout1 "OFPT_BARRIER_REPLY:"
4048 ovs-appctl -t `pwd`/c2 ofctl/barrier
4049 echo >>expout2 "OFPT_BARRIER_REPLY:"
4050 ovs-appctl -t `pwd`/c3 ofctl/barrier
4051 echo >>expout3 "OFPT_BARRIER_REPLY:"
4058 s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
4063 # controller 1: Become slave
4064 # NXT_ROLE_REQUEST (xid=0x3): role=slave
4065 ovs-appctl -t `pwd`/c1 ofctl/send 0104001400000003000023200000000a00000002
4067 # controller 2: Become master
4068 # NXT_ROLE_REQUEST (xid=0x3): role=master
4069 ovs-appctl -t `pwd`/c2 ofctl/send 0104001400000003000023200000000a00000001
4071 # controller 1: Become slave
4072 # NXT_ROLE_REQUEST (xid=0x3): role=slave
4073 ovs-appctl -t `pwd`/c3 ofctl/send 0104001400000003000023200000000a00000002
4075 # controller 1: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2
4076 ovs-appctl -t `pwd`/c1 ofctl/send 0104003000000002000023200000001b00000008000000050002000800000002000400080000001a000a000800000003
4078 # controller 2: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2
4079 ovs-appctl -t `pwd`/c2 ofctl/send 0104003000000002000023200000001b000100080000000200030008000000050005000800000005000b000800000003
4081 # controller 1: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2
4082 ovs-appctl -t `pwd`/c3 ofctl/send 0104003000000002000023200000001b00000008000000050002000800000002000400080000001a000a000800000003
4083 check_async 1 OFPGC_ADD OFPGC_MODIFY
4088 dnl This test checks the Group and meter notifications when a group mod
4089 dnl command is sent from one controller and the reply is received by
4090 dnl other controllers, using the ONF Extension for OF 1.3.
4091 AT_SETUP([ofproto - ONF requestforward (OpenFlow 1.3)])
4093 on_exit 'kill `cat c1.pid c2.pid c3.pid`'
4095 # Start two ovs-ofctl controller processes.
4096 AT_CAPTURE_FILE([monitor1.log])
4097 AT_CAPTURE_FILE([expout1])
4098 AT_CAPTURE_FILE([monitor2.log])
4099 AT_CAPTURE_FILE([expout2])
4100 AT_CAPTURE_FILE([monitor3.log])
4101 AT_CAPTURE_FILE([expout3])
4103 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile=c1.pid --unixctl=c1
4104 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile=c2.pid --unixctl=c2
4105 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile=c3.pid --unixctl=c3
4109 ovs-appctl -t `pwd`/c$i ofctl/barrier
4110 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
4114 printf '\n\n--- check_async %d ---\n\n\n' $1
4119 # OFPT_GROUP_MOD (OF1.3) (xid=0x2):
4120 # ADD group_id=1,type=all,bucket=actions=drop
4121 ovs-appctl -t `pwd`/c2 ofctl/send "040f0020000000020000000000000001 00100000 ffffffffffffffff 00000000"
4122 if test X"$1" = X"OFPGC_ADD"; then shift;
4123 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.3):
4124 ADD group_id=1,type=all,bucket=actions=drop"
4125 echo >>expout1 "ONFT_REQUESTFORWARD (OF1.3): reason=group_mod
4126 ADD group_id=1,type=all,bucket=actions=drop"
4127 echo >>expout3 "ONFT_REQUESTFORWARD (OF1.3): reason=group_mod
4128 ADD group_id=1,type=all,bucket=actions=drop"
4132 # OFPT_GROUP_MOD (OF1.3) (xid=0x2):
4133 # MOD group_id=1,type=select,bucket=weight:0,actions=drop
4134 ovs-appctl -t `pwd`/c2 ofctl/send "040f0020000000020001010000000001 00100000 ffffffffffffffff 00000000"
4135 if test X"$1" = X"OFPGC_MODIFY"; then shift;
4136 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.3):
4137 MOD group_id=1,type=select,bucket=weight:0,actions=drop"
4138 echo >>expout1 "ONFT_REQUESTFORWARD (OF1.3): reason=group_mod
4139 MOD group_id=1,type=select,bucket=weight:0,actions=drop"
4140 echo >>expout3 "ONFT_REQUESTFORWARD (OF1.3): reason=group_mod
4141 MOD group_id=1,type=select,bucket=weight:0,actions=drop"
4144 ovs-appctl -t `pwd`/c1 ofctl/barrier
4145 echo >>expout1 "OFPT_BARRIER_REPLY (OF1.3):"
4146 ovs-appctl -t `pwd`/c2 ofctl/barrier
4147 echo >>expout2 "OFPT_BARRIER_REPLY (OF1.3):"
4148 ovs-appctl -t `pwd`/c3 ofctl/barrier
4149 echo >>expout3 "OFPT_BARRIER_REPLY (OF1.3):"
4156 s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
4161 # controller 1: Become slave
4162 # OFPT_ROLE_REQUEST (OF1.3) (xid=0x3): role=slave
4163 ovs-appctl -t `pwd`/c1 ofctl/send 041800180000000300000003000000008000000000000002
4165 # controller 2: Become master
4166 # OFPT_ROLE_REQUEST (OF1.3) (xid=0x3): role=master
4167 ovs-appctl -t `pwd`/c2 ofctl/send 041800180000000300000002000000008000000000000003
4169 # controller 1: Become slave
4170 # OFPT_ROLE_REQUEST (OF1.3) (xid=0x3): role=slave
4171 ovs-appctl -t `pwd`/c3 ofctl/send 041800180000000300000003000000008000000000000004
4173 # controller 1: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2 (necessary for OF1.3)
4174 ovs-appctl -t `pwd`/c1 ofctl/send 0404003000000002000023200000001b00000008000000050002000800000002000400080000001a000a000800000003
4176 # controller 2: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2 (necessary for OF1.3)
4177 ovs-appctl -t `pwd`/c2 ofctl/send 0404003000000002000023200000001b000100080000000200030008000000050005000800000005000b000800000003
4179 # controller 1: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2 (necessary for OF1.3)
4180 ovs-appctl -t `pwd`/c3 ofctl/send 0404003000000002000023200000001b00000008000000050002000800000002000400080000001a000a000800000003
4181 check_async 1 OFPGC_ADD OFPGC_MODIFY
4188 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
4189 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
4190 dnl controllers despite the spec) as meaning a packet that was generated
4191 dnl by the controller.
4192 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
4196 # Start a monitor listening for packet-ins.
4197 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
4198 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
4199 ovs-appctl -t ovs-ofctl ofctl/barrier
4200 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4201 AT_CAPTURE_FILE([monitor.log])
4203 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
4204 AT_CHECK([ovs-ofctl packet-out br0 "in_port=none packet=0001020304050010203040501234 actions=controller,1"])
4205 AT_CHECK([ovs-ofctl packet-out br0 "in_port=controller packet=0001020304050010203040505678 actions=controller,1"])
4207 # Stop the monitor and check its output.
4208 ovs-appctl -t ovs-ofctl ofctl/barrier
4209 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4211 ovs-ofctl dump-ports br0
4213 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4214 OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
4215 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4216 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4217 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
4224 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
4225 dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
4226 dnl controllers despite the spec) as meaning a packet that was generated
4227 dnl by the controller.
4228 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
4231 # Start a monitor listening for packet-ins.
4232 AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile])
4233 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
4234 ovs-appctl -t ovs-ofctl ofctl/barrier
4235 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4236 AT_CAPTURE_FILE([monitor.log])
4238 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
4239 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
4240 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
4242 # Stop the monitor and check its output.
4243 ovs-appctl -t ovs-ofctl ofctl/barrier
4244 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4246 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4247 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
4248 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4249 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4250 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
4251 OFPT_BARRIER_REPLY (OF1.2):
4257 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
4258 dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some
4259 dnl controllers despite the spec) as meaning a packet that was generated
4260 dnl by the controller.
4261 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)])
4264 # Start a monitor listening for packet-ins.
4265 AT_CHECK([ovs-ofctl -O OpenFlow11 -P standard monitor br0 --detach --no-chdir --pidfile])
4266 ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080
4267 ovs-appctl -t ovs-ofctl ofctl/barrier
4268 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4269 AT_CAPTURE_FILE([monitor.log])
4271 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER as in_port.
4272 AT_CHECK([ovs-appctl -t ovs-ofctl ofctl/packet-out "in_port=none, packet=0001020304050010203040501234 actions=controller"])
4273 AT_CHECK([ovs-appctl -t ovs-ofctl ofctl/packet-out "in_port=controller packet=0001020304050010203040505678 actions=controller"])
4275 # Stop the monitor and check its output.
4276 ovs-appctl -t ovs-ofctl ofctl/barrier
4277 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4279 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//
4280 /PACKET_OUT/d' monitor.log], [0], [dnl
4281 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
4282 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4283 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4284 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
4285 OFPT_BARRIER_REPLY (OF1.1):
4291 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.5)])
4294 # Start a monitor listening for packet-ins.
4295 AT_CHECK([ovs-ofctl -O OpenFlow15 -P standard monitor br0 --detach --no-chdir --pidfile])
4296 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
4297 ovs-appctl -t ovs-ofctl ofctl/barrier
4298 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4299 AT_CAPTURE_FILE([monitor.log])
4301 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
4302 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=none tun_id=0x11 metadata=0x22 packet=0001020304050010203040501234 actions=controller"])
4303 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=controller tun_id=0x11 metadata=0x33 packet=0001020304050010203040505678 actions=controller"])
4305 # Stop the monitor and check its output.
4306 ovs-appctl -t ovs-ofctl ofctl/barrier
4307 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4309 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4310 OFPT_PACKET_IN (OF1.5): total_len=14 tun_id=0x11,metadata=0x22,in_port=ANY (via packet_out) data_len=14 (unbuffered)
4311 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4312 OFPT_PACKET_IN (OF1.5): total_len=14 tun_id=0x11,metadata=0x33,in_port=CONTROLLER (via packet_out) data_len=14 (unbuffered)
4313 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
4314 OFPT_BARRIER_REPLY (OF1.5):
4320 dnl This test checks that metadata and userdata are encoded in NXT_PACKET_IN2.
4321 AT_SETUP([ofproto - packet-out with metadata and userdata (NXT_PACKET_IN2)])
4324 # Start a monitor listening for packet-ins.
4325 AT_CHECK([ovs-ofctl -P nxt_packet_in2 monitor br0 --detach --no-chdir --pidfile])
4326 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
4327 ovs-appctl -t ovs-ofctl ofctl/barrier
4328 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4329 AT_CAPTURE_FILE([monitor.log])
4331 # Send a packet-out with a load action to set some metadata, and forward to controller
4332 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)"])
4334 # Stop the monitor and check its output.
4335 ovs-appctl -t ovs-ofctl ofctl/barrier
4336 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4338 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4339 NXT_PACKET_IN2: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4340 userdata=01.02.03.04.05
4341 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4348 dnl This test checks that 1.5 packet_out is properly encoded/decoded.
4349 AT_SETUP([ofproto - packet-out with set_field metadata (OpenFlow 1.5)])
4352 # Start a monitor listening for packet-ins.
4353 AT_CHECK([ovs-ofctl -P standard -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
4354 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
4355 ovs-appctl -t ovs-ofctl ofctl/barrier
4356 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4357 AT_CAPTURE_FILE([monitor.log])
4359 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
4360 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 CONTROLLER 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234'])
4362 # Stop the monitor and check its output.
4363 ovs-appctl -t ovs-ofctl ofctl/barrier
4364 ovs-appctl -t ovs-ofctl exit
4366 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4367 OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4368 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4369 OFPT_BARRIER_REPLY (OF1.3):
4375 dnl This test checks that packet_type PT_ETH is properly encoded/decoded in 1.5 packet_out.
4376 AT_SETUP([ofproto - packet-out with set_field metadata with packet_type PT_ETH (OpenFlow 1.5)])
4379 # Start a monitor listening for packet-ins.
4380 AT_CHECK([ovs-ofctl -P standard -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
4381 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
4382 ovs-appctl -t ovs-ofctl ofctl/barrier
4383 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4384 AT_CAPTURE_FILE([monitor.log])
4386 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
4387 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=controller packet=0001020304050010203040501234 packet_type(0,0x0) actions=set_field:0xfafafafa5a5a5a5a->metadata,controller"])
4389 # Stop the monitor and check its output.
4390 ovs-appctl -t ovs-ofctl ofctl/barrier
4391 ovs-appctl -t ovs-ofctl exit
4393 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4394 OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4395 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4396 OFPT_BARRIER_REPLY (OF1.3):
4402 dnl This test checks that packet_type PT_IPV4 is properly encoded/decoded in 1.5 packet_out.
4403 AT_SETUP([ofproto - packet-out with set_field metadata with packet_type PT_IPV4 on PTAP bridge (OpenFlow 1.5)])
4406 # Start a monitor listening for packet-ins.
4407 AT_CHECK([ovs-ofctl -P standard -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
4408 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
4409 ovs-appctl -t ovs-ofctl ofctl/barrier
4410 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4411 AT_CAPTURE_FILE([monitor.log])
4413 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
4414 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=controller packet=4500002012344000ff1155670a0000140a00001e006400c8000cea78ffffffff packet_type(1,0x800) actions=set_field:0xfafafafa5a5a5a5a->metadata,controller"])
4416 # Stop the monitor and check its output.
4417 ovs-appctl -t ovs-ofctl ofctl/barrier
4418 ovs-appctl -t ovs-ofctl exit
4420 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4421 OFPT_PACKET_IN (OF1.3): total_len=32 packet_type=(1,0x800),metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=32 (unbuffered)
4422 packet_type=(1,0x800),nw_src=10.0.0.20,nw_dst=10.0.0.30,nw_proto=17,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=100,tp_dst=200 udp_csum:ea78
4423 OFPT_BARRIER_REPLY (OF1.3):
4429 dnl This test checks that metadata is encoded in packet_in structures,
4430 dnl supported by NXAST.
4431 AT_SETUP([ofproto - packet-out with metadata (NXM)])
4434 # Start a monitor listening for packet-ins.
4435 AT_CHECK([ovs-ofctl -P nxt_packet_in monitor br0 --detach --no-chdir --pidfile])
4436 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
4437 ovs-appctl -t ovs-ofctl ofctl/barrier
4438 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4439 AT_CAPTURE_FILE([monitor.log])
4441 # Send a packet-out with a load action to set some metadata, and forward to controller
4442 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"])
4444 # Stop the monitor and check its output.
4445 ovs-appctl -t ovs-ofctl ofctl/barrier
4446 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4448 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4449 NXT_PACKET_IN: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4450 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4457 dnl This test checks that metadata is encoded in packet_in structures,
4458 dnl supported by NXAST.
4459 AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
4462 # Start a monitor listening for packet-ins.
4463 AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile])
4464 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
4465 ovs-appctl -t ovs-ofctl ofctl/barrier
4466 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4467 AT_CAPTURE_FILE([monitor.log])
4469 # Send a packet-out with a set-field action to set some metadata, and forward to controller
4470 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234'])
4472 # Stop the monitor and check its output.
4473 ovs-appctl -t ovs-ofctl ofctl/barrier
4474 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4476 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4477 OFPT_PACKET_IN (OF1.2): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=ANY (via action) data_len=14 (unbuffered)
4478 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4479 OFPT_BARRIER_REPLY (OF1.2):
4485 dnl This test checks that metadata is encoded in packet_in structures,
4486 dnl supported by NXAST.
4487 AT_SETUP([ofproto - packet-out with metadata and dual set_field (OpenFlow 1.3)])
4490 # Start a monitor listening for packet-ins.
4491 AT_CHECK([ovs-ofctl -O OpenFlow13 -P standard monitor br0 --detach --no-chdir --pidfile])
4492 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
4493 ovs-appctl -t ovs-ofctl ofctl/barrier
4494 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4495 AT_CAPTURE_FILE([monitor.log])
4497 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
4498 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, set_field:0x6b->metadata, controller' '0001020304050010203040501234'])
4500 # Stop the monitor and check its output.
4501 ovs-appctl -t ovs-ofctl ofctl/barrier
4502 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4504 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4505 OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0x6b,in_port=ANY (via action) data_len=14 (unbuffered)
4506 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4507 OFPT_BARRIER_REPLY (OF1.3):
4513 dnl This test checks that tunnel metadata is encoded in packet_in structures.
4514 AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
4517 # Start a monitor listening for packet-ins.
4518 AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile])
4519 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
4520 ovs-appctl -t ovs-ofctl ofctl/barrier
4521 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4522 AT_CAPTURE_FILE([monitor.log])
4524 # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
4525 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'])
4527 # Stop the monitor and check its output.
4528 ovs-appctl -t ovs-ofctl ofctl/barrier
4529 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4531 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4532 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)
4533 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4534 OFPT_BARRIER_REPLY (OF1.2):
4540 m4_divert_push([PREPARE_TESTS])
4541 # Sorts groups of lines that start with a space, without moving them
4542 # past the nearest line that does not start with a space.
4550 line = sys.stdin.readline()
4553 if line.startswith(" "):
4556 sys.stdout.write("".join(sorted(buffer)))
4557 sys.stdout.write(line)
4559 sys.stdout.write("".join(sorted(buffer)))
4563 m4_divert_pop([PREPARE_TESTS])
4565 AT_SETUP([ofproto - flow monitoring])
4566 AT_KEYWORDS([monitor])
4569 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
4571 # Start a monitor watching the flow table and check the initial reply.
4572 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
4573 AT_CAPTURE_FILE([monitor.log])
4574 ovs-appctl -t ovs-ofctl ofctl/barrier
4575 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4576 [NXST_FLOW_MONITOR reply:
4577 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
4581 # Add, delete, and modify some flows and check the updates.
4582 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4583 ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
4584 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
4585 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
4586 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
4587 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
4588 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
4589 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
4590 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
4591 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
4592 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
4593 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
4594 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
4595 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
4596 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
4597 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
4598 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
4599 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
4600 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
4601 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
4602 ovs-ofctl add-flow br0 in_port=0,actions=output:23
4603 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
4604 ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
4605 ovs-ofctl del-flows br0 dl_vlan=123
4606 ovs-ofctl del-flows br0
4607 ovs-appctl -t ovs-ofctl ofctl/barrier
4608 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
4609 [NXST_FLOW_MONITOR reply (xid=0x0):
4610 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
4611 NXST_FLOW_MONITOR reply (xid=0x0):
4612 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
4613 NXST_FLOW_MONITOR reply (xid=0x0):
4614 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
4615 NXST_FLOW_MONITOR reply (xid=0x0):
4616 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
4617 NXST_FLOW_MONITOR reply (xid=0x0):
4618 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
4619 NXST_FLOW_MONITOR reply (xid=0x0):
4620 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
4621 NXST_FLOW_MONITOR reply (xid=0x0):
4622 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
4623 NXST_FLOW_MONITOR reply (xid=0x0):
4624 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
4625 NXST_FLOW_MONITOR reply (xid=0x0):
4626 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
4627 NXST_FLOW_MONITOR reply (xid=0x0):
4628 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
4629 NXST_FLOW_MONITOR reply (xid=0x0):
4630 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
4631 NXST_FLOW_MONITOR reply (xid=0x0):
4632 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
4633 NXST_FLOW_MONITOR reply (xid=0x0):
4634 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
4635 NXST_FLOW_MONITOR reply (xid=0x0):
4636 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
4637 NXST_FLOW_MONITOR reply (xid=0x0):
4638 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
4639 NXST_FLOW_MONITOR reply (xid=0x0):
4640 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
4641 NXST_FLOW_MONITOR reply (xid=0x0):
4642 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
4643 NXST_FLOW_MONITOR reply (xid=0x0):
4644 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
4645 NXST_FLOW_MONITOR reply (xid=0x0):
4646 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
4647 NXST_FLOW_MONITOR reply (xid=0x0):
4648 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
4649 NXST_FLOW_MONITOR reply (xid=0x0):
4650 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
4651 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
4652 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
4653 NXST_FLOW_MONITOR reply (xid=0x0):
4654 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
4655 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
4656 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
4657 NXST_FLOW_MONITOR reply (xid=0x0):
4658 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
4659 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
4660 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
4661 NXST_FLOW_MONITOR reply (xid=0x0):
4662 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
4663 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
4664 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
4665 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
4666 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
4667 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
4668 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
4669 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
4670 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
4671 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
4672 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
4676 # Check that our own changes are reported as full updates.
4677 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4678 ovs-ofctl add-flow br0 in_port=1,actions=output:2
4679 ovs-ofctl add-flow br0 in_port=2,actions=output:1
4680 ovs-appctl -t ovs-ofctl ofctl/barrier
4681 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
4682 ovs-appctl -t ovs-ofctl ofctl/barrier
4683 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
4685 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
4686 [NXST_FLOW_MONITOR reply (xid=0x0):
4687 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
4688 NXST_FLOW_MONITOR reply (xid=0x0):
4689 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
4691 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
4692 NXST_FLOW_MONITOR reply (xid=0x0):
4693 event=DELETED reason=delete table=0 cookie=0 in_port=1 actions=output:2
4694 event=DELETED reason=delete table=0 cookie=0 in_port=2 actions=output:1
4698 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4702 AT_SETUP([ofproto - flow monitoring with !own])
4703 AT_KEYWORDS([monitor])
4706 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
4708 # Start a monitor watching the flow table and check the initial reply.
4709 ovs-ofctl monitor br0 watch:\!own --detach --no-chdir --pidfile >monitor.log 2>&1
4710 AT_CAPTURE_FILE([monitor.log])
4711 ovs-appctl -t ovs-ofctl ofctl/barrier
4712 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4713 [NXST_FLOW_MONITOR reply:
4714 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
4718 # Check that our own changes are reported as abbreviations.
4719 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4720 ovs-ofctl add-flow br0 in_port=1,actions=output:2
4721 ovs-ofctl add-flow br0 in_port=2,actions=output:1
4722 ovs-appctl -t ovs-ofctl ofctl/barrier
4723 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
4724 ovs-appctl -t ovs-ofctl ofctl/barrier
4725 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
4727 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4728 [NXST_FLOW_MONITOR reply (xid=0x0):
4729 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
4730 NXST_FLOW_MONITOR reply (xid=0x0):
4731 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
4733 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
4734 NXST_FLOW_MONITOR reply (xid=0x0):
4735 event=ABBREV xid=0x12345678
4739 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4743 AT_SETUP([ofproto - flow monitoring with out_port])
4744 AT_KEYWORDS([monitor])
4747 ovs-ofctl add-flow br0 in_port=0,dl_vlan=121,actions=output:1
4748 ovs-ofctl add-flow br0 in_port=0,dl_vlan=122,actions=output:1
4749 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:2
4751 # Start a monitor watching the flow table and check the initial reply.
4752 ovs-ofctl monitor br0 watch:out_port=2 --detach --no-chdir --pidfile >monitor.log 2>&1
4753 AT_CAPTURE_FILE([monitor.log])
4754 ovs-appctl -t ovs-ofctl ofctl/barrier
4755 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4756 [NXST_FLOW_MONITOR reply:
4757 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
4761 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4763 # Add, modify flows and check the updates.
4764 ovs-ofctl mod-flows br0 dl_vlan=121,actions=drop
4765 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1,output:2
4766 ovs-appctl -t ovs-ofctl ofctl/barrier
4768 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:1,output:2
4769 ovs-appctl -t ovs-ofctl ofctl/barrier
4771 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1
4772 ovs-appctl -t ovs-ofctl ofctl/barrier
4773 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:2
4774 ovs-appctl -t ovs-ofctl ofctl/barrier
4776 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4777 [NXST_FLOW_MONITOR reply (xid=0x0):
4778 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1,output:2
4780 NXST_FLOW_MONITOR reply (xid=0x0):
4781 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1,output:2
4783 NXST_FLOW_MONITOR reply (xid=0x0):
4784 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1
4786 NXST_FLOW_MONITOR reply (xid=0x0):
4787 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
4791 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4795 AT_SETUP([ofproto - flow monitoring pause and resume])
4796 AT_KEYWORDS([monitor])
4798 # The maximum socket receive buffer size is important for this test, which
4799 # tests behavior when the receive buffer overflows.
4800 if test -e /proc/sys/net/core/rmem_max; then
4802 rmem_max=`cat /proc/sys/net/core/rmem_max`
4803 elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
4806 # Don't know how to get maximum socket receive buffer on this OS
4809 # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
4810 # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
4811 queue_size=`expr $rmem_max + 128 \* 1024`
4812 echo rmem_max=$rmem_max queue_size=$queue_size
4814 # If there's too much queuing skip the test to avoid timing out.
4815 AT_SKIP_IF([test $rmem_max -gt 1048576])
4817 # Each flow update message takes up at least 48 bytes of space in queues
4818 # and in practice more than that.
4819 n_msgs=`expr $queue_size / 48`
4824 # Start a monitor watching the flow table, then make it block.
4825 on_exit 'kill `cat ovs-ofctl.pid`'
4826 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
4827 AT_CAPTURE_FILE([monitor.log])
4828 ovs-appctl -t ovs-ofctl ofctl/block
4830 # Add $n_msgs flows.
4831 (echo "in_port=2,actions=output:2"
4833 for i in range('$n_msgs'):
4834 print("cookie=1,reg1=%d,actions=drop" % i)
4836 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4837 # Check that multipart flow dumps work properly:
4838 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
4839 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
4840 AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
4841 AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
4843 ovs-appctl -t ovs-ofctl ofctl/unblock
4845 # Wait for the connection resumed.
4846 # A barrier doesn't work for this purpose.
4847 # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html
4848 # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html
4849 OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log])
4851 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4853 # Check that the flow monitor reported the same number of flows
4854 # added and deleted, but fewer than we actually added and deleted.
4855 adds=`grep -c 'ADDED.*reg1=' monitor.log`
4856 deletes=`grep -c 'DELETED.*reg1=' monitor.log`
4857 echo adds=$adds deletes=$deletes
4858 AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
4859 AT_CHECK([test $adds = $deletes])
4861 # Check that the flow monitor reported everything in the expected order:
4863 # event=ADDED table=0 cookie=0x1 reg1=0x22
4865 # NXT_FLOW_MONITOR_PAUSED:
4867 # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
4869 # event=ADDED table=0 cookie=0x3 in_port=1
4870 # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
4871 # NXT_FLOW_MONITOR_RESUMED:
4873 # except that, between the PAUSED and RESUMED, the order of the ADDED
4874 # and MODIFIED lines lines depends on hash order, that is, it varies
4875 # as we change the hash function or change architecture. Therefore,
4876 # we use a couple of tests below to accept both orders.
4877 AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
4880 /NXT_FLOW_MONITOR_PAUSED:/p
4881 /NXT_FLOW_MONITOR_RESUMED:/p
4882 ' > monitor.log.subset])
4883 AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
4884 event=ADDED table=0 cookie=0x1 reg1=0x22
4885 NXT_FLOW_MONITOR_PAUSED:
4886 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
4887 event=ADDED table=0 cookie=0x3 in_port=1
4888 NXT_FLOW_MONITOR_RESUMED:
4890 AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
4891 NXT_FLOW_MONITOR_PAUSED:
4892 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
4893 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
4894 NXT_FLOW_MONITOR_RESUMED:
4900 AT_SETUP([ofproto - flow monitoring usable protocols])
4901 AT_KEYWORDS([monitor])
4905 on_exit 'kill `cat ovs-ofctl.pid`'
4906 ovs-ofctl -OOpenFlow14 monitor br0 watch:udp,udp_dst=8 --detach --no-chdir --pidfile >monitor.log 2>&1
4907 AT_CAPTURE_FILE([monitor.log])
4909 # ovs-ofctl should exit because monitor is not supported in OpenFlow 1.4
4910 OVS_WAIT_UNTIL([grep "ovs-ofctl: none of the usable flow formats (OpenFlow10,NXM) is among the allowed flow formats (OXM-OpenFlow14)" monitor.log])
4912 # check that only NXM flag is returned as usable protocols for sctp_dst
4913 # and ovs-ofctl should exit since monitor is not supported in OpenFlow 1.4
4914 ovs-ofctl -OOpenFlow14 monitor br0 watch:sctp,sctp_dst=9 --detach --no-chdir --pidfile >monitor.log 2>&1
4915 OVS_WAIT_UNTIL([grep "ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OXM-OpenFlow14)" monitor.log])
4921 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
4922 AT_KEYWORDS([monitor])
4925 # Start a monitor, use the required protocol version
4926 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
4927 AT_CAPTURE_FILE([monitor.log])
4929 # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a)
4930 ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a
4931 ovs-appctl -t ovs-ofctl ofctl/barrier
4933 # Check default setting
4934 read -r -d '' expected <<'EOF'
4937 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
4938 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
4939 OFPT_GET_ASYNC_REPLY (OF1.3):
4941 PACKET_IN: no_match action
4942 PORT_STATUS: add delete modify
4943 FLOW_REMOVED: idle hard delete group_delete
4946 REQUESTFORWARD: (off)
4950 PORT_STATUS: add delete modify
4954 REQUESTFORWARD: (off)
4955 OFPT_BARRIER_REPLY (OF1.3):
4961 AT_SETUP([ofproto - ofport_request])
4963 add_of_ports br0 1 2 3
4965 set_and_check_specific_ofports () {
4966 ovs-vsctl set Interface p1 ofport_request="$1" -- \
4967 set Interface p2 ofport_request="$2" -- \
4968 set Interface p3 ofport_request="$3"
4969 ofports=`ovs-vsctl get Interface p1 ofport -- \
4970 get Interface p2 ofport -- \
4971 get Interface p3 ofport`
4972 AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
4975 for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
4976 for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
4977 echo -----------------------------------------------------------
4978 echo "Check changing port numbers from $pre to $post"
4979 set_and_check_specific_ofports $pre
4980 set_and_check_specific_ofports $post
4984 ovs-vsctl del-port p3
4986 set_and_check_poorly_specified_ofports () {
4987 ovs-vsctl set Interface p1 ofport_request="$1" -- \
4988 set Interface p2 ofport_request="$2"
4989 p1=`ovs-vsctl get Interface p1 ofport`
4990 p2=`ovs-vsctl get Interface p2 ofport`
4993 AT_CHECK([test "$p1" != "$p2"])
4994 if test "$1" = "$2" && test "$1" != '[[]]'; then
4995 # One port number must be the requested one.
4996 AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
4997 # The other port number must be different (already tested above).
4999 AT_CHECK([test "$1" = '[[]]' || test "$p1" = "$1"])
5000 AT_CHECK([test "$2" = '[[]]' || test "$p2" = "$2"])
5003 for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
5005 for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
5007 echo -----------------------------------------------------------
5008 echo "Check changing port numbers from $pre to $post"
5009 set_and_check_poorly_specified_ofports $pre
5010 set_and_check_poorly_specified_ofports $post
5017 AT_SETUP([ofproto - bundle open (OpenFlow 1.4)])
5018 AT_KEYWORDS([monitor])
5021 # Start a monitor, use the required protocol version
5022 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5023 AT_CAPTURE_FILE([monitor.log])
5025 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
5026 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
5027 ovs-appctl -t ovs-ofctl ofctl/barrier
5028 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5030 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5031 send: OFPT_BUNDLE_CONTROL (OF1.4):
5032 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5033 OFPT_BUNDLE_CONTROL (OF1.4):
5034 bundle_id=0x1 type=OPEN_REPLY flags=0
5035 OFPT_BARRIER_REPLY (OF1.4):
5041 AT_SETUP([ofproto - bundle double open (OpenFlow 1.4)])
5042 AT_KEYWORDS([monitor])
5045 # Start a monitor, use the required protocol version
5046 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5047 AT_CAPTURE_FILE([monitor.log])
5049 # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
5050 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
5051 ovs-appctl -t ovs-ofctl ofctl/barrier
5052 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
5053 ovs-appctl -t ovs-ofctl ofctl/barrier
5054 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5056 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5057 send: OFPT_BUNDLE_CONTROL (OF1.4):
5058 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5059 OFPT_BUNDLE_CONTROL (OF1.4):
5060 bundle_id=0x1 type=OPEN_REPLY flags=0
5061 OFPT_BARRIER_REPLY (OF1.4):
5062 send: OFPT_BUNDLE_CONTROL (OF1.4):
5063 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5064 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5065 OFPT_BUNDLE_CONTROL (OF1.4):
5066 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5067 OFPT_BARRIER_REPLY (OF1.4):
5073 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)])
5074 AT_KEYWORDS([monitor])
5077 # Start a monitor, use the required protocol version
5078 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5079 AT_CAPTURE_FILE([monitor.log])
5081 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
5082 ovs-appctl -t ovs-ofctl ofctl/barrier
5083 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5085 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5086 send: OFPT_BUNDLE_CONTROL (OF1.4):
5087 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5088 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5089 OFPT_BUNDLE_CONTROL (OF1.4):
5090 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5091 OFPT_BARRIER_REPLY (OF1.4):
5097 AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)])
5098 AT_KEYWORDS([monitor])
5101 # Start a monitor, use the required protocol version
5102 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5103 AT_CAPTURE_FILE([monitor.log])
5105 # Open, Close, Close
5106 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
5107 ovs-appctl -t ovs-ofctl ofctl/barrier
5108 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
5109 ovs-appctl -t ovs-ofctl ofctl/barrier
5110 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
5111 ovs-appctl -t ovs-ofctl ofctl/barrier
5112 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5114 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5115 send: OFPT_BUNDLE_CONTROL (OF1.4):
5116 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5117 OFPT_BUNDLE_CONTROL (OF1.4):
5118 bundle_id=0x1 type=OPEN_REPLY flags=0
5119 OFPT_BARRIER_REPLY (OF1.4):
5120 send: OFPT_BUNDLE_CONTROL (OF1.4):
5121 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5122 OFPT_BUNDLE_CONTROL (OF1.4):
5123 bundle_id=0x1 type=CLOSE_REPLY flags=0
5124 OFPT_BARRIER_REPLY (OF1.4):
5125 send: OFPT_BUNDLE_CONTROL (OF1.4):
5126 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5127 OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED
5128 OFPT_BUNDLE_CONTROL (OF1.4):
5129 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5130 OFPT_BARRIER_REPLY (OF1.4):
5136 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)])
5137 AT_KEYWORDS([monitor])
5140 # Start a monitor, use the required protocol version
5141 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5142 AT_CAPTURE_FILE([monitor.log])
5145 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
5146 ovs-appctl -t ovs-ofctl ofctl/barrier
5147 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
5148 ovs-appctl -t ovs-ofctl ofctl/barrier
5149 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5151 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5152 send: OFPT_BUNDLE_CONTROL (OF1.4):
5153 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5154 OFPT_BUNDLE_CONTROL (OF1.4):
5155 bundle_id=0x1 type=OPEN_REPLY flags=0
5156 OFPT_BARRIER_REPLY (OF1.4):
5157 send: OFPT_BUNDLE_CONTROL (OF1.4):
5158 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
5159 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
5160 OFPT_BUNDLE_CONTROL (OF1.4):
5161 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
5162 OFPT_BARRIER_REPLY (OF1.4):
5168 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)])
5169 AT_KEYWORDS([monitor])
5172 # Start a monitor, use the required protocol version
5173 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5174 AT_CAPTURE_FILE([monitor.log])
5177 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02"
5178 ovs-appctl -t ovs-ofctl ofctl/barrier
5179 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5181 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5182 send: OFPT_BUNDLE_CONTROL (OF1.4):
5183 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
5184 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5185 OFPT_BUNDLE_CONTROL (OF1.4):
5186 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
5187 OFPT_BARRIER_REPLY (OF1.4):
5193 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)])
5194 AT_KEYWORDS([monitor])
5197 # Start a monitor, use the required protocol version
5198 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5199 AT_CAPTURE_FILE([monitor.log])
5202 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
5203 ovs-appctl -t ovs-ofctl ofctl/barrier
5204 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01"
5205 ovs-appctl -t ovs-ofctl ofctl/barrier
5206 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5208 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5209 send: OFPT_BUNDLE_CONTROL (OF1.4):
5210 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5211 OFPT_BUNDLE_CONTROL (OF1.4):
5212 bundle_id=0x1 type=OPEN_REPLY flags=0
5213 OFPT_BARRIER_REPLY (OF1.4):
5214 send: OFPT_BUNDLE_CONTROL (OF1.4):
5215 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
5216 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
5217 OFPT_BUNDLE_CONTROL (OF1.4):
5218 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
5219 OFPT_BARRIER_REPLY (OF1.4):
5225 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)])
5226 AT_KEYWORDS([monitor])
5229 # Start a monitor, use the required protocol version
5230 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5231 AT_CAPTURE_FILE([monitor.log])
5234 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 02"
5235 ovs-appctl -t ovs-ofctl ofctl/barrier
5236 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5238 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5239 send: OFPT_BUNDLE_CONTROL (OF1.4):
5240 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
5241 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5242 OFPT_BUNDLE_CONTROL (OF1.4):
5243 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
5244 OFPT_BARRIER_REPLY (OF1.4):
5251 AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.4)])
5254 AT_CHECK([ovs-appctl vlog/set vconn:dbg])
5256 AT_CHECK([ovs-ofctl --no-names del-flows br0])
5258 AT_DATA([flows.txt], [dnl
5259 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
5260 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
5261 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
5262 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
5264 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
5265 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
5266 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
5267 delete in_port=2 dl_src=00:88:99:aa:bb:cc
5270 AT_CHECK([ovs-ofctl --no-names --bundle add-flows br0 flows.txt])
5272 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5273 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
5274 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
5278 AT_DATA([flows.txt], [dnl
5280 modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7
5283 AT_CHECK([ovs-ofctl --no-names --bundle add-flows br0 flows.txt])
5285 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5286 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5287 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
5291 # Adding an existing flow acts as a modify, and delete_strict also works.
5292 AT_DATA([flows.txt], [dnl
5293 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8
5294 delete_strict in_port=2 dl_src=00:66:77:88:99:aa
5295 add in_port=2 dl_src=00:66:77:88:99:aa actions=drop
5298 AT_CHECK([ovs-ofctl --no-names --bundle add-flows br0 flows.txt])
5300 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5301 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
5302 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5306 dnl Check logs for OpenFlow trace
5308 OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3])
5309 AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl
5310 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5311 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5312 vconn|DBG|unix: received: OFPT_HELLO:
5313 version bitmap: 0x01
5314 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
5315 vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop
5316 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5317 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5318 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5319 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5320 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
5321 version bitmap: 0x05
5322 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
5323 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5324 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
5325 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5326 bundle_id=0 type=OPEN_REPLY flags=0
5327 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5328 bundle_id=0 flags=atomic ordered
5329 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1
5330 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5331 bundle_id=0 flags=atomic ordered
5332 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2
5333 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5334 bundle_id=0 flags=atomic ordered
5335 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3
5336 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5337 bundle_id=0 flags=atomic ordered
5338 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:4
5339 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5340 bundle_id=0 flags=atomic ordered
5341 OFPT_FLOW_MOD (OF1.4): DEL table:255 actions=drop
5342 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5343 bundle_id=0 flags=atomic ordered
5344 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:5
5345 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5346 bundle_id=0 flags=atomic ordered
5347 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:6
5348 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5349 bundle_id=0 flags=atomic ordered
5350 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7
5351 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5352 bundle_id=0 flags=atomic ordered
5353 OFPT_FLOW_MOD (OF1.4): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
5354 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
5355 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
5356 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5357 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5358 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5359 bundle_id=0 type=COMMIT_REPLY flags=0
5360 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5361 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5362 vconn|DBG|unix: received: OFPT_HELLO:
5363 version bitmap: 0x01
5364 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
5365 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
5366 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5367 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5368 vconn|DBG|unix: received: NXST_FLOW request:
5369 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
5370 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
5371 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
5372 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5373 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5374 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
5375 version bitmap: 0x05
5376 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
5377 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5378 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
5379 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5380 bundle_id=0 type=OPEN_REPLY flags=0
5381 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5382 bundle_id=0 flags=atomic ordered
5383 OFPT_FLOW_MOD (OF1.4): MOD actions=drop
5384 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5385 bundle_id=0 flags=atomic ordered
5386 OFPT_FLOW_MOD (OF1.4): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
5387 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
5388 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
5389 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5390 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5391 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5392 bundle_id=0 type=COMMIT_REPLY flags=0
5393 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5394 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5395 vconn|DBG|unix: received: OFPT_HELLO:
5396 version bitmap: 0x01
5397 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
5398 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
5399 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5400 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5401 vconn|DBG|unix: received: NXST_FLOW request:
5402 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
5403 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5404 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
5405 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5406 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5407 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
5408 version bitmap: 0x05
5409 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
5410 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5411 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
5412 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5413 bundle_id=0 type=OPEN_REPLY flags=0
5414 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5415 bundle_id=0 flags=atomic ordered
5416 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8
5417 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5418 bundle_id=0 flags=atomic ordered
5419 OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5420 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5421 bundle_id=0 flags=atomic ordered
5422 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5423 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
5424 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
5425 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5426 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5427 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5428 bundle_id=0 type=COMMIT_REPLY flags=0
5429 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5430 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5431 vconn|DBG|unix: received: OFPT_HELLO:
5432 version bitmap: 0x01
5433 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
5434 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
5435 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5436 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5437 vconn|DBG|unix: received: NXST_FLOW request:
5438 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
5439 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
5440 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5443 AT_CHECK([grep " flow_mods in the last " ovs-vswitchd.log | sed -e 's/^.*connmgr|INFO|//' | vconn_sub], [0], [dnl
5444 br0<->unix: 1 flow_mods in the last 0 s (1 deletes)
5445 br0<->unix: 9 flow_mods in the last 0 s (7 adds, 2 deletes)
5446 br0<->unix: 2 flow_mods in the last 0 s (2 modifications)
5447 br0<->unix: 3 flow_mods in the last 0 s (2 adds, 1 deletes)
5454 AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.4)])
5457 AT_CHECK([ovs-ofctl del-flows br0])
5459 ovs-ofctl add-flows br0 - <<EOF
5460 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=11
5461 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=22
5462 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=33
5464 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5465 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
5466 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
5467 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
5471 # last line uses illegal table number (OVS internal table)
5472 AT_DATA([flows.txt], [dnl
5473 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
5474 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
5475 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
5476 modify idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
5478 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
5479 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
5480 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
5481 delete in_port=2 dl_src=00:88:99:aa:bb:cc
5482 add table=254 actions=drop
5485 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt 2>&1 | sed '/talking to/,$d' | strip_xids],
5487 Error OFPBRC_EPERM for: OFPT_FLOW_MOD (OF1.4): ADD table:254 actions=drop
5490 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5491 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
5492 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
5493 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
5501 AT_SETUP([ofproto - bundle timeout (OpenFlow 1.4)])
5502 AT_KEYWORDS([monitor])
5505 # Start a monitor, use the required protocol version
5506 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5507 AT_CAPTURE_FILE([monitor.log])
5509 ovs-appctl time/stop
5511 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (01)
5512 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 01 00 00 00 01 00 00 00 03"
5513 ovs-appctl time/warp 8000
5514 # Send a bundle flow mod, it should keep the bundle alive.
5515 ovs-appctl -t ovs-ofctl ofctl/send "05 22 00 a0 00 00 00 02 00 00 00 01 00 00 00 03 \
5516 05 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \
5517 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \
5518 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \
5519 00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \
5520 50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \
5521 80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \
5522 00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \
5523 00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \
5524 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \
5526 ovs-appctl time/warp 8000
5527 # Send a bundle close, it should keep the bundle alive.
5528 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 03 00 00 00 01 00 02 00 03"
5529 ovs-appctl time/warp 11000
5530 # Make sure that timeouts are processed after the expiry
5531 ovs-appctl time/warp 1000
5532 # Send a Commit, but too late.
5533 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 04 00 00 00 01 00 04 00 03"
5534 ovs-appctl -t ovs-ofctl ofctl/barrier
5535 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5537 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5538 send: OFPT_BUNDLE_CONTROL (OF1.4):
5539 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5540 OFPT_BUNDLE_CONTROL (OF1.4):
5541 bundle_id=0x1 type=OPEN_REPLY flags=0
5542 send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5543 bundle_id=0x1 flags=atomic ordered
5544 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
5545 send: OFPT_BUNDLE_CONTROL (OF1.4):
5546 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic ordered
5547 OFPT_BUNDLE_CONTROL (OF1.4):
5548 bundle_id=0x1 type=CLOSE_REPLY flags=0
5549 OFPT_ERROR (OF1.4): OFPBFC_TIMEOUT
5550 OFPT_BUNDLE_CONTROL (OF1.4):
5551 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5552 send: OFPT_BUNDLE_CONTROL (OF1.4):
5553 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5554 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5555 OFPT_BUNDLE_CONTROL (OF1.4):
5556 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5557 OFPT_BARRIER_REPLY (OF1.4):
5563 AT_SETUP([ofproto - bundle custom timeout (OpenFlow 1.4)])
5564 AT_KEYWORDS([monitor])
5567 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:bundle-idle-timeout=4])
5569 # Start a monitor, use the required protocol version
5570 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5571 AT_CAPTURE_FILE([monitor.log])
5573 ovs-appctl time/stop
5575 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (01)
5576 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 01 00 00 00 01 00 00 00 03"
5577 ovs-appctl time/warp 2000
5578 # Send a bundle flow mod, it should keep the bundle alive.
5579 ovs-appctl -t ovs-ofctl ofctl/send "05 22 00 a0 00 00 00 02 00 00 00 01 00 00 00 03 \
5580 05 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \
5581 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \
5582 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \
5583 00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \
5584 50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \
5585 80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \
5586 00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \
5587 00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \
5588 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \
5590 ovs-appctl time/warp 2000
5591 # Send a bundle close, it should keep the bundle alive.
5592 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 03 00 00 00 01 00 02 00 03"
5593 ovs-appctl time/warp 4000
5594 # Make sure that timeouts are processed after the expiry, but still before the
5595 # current timeout of 4s.
5596 ovs-appctl time/warp 1000
5597 # Send a Commit, but too late.
5598 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 04 00 00 00 01 00 04 00 03"
5599 ovs-appctl -t ovs-ofctl ofctl/barrier
5600 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5602 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5603 send: OFPT_BUNDLE_CONTROL (OF1.4):
5604 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5605 OFPT_BUNDLE_CONTROL (OF1.4):
5606 bundle_id=0x1 type=OPEN_REPLY flags=0
5607 send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5608 bundle_id=0x1 flags=atomic ordered
5609 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
5610 send: OFPT_BUNDLE_CONTROL (OF1.4):
5611 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic ordered
5612 OFPT_BUNDLE_CONTROL (OF1.4):
5613 bundle_id=0x1 type=CLOSE_REPLY flags=0
5614 OFPT_ERROR (OF1.4): OFPBFC_TIMEOUT
5615 OFPT_BUNDLE_CONTROL (OF1.4):
5616 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5617 send: OFPT_BUNDLE_CONTROL (OF1.4):
5618 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5619 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5620 OFPT_BUNDLE_CONTROL (OF1.4):
5621 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5622 OFPT_BARRIER_REPLY (OF1.4):
5628 AT_SETUP([ofproto - bundle reset timeout to default (OpenFlow 1.4)])
5629 AT_KEYWORDS([monitor])
5632 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:bundle-idle-timeout=15])
5633 AT_CHECK([ovs-vsctl remove Open_vSwitch . other_config bundle-idle-timeout])
5635 # Start a monitor, use the required protocol version
5636 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5637 AT_CAPTURE_FILE([monitor.log])
5639 ovs-appctl time/stop
5641 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (01)
5642 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 01 00 00 00 01 00 00 00 03"
5643 ovs-appctl time/warp 8000
5644 # Send a bundle flow mod, it should keep the bundle alive.
5645 ovs-appctl -t ovs-ofctl ofctl/send "05 22 00 a0 00 00 00 02 00 00 00 01 00 00 00 03 \
5646 05 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \
5647 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \
5648 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \
5649 00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \
5650 50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \
5651 80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \
5652 00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \
5653 00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \
5654 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \
5656 ovs-appctl time/warp 8000
5657 # Send a bundle close, it should keep the bundle alive.
5658 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 03 00 00 00 01 00 02 00 03"
5659 ovs-appctl time/warp 11000
5660 # Make sure that timeouts are processed after the expiry
5661 ovs-appctl time/warp 1000
5662 # Send a Commit, but too late.
5663 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 04 00 00 00 01 00 04 00 03"
5664 ovs-appctl -t ovs-ofctl ofctl/barrier
5665 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5667 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5668 send: OFPT_BUNDLE_CONTROL (OF1.4):
5669 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5670 OFPT_BUNDLE_CONTROL (OF1.4):
5671 bundle_id=0x1 type=OPEN_REPLY flags=0
5672 send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5673 bundle_id=0x1 flags=atomic ordered
5674 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
5675 send: OFPT_BUNDLE_CONTROL (OF1.4):
5676 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic ordered
5677 OFPT_BUNDLE_CONTROL (OF1.4):
5678 bundle_id=0x1 type=CLOSE_REPLY flags=0
5679 OFPT_ERROR (OF1.4): OFPBFC_TIMEOUT
5680 OFPT_BUNDLE_CONTROL (OF1.4):
5681 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5682 send: OFPT_BUNDLE_CONTROL (OF1.4):
5683 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5684 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5685 OFPT_BUNDLE_CONTROL (OF1.4):
5686 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5687 OFPT_BARRIER_REPLY (OF1.4):
5693 AT_SETUP([ofproto - bundle open (OpenFlow 1.3)])
5694 AT_KEYWORDS([monitor])
5697 # Start a monitor, use the required protocol version
5698 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5699 AT_CAPTURE_FILE([monitor.log])
5701 # Send an OpenFlow13 message (04), OFPT_EXPERIMENTER (04), length (0018),
5702 # xid (0000000a), ONF_EXPERIMENTER_ID (4F4E4600),
5703 # ONFT_BUNDLE_CONTROL (2300 = 0x08FC), bundle id (00000001),
5704 # message type (0000), and flags (0002)
5705 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"
5706 ovs-appctl -t ovs-ofctl ofctl/barrier
5707 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5709 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5710 send: ONFT_BUNDLE_CONTROL (OF1.3):
5711 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5712 ONFT_BUNDLE_CONTROL (OF1.3):
5713 bundle_id=0x1 type=OPEN_REPLY flags=0
5714 OFPT_BARRIER_REPLY (OF1.3):
5720 AT_SETUP([ofproto - bundle double open (OpenFlow 1.3)])
5721 AT_KEYWORDS([monitor])
5724 # Start a monitor, use the required protocol version
5725 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5726 AT_CAPTURE_FILE([monitor.log])
5728 # Send twice an OpenFlow13 message (04), OFPT_EXPERIMENTER (04), length (0018),
5729 # xid (0000000a), ONF_EXPERIMENTER_ID (4F4E4600),
5730 # ONFT_BUNDLE_CONTROL (2300 = 0x08FC), bundle id (00000001),
5731 # message type (0000), and flags (0002)
5732 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"
5733 ovs-appctl -t ovs-ofctl ofctl/barrier
5734 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"
5735 ovs-appctl -t ovs-ofctl ofctl/barrier
5736 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5738 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5739 send: ONFT_BUNDLE_CONTROL (OF1.3):
5740 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5741 ONFT_BUNDLE_CONTROL (OF1.3):
5742 bundle_id=0x1 type=OPEN_REPLY flags=0
5743 OFPT_BARRIER_REPLY (OF1.3):
5744 send: ONFT_BUNDLE_CONTROL (OF1.3):
5745 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5746 OFPT_ERROR (OF1.3): OFPBFC_BAD_ID
5747 ONFT_BUNDLE_CONTROL (OF1.3):
5748 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5749 OFPT_BARRIER_REPLY (OF1.3):
5755 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.3)])
5756 AT_KEYWORDS([monitor])
5759 # Start a monitor, use the required protocol version
5760 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5761 AT_CAPTURE_FILE([monitor.log])
5763 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"
5764 ovs-appctl -t ovs-ofctl ofctl/barrier
5765 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5767 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5768 send: ONFT_BUNDLE_CONTROL (OF1.3):
5769 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5770 OFPT_ERROR (OF1.3): OFPBFC_BAD_ID
5771 ONFT_BUNDLE_CONTROL (OF1.3):
5772 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5773 OFPT_BARRIER_REPLY (OF1.3):
5779 AT_SETUP([ofproto - bundle double close (OpenFlow 1.3)])
5780 AT_KEYWORDS([monitor])
5783 # Start a monitor, use the required protocol version
5784 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5785 AT_CAPTURE_FILE([monitor.log])
5787 # Open, Close, Close
5788 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"
5789 ovs-appctl -t ovs-ofctl ofctl/barrier
5790 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"
5791 ovs-appctl -t ovs-ofctl ofctl/barrier
5792 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"
5793 ovs-appctl -t ovs-ofctl ofctl/barrier
5794 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5796 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5797 send: ONFT_BUNDLE_CONTROL (OF1.3):
5798 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5799 ONFT_BUNDLE_CONTROL (OF1.3):
5800 bundle_id=0x1 type=OPEN_REPLY flags=0
5801 OFPT_BARRIER_REPLY (OF1.3):
5802 send: ONFT_BUNDLE_CONTROL (OF1.3):
5803 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5804 ONFT_BUNDLE_CONTROL (OF1.3):
5805 bundle_id=0x1 type=CLOSE_REPLY flags=0
5806 OFPT_BARRIER_REPLY (OF1.3):
5807 send: ONFT_BUNDLE_CONTROL (OF1.3):
5808 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5809 OFPT_ERROR (OF1.3): OFPBFC_BUNDLE_CLOSED
5810 ONFT_BUNDLE_CONTROL (OF1.3):
5811 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5812 OFPT_BARRIER_REPLY (OF1.3):
5818 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.3)])
5819 AT_KEYWORDS([monitor])
5822 # Start a monitor, use the required protocol version
5823 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5824 AT_CAPTURE_FILE([monitor.log])
5827 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"
5828 ovs-appctl -t ovs-ofctl ofctl/barrier
5829 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"
5830 ovs-appctl -t ovs-ofctl ofctl/barrier
5831 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5833 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5834 send: ONFT_BUNDLE_CONTROL (OF1.3):
5835 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5836 ONFT_BUNDLE_CONTROL (OF1.3):
5837 bundle_id=0x1 type=OPEN_REPLY flags=0
5838 OFPT_BARRIER_REPLY (OF1.3):
5839 send: ONFT_BUNDLE_CONTROL (OF1.3):
5840 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
5841 OFPT_ERROR (OF1.3): OFPBFC_BAD_FLAGS
5842 ONFT_BUNDLE_CONTROL (OF1.3):
5843 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
5844 OFPT_BARRIER_REPLY (OF1.3):
5850 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.3)])
5851 AT_KEYWORDS([monitor])
5854 # Start a monitor, use the required protocol version
5855 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5856 AT_CAPTURE_FILE([monitor.log])
5859 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"
5860 ovs-appctl -t ovs-ofctl ofctl/barrier
5861 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5863 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5864 send: ONFT_BUNDLE_CONTROL (OF1.3):
5865 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
5866 OFPT_ERROR (OF1.3): OFPBFC_BAD_ID
5867 ONFT_BUNDLE_CONTROL (OF1.3):
5868 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
5869 OFPT_BARRIER_REPLY (OF1.3):
5875 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.3)])
5876 AT_KEYWORDS([monitor])
5879 # Start a monitor, use the required protocol version
5880 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5881 AT_CAPTURE_FILE([monitor.log])
5884 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"
5885 ovs-appctl -t ovs-ofctl ofctl/barrier
5886 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"
5887 ovs-appctl -t ovs-ofctl ofctl/barrier
5888 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5890 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5891 send: ONFT_BUNDLE_CONTROL (OF1.3):
5892 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5893 ONFT_BUNDLE_CONTROL (OF1.3):
5894 bundle_id=0x1 type=OPEN_REPLY flags=0
5895 OFPT_BARRIER_REPLY (OF1.3):
5896 send: ONFT_BUNDLE_CONTROL (OF1.3):
5897 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
5898 OFPT_ERROR (OF1.3): OFPBFC_BAD_FLAGS
5899 ONFT_BUNDLE_CONTROL (OF1.3):
5900 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
5901 OFPT_BARRIER_REPLY (OF1.3):
5907 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.3)])
5908 AT_KEYWORDS([monitor])
5911 # Start a monitor, use the required protocol version
5912 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5913 AT_CAPTURE_FILE([monitor.log])
5916 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"
5917 ovs-appctl -t ovs-ofctl ofctl/barrier
5918 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5920 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5921 send: ONFT_BUNDLE_CONTROL (OF1.3):
5922 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
5923 OFPT_ERROR (OF1.3): OFPBFC_BAD_ID
5924 ONFT_BUNDLE_CONTROL (OF1.3):
5925 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
5926 OFPT_BARRIER_REPLY (OF1.3):
5933 AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.3)])
5936 AT_CHECK([ovs-appctl vlog/set vconn:dbg])
5938 AT_CHECK([ovs-ofctl --no-names del-flows br0])
5940 AT_DATA([flows.txt], [dnl
5941 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
5942 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
5943 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
5944 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
5946 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
5947 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
5948 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
5949 delete in_port=2 dl_src=00:88:99:aa:bb:cc
5952 AT_CHECK([ovs-ofctl -O OpenFlow13 --no-names --bundle add-flows br0 flows.txt])
5954 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5955 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
5956 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
5960 AT_DATA([flows.txt], [dnl
5962 modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7
5965 AT_CHECK([ovs-ofctl -O OpenFlow13 --no-names --bundle add-flows br0 flows.txt])
5967 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5968 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5969 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
5973 # Adding an existing flow acts as a modify, and delete_strict also works.
5974 AT_DATA([flows.txt], [dnl
5975 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8
5976 delete_strict in_port=2 dl_src=00:66:77:88:99:aa
5977 add in_port=2 dl_src=00:66:77:88:99:aa actions=drop
5980 AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle --no-names add-flows br0 flows.txt])
5982 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5983 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
5984 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5988 dnl Check logs for OpenFlow trace
5990 OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3])
5991 AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl
5992 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5993 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5994 vconn|DBG|unix: received: OFPT_HELLO:
5995 version bitmap: 0x01
5996 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
5997 vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop
5998 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5999 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
6000 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6001 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6002 vconn|DBG|unix: received: OFPT_HELLO (OF1.3):
6003 version bitmap: 0x04
6004 vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x06 and earlier, peer supports version 0x04)
6005 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
6006 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
6007 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
6008 bundle_id=0 type=OPEN_REPLY flags=0
6009 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6010 bundle_id=0 flags=atomic ordered
6011 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1
6012 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6013 bundle_id=0 flags=atomic ordered
6014 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2
6015 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6016 bundle_id=0 flags=atomic ordered
6017 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3
6018 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6019 bundle_id=0 flags=atomic ordered
6020 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:4
6021 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6022 bundle_id=0 flags=atomic ordered
6023 OFPT_FLOW_MOD (OF1.3): DEL table:255 actions=drop
6024 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6025 bundle_id=0 flags=atomic ordered
6026 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:5
6027 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6028 bundle_id=0 flags=atomic ordered
6029 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:6
6030 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6031 bundle_id=0 flags=atomic ordered
6032 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7
6033 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6034 bundle_id=0 flags=atomic ordered
6035 OFPT_FLOW_MOD (OF1.3): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
6036 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.3):
6037 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.3):
6038 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
6039 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
6040 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
6041 bundle_id=0 type=COMMIT_REPLY flags=0
6042 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6043 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6044 vconn|DBG|unix: received: OFPT_HELLO:
6045 version bitmap: 0x01
6046 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
6047 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
6048 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
6049 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
6050 vconn|DBG|unix: received: NXST_FLOW request:
6051 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
6052 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
6053 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
6054 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6055 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6056 vconn|DBG|unix: received: OFPT_HELLO (OF1.3):
6057 version bitmap: 0x04
6058 vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x06 and earlier, peer supports version 0x04)
6059 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
6060 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
6061 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
6062 bundle_id=0 type=OPEN_REPLY flags=0
6063 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6064 bundle_id=0 flags=atomic ordered
6065 OFPT_FLOW_MOD (OF1.3): MOD actions=drop
6066 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6067 bundle_id=0 flags=atomic ordered
6068 OFPT_FLOW_MOD (OF1.3): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
6069 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.3):
6070 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.3):
6071 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
6072 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
6073 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
6074 bundle_id=0 type=COMMIT_REPLY flags=0
6075 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6076 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6077 vconn|DBG|unix: received: OFPT_HELLO:
6078 version bitmap: 0x01
6079 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
6080 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
6081 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
6082 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
6083 vconn|DBG|unix: received: NXST_FLOW request:
6084 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
6085 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
6086 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
6087 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6088 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6089 vconn|DBG|unix: received: OFPT_HELLO (OF1.3):
6090 version bitmap: 0x04
6091 vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x06 and earlier, peer supports version 0x04)
6092 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
6093 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
6094 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
6095 bundle_id=0 type=OPEN_REPLY flags=0
6096 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6097 bundle_id=0 flags=atomic ordered
6098 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8
6099 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6100 bundle_id=0 flags=atomic ordered
6101 OFPT_FLOW_MOD (OF1.3): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
6102 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6103 bundle_id=0 flags=atomic ordered
6104 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop
6105 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.3):
6106 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.3):
6107 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
6108 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
6109 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
6110 bundle_id=0 type=COMMIT_REPLY flags=0
6111 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6112 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6113 vconn|DBG|unix: received: OFPT_HELLO:
6114 version bitmap: 0x01
6115 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
6116 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
6117 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
6118 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
6119 vconn|DBG|unix: received: NXST_FLOW request:
6120 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
6121 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
6122 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
6129 AT_SETUP([ofproto - failing bundle add message (OpenFlow 1.3)])
6132 AT_CHECK([ovs-ofctl del-flows br0])
6134 ovs-ofctl add-flows br0 - <<EOF
6135 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=11
6136 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=22
6137 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=33
6139 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6140 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
6141 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
6142 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
6146 # last line uses illegal table number (OVS internal table)
6147 AT_DATA([flows.txt], [dnl
6148 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
6149 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
6150 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
6151 modify idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
6153 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
6154 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
6155 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
6156 delete in_port=2 dl_src=00:88:99:aa:bb:cc
6157 add table=254 actions=drop
6160 AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle add-flows br0 flows.txt 2>&1 | sed '/talking to/,$d' | strip_xids],
6162 Error OFPBRC_EPERM for: OFPT_FLOW_MOD (OF1.3): ADD table:254 actions=drop
6165 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6166 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
6167 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
6168 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
6176 AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.3)])
6179 AT_CHECK([ovs-ofctl del-flows br0])
6181 # Invalid group numbers are detected at commit time
6182 AT_DATA([flows.txt], [dnl
6183 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=group:1
6184 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=group:2
6185 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=group:3
6188 AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle add-flows br0 flows.txt 2>&1 | sed '/talking to/,$d' | strip_xids],
6190 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
6191 Error OFPBFC_MSG_FAILED for: ONFT_BUNDLE_CONTROL (OF1.3):
6192 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
6195 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6202 AT_SETUP([ofproto - monitor flows with tun_md])
6205 AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"])
6206 AT_CHECK([ovs-ofctl add-flow br0 tun_metadata0=0x1,actions=drop])
6208 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
6210 tun_metadata0=0x1 actions=drop
6213 AT_CAPTURE_FILE([ofctl_monitor.log])
6214 dnl Usually ovs-ofctl monitor outputs on stderr, but the first message here
6215 dnl is put on stdout, because it is handled by ofctl in dump_transaction()
6216 dnl and not in monitor_vconn().
6217 AT_CHECK([ovs-ofctl monitor br0 65534 watch: --detach --no-chdir --pidfile >ofctl_monitor.log 2>&1])
6219 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2])
6221 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
6222 NXST_FLOW_MONITOR reply:
6223 event=ADDED table=0 cookie=0 tun_metadata0=0x1
6226 AT_CHECK([ovs-ofctl del-flows br0])
6228 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
6230 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
6231 NXST_FLOW_MONITOR reply:
6232 event=ADDED table=0 cookie=0 tun_metadata0=0x1
6233 NXST_FLOW_MONITOR reply:
6234 event=DELETED reason=delete table=0 cookie=0 tun_metadata0=0x1
6237 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
6239 dnl Check that vswitchd hasn't crashed
6240 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
6247 AT_SETUP([ofproto - flow mod with tunnel metadata])
6248 AT_KEYWORDS([ofp-actions])
6251 AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"])
6252 AT_CHECK([ovs-ofctl add-flow br0 "in_port=1 actions=move:tun_metadata0[[0..31]]->NXM_NX_REG0[[]]"])
6254 dnl Check the length of tun_metadata0 in the replied OXM header.
6255 dnl Ignore the first 0x50 bytes of hex dump from the reply msg since the NXM
6256 dnl header that describes the tunnel metadata starts at offset 0x50.
6257 AT_CHECK([ovs-ofctl dump-flows br0 -mmmm], [0], [stdout])
6258 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
6260 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[[]]
6261 00000050 ff ff 00 18 00 00 23 20-00 06 00 20 00 00 00 00 |......# ... ....|
6262 00000060 00 01 50 04 00 01 00 04- |..P..... |
6265 dnl Check actions that may use tun_metadata
6266 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=move:tun_metadata1[[0..31]]->NXM_NX_REG0[[]]"], [1], [], [stderr])
6267 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6268 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6271 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=move:tun_metadata0[[32..63]]->NXM_NX_REG0[[]]"], [1], [], [stderr])
6272 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6273 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6276 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=push:tun_metadata1[[0..31]]"], [1], [], [stderr])
6277 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6278 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6281 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=pop:tun_metadata0[[32..63]]"], [1], [], [stderr])
6282 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6283 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6286 AT_CHECK([ovs-ofctl add-flow br0 "in_port=3, actions=load:0x11223344->tun_metadata1"], [1], [], [stderr])
6287 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6288 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6291 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=output:tun_metadata1[[0..31]]"], [1], [], [stderr])
6292 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6293 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6296 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=output:tun_metadata0[[32..63]]"], [1], [], [stderr])
6297 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6298 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6301 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])
6302 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6303 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6306 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])
6307 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6308 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6311 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])
6312 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6313 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6316 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])
6317 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6318 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6321 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=learn(tun_metadata1[[0..31]]=reg0[[0..31]])"], [1], [], [stderr])
6322 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6323 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6326 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=learn(tun_metadata0[[32..63]]=reg0[[0..31]])"], [1], [], [stderr])
6327 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6328 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6331 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=clone(move:tun_metadata1[[0..31]]->reg0[[0..31]])"], [1], [], [stderr])
6332 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6333 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6336 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=clone(move:tun_metadata0[[32..63]]->reg0[[0..31]])"], [1], [], [stderr])
6337 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6338 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6341 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=ct(commit,zone=tun_metadata1[[0..15]],exec(set_field:0x01->ct_mark))"], [1], [], [stderr])
6342 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6343 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6346 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=ct(commit,zone=tun_metadata0[[32..47]],exec(set_field:0x01->ct_mark))"], [1], [], [stderr])
6347 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6348 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6351 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=ct(commit,zone=1,exec(move:tun_metadata1[[0..31]]->ct_mark))"], [1], [], [stderr])
6352 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6353 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6356 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=ct(commit,zone=1,exec(move:tun_metadata0[[32..63]]->ct_mark))"], [1], [], [stderr])
6357 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6358 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6361 dnl Check match field with tun_metadata
6362 AT_CHECK([ovs-ofctl add-flow br0 "tun_metadata0=0x11223344 actions=output:2"], [0], [], [stderr])
6363 AT_CHECK([ovs-ofctl add-flow br0 "tun_metadata1=0x11223344 actions=output:2"], [1], [], [stderr])
6364 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6365 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6368 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl)
6370 in_port=1 actions=move:NXM_NX_TUN_METADATA0[[0..31]]->NXM_NX_REG0[[]]
6371 tun_metadata0=0x11223344 actions=output:2
6374 OVS_VSWITCHD_STOP(["/NXFMFC_INVALID_TLV_FIELD/d
6376 /OFPBAC_BAD_SET_LEN/d"])
6379 AT_SETUP([ofproto - flush flows, groups, and meters for controller change])
6380 AT_KEYWORDS([flow flows group group meter])
6383 add_flow_group_and_meter () {
6384 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
6385 AT_CHECK([ovs-ofctl -O OpenFlow11 add-group br0 group_id=1234,type=all,bucket=output:10
6386 AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=1 pktps burst stats bands=type=drop rate=1 burst_size=1'])
6391 AT_CHECK([ovs-ofctl --no-stats dump-flows br0], [0], [dnl
6392 in_port=1 actions=output:2
6394 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-groups br0], [0], [dnl
6395 OFPST_GROUP_DESC reply (OF1.1) (xid=0x2):
6396 group_id=1234,type=all,bucket=actions=output:10
6398 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-meters br0], [0], [dnl
6399 OFPST_METER_CONFIG reply (OF1.3) (xid=0x2):
6400 meter=1 pktps burst stats bands=
6401 type=drop rate=1 burst_size=1
6406 AT_CHECK([ovs-ofctl --no-stats dump-flows br0])
6407 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-groups br0], [0], [dnl
6408 OFPST_GROUP_DESC reply (OF1.1) (xid=0x2):
6410 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-meters br0], [0], [dnl
6411 OFPST_METER_CONFIG reply (OF1.3) (xid=0x2):
6415 # Add flow, group, meter and check that they're there, without a controller.
6416 add_flow_group_and_meter
6419 # Set up a controller and verify that the flow and group were deleted,
6420 # then add them back.
6421 AT_CHECK([ovs-vsctl set-controller br0 'tcp:<invalid>:6653'])
6423 add_flow_group_and_meter
6426 # Change the controller and verify that the flow and group are still there.
6427 AT_CHECK([ovs-vsctl set-controller br0 'tcp:<invalid2>:6653'])
6430 # Clear the controller and verify that the flow and group were deleted.
6431 AT_CHECK([ovs-vsctl del-controller br0])
6434 OVS_VSWITCHD_STOP(["/<invalid/d"])