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 in_port: exact match or wildcard
2209 eth_src: exact match or wildcard
2210 eth_dst: exact match or wildcard
2211 eth_type: exact match or wildcard
2212 vlan_vid: exact match or wildcard
2213 vlan_pcp: exact match or wildcard
2214 ip_src: exact match or wildcard
2215 ip_dst: exact match or wildcard
2216 nw_proto: exact match or wildcard
2217 nw_tos: exact match or wildcard
2218 tcp_src: exact match or wildcard
2219 tcp_dst: exact match or wildcard
2223 (head_table; echo ' tables 1...253: ditto') > expout
2224 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
2225 # Change the configuration.
2228 -- --id=@t0 create Flow_Table name=main \
2229 -- --id=@t1 create Flow_Table flow-limit=1024 \
2230 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
2235 # Check that the configuration was updated.
2236 (head_table ' ("main")'; echo ' table 1:
2237 active=0, lookup=0, matched=0
2242 active=0, lookup=0, matched=0
2245 '; echo ' tables 3...253: ditto') > expout
2246 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
2250 dnl In-band and fail-open add "hidden rules" to table 0. These rules shouldn't
2251 dnl be visible to OpenFlow. This test checks that "dump-flows" and
2252 dnl "dump-tables" don't make them visible.
2253 AT_SETUP([ofproto - hidden rules not in table stats])
2254 # Use an IP address for a controller that won't actually exist: we
2255 # want to create in-band rules but we do not want to actually connect
2256 # to a controller (because that could mess about with our test). The
2257 # Class E range 240.0.0.0 - 255.255.255.255 seems like a good choice.
2258 OVS_VSWITCHD_START([set-controller br0 tcp:240.0.0.1:6653])
2259 for i in 1 2 3 4 5; do ovs-appctl time/warp 1000; done
2261 # Check that no hidden flows are visible in OpenFlow.
2262 AT_CHECK([ovs-ofctl dump-flows br0 | strip_xids], [0], [NXST_FLOW reply:
2265 # Check that some hidden flows related to 240.0.0.1 are actually in table 0.
2267 # We discard flows that mention table_id because we only want table 0 flows,
2268 # which in OVS is implied by the absence of a table_id.
2269 AT_CHECK([ovs-appctl bridge/dump-flows br0], [0], [stdout])
2270 AT_CHECK([test `grep '240\.0\.0\.1' stdout | grep -v table_id= | wc -l` -gt 0])
2272 # Check that dump-tables doesn't count the hidden flows.
2274 printf 'OFPST_TABLE reply:
2276 active=0, lookup=0, matched=0
2279 in_port: exact match or wildcard
2280 eth_src: exact match or wildcard
2281 eth_dst: exact match or wildcard
2282 eth_type: exact match or wildcard
2283 vlan_vid: exact match or wildcard
2284 vlan_pcp: exact match or wildcard
2285 ip_src: exact match or wildcard
2286 ip_dst: exact match or wildcard
2287 nw_proto: exact match or wildcard
2288 nw_tos: exact match or wildcard
2289 tcp_src: exact match or wildcard
2290 tcp_dst: exact match or wildcard
2294 (head_table; echo ' tables 1...253: ditto') > expout
2295 AT_CHECK([ovs-ofctl dump-tables br0 | strip_xids], [0], [expout])
2296 OVS_VSWITCHD_STOP(["/240\.0\.0\.1/d"])
2299 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)])
2301 # Check the default configuration.
2303 printf 'OFPST_TABLE reply (OF1.2) (xid=0x2):
2305 active=0, lookup=0, matched=0
2306 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2309 instructions (table miss and others):
2310 instructions: apply_actions,clear_actions,write_actions,write_metadata,goto_table
2311 Write-Actions and Apply-Actions features:
2312 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
2313 supported on Set-Field: metadata in_port_oxm eth_src eth_dst vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ipv6_label ip_dscp nw_ecn arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst icmp_type icmp_code icmpv6_type icmpv6_code nd_target nd_sll nd_tll
2315 metadata: exact match or wildcard
2316 in_port_oxm: exact match or wildcard
2317 eth_src: exact match or wildcard
2318 eth_dst: exact match or wildcard
2319 eth_type: exact match or wildcard
2320 vlan_vid: exact match or wildcard
2321 vlan_pcp: exact match or wildcard
2322 mpls_label: exact match or wildcard
2323 mpls_tc: exact match or wildcard
2324 ip_src: exact match or wildcard
2325 ip_dst: exact match or wildcard
2326 ipv6_src: exact match or wildcard
2327 ipv6_dst: exact match or wildcard
2328 ipv6_label: exact match or wildcard
2329 nw_proto: exact match or wildcard
2330 ip_dscp: exact match or wildcard
2331 nw_ecn: exact match or wildcard
2332 arp_op: exact match or wildcard
2333 arp_spa: exact match or wildcard
2334 arp_tpa: exact match or wildcard
2335 arp_sha: exact match or wildcard
2336 arp_tha: exact match or wildcard
2337 tcp_src: exact match or wildcard
2338 tcp_dst: exact match or wildcard
2339 udp_src: exact match or wildcard
2340 udp_dst: exact match or wildcard
2341 sctp_src: exact match or wildcard
2342 sctp_dst: exact match or wildcard
2343 icmp_type: exact match or wildcard
2344 icmp_code: exact match or wildcard
2345 icmpv6_type: exact match or wildcard
2346 icmpv6_code: exact match or wildcard
2347 nd_target: exact match or wildcard
2348 nd_sll: exact match or wildcard
2349 nd_tll: exact match or wildcard
2355 active=0, lookup=0, matched=0
2356 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2359 instructions (table miss and others):
2360 instructions: apply_actions,clear_actions,write_actions,write_metadata
2365 (head_table; printf ' tables 1...252: ditto\n\n'; tail_table) > expout
2366 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
2367 # Change the configuration.
2370 -- --id=@t0 create Flow_Table name=main \
2371 -- --id=@t1 create Flow_Table flow-limit=1024 \
2372 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
2377 # Check that the configuration was updated.
2378 (head_table ' ("main")'; echo ' table 1:
2379 active=0, lookup=0, matched=0
2380 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2387 active=0, lookup=0, matched=0
2388 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2393 '; printf ' tables 3...252: ditto\n\n'; tail_table) > expout
2394 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
2398 AT_SETUP([ofproto - table features (OpenFlow 1.3)])
2402 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2404 instructions (table miss and others):
2406 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata,goto_table
2407 Write-Actions and Apply-Actions features:
2408 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
2409 supported on Set-Field: tun_id tun_src tun_dst tun_ipv6_src tun_ipv6_dst tun_flags tun_gbp_id tun_gbp_flags tun_erspan_idx tun_erspan_ver tun_erspan_dir tun_erspan_hwid tun_metadata0 dnl
2410 tun_metadata1 tun_metadata2 tun_metadata3 tun_metadata4 tun_metadata5 tun_metadata6 tun_metadata7 tun_metadata8 tun_metadata9 tun_metadata10 tun_metadata11 tun_metadata12 tun_metadata13 tun_metadata14 tun_metadata15 tun_metadata16 tun_metadata17 tun_metadata18 tun_metadata19 tun_metadata20 tun_metadata21 tun_metadata22 tun_metadata23 tun_metadata24 tun_metadata25 tun_metadata26 tun_metadata27 tun_metadata28 tun_metadata29 tun_metadata30 tun_metadata31 tun_metadata32 tun_metadata33 tun_metadata34 tun_metadata35 tun_metadata36 tun_metadata37 tun_metadata38 tun_metadata39 tun_metadata40 tun_metadata41 tun_metadata42 tun_metadata43 tun_metadata44 tun_metadata45 tun_metadata46 tun_metadata47 tun_metadata48 tun_metadata49 tun_metadata50 tun_metadata51 tun_metadata52 tun_metadata53 tun_metadata54 tun_metadata55 tun_metadata56 tun_metadata57 tun_metadata58 tun_metadata59 tun_metadata60 tun_metadata61 tun_metadata62 tun_metadata63 dnl
2411 metadata in_port in_port_oxm pkt_mark ct_mark ct_label reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 reg9 reg10 reg11 reg12 reg13 reg14 reg15 xreg0 xreg1 xreg2 xreg3 xreg4 xreg5 xreg6 xreg7 xxreg0 xxreg1 xxreg2 xxreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc mpls_ttl ip_src ip_dst ipv6_src ipv6_dst ipv6_label nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst icmp_type icmp_code icmpv6_type icmpv6_code nd_target nd_sll nd_tll nd_reserved nd_options_type nsh_flags nsh_spi nsh_si nsh_c1 nsh_c2 nsh_c3 nsh_c4 nsh_ttl
2413 dp_hash: arbitrary mask
2414 recirc_id: exact match or wildcard
2415 packet_type: exact match or wildcard
2416 conj_id: exact match or wildcard
2417 tun_id: arbitrary mask
2418 tun_src: arbitrary mask
2419 tun_dst: arbitrary mask
2420 tun_ipv6_src: arbitrary mask
2421 tun_ipv6_dst: arbitrary mask
2422 tun_flags: arbitrary mask
2423 tun_gbp_id: arbitrary mask
2424 tun_gbp_flags: arbitrary mask
2425 tun_erspan_idx: arbitrary mask
2426 tun_erspan_ver: arbitrary mask
2427 tun_erspan_dir: arbitrary mask
2428 tun_erspan_hwid: arbitrary mask
2429 tun_metadata0: arbitrary mask
2430 tun_metadata1: arbitrary mask
2431 tun_metadata2: arbitrary mask
2432 tun_metadata3: arbitrary mask
2433 tun_metadata4: arbitrary mask
2434 tun_metadata5: arbitrary mask
2435 tun_metadata6: arbitrary mask
2436 tun_metadata7: arbitrary mask
2437 tun_metadata8: arbitrary mask
2438 tun_metadata9: arbitrary mask
2439 tun_metadata10: arbitrary mask
2440 tun_metadata11: arbitrary mask
2441 tun_metadata12: arbitrary mask
2442 tun_metadata13: arbitrary mask
2443 tun_metadata14: arbitrary mask
2444 tun_metadata15: arbitrary mask
2445 tun_metadata16: arbitrary mask
2446 tun_metadata17: arbitrary mask
2447 tun_metadata18: arbitrary mask
2448 tun_metadata19: arbitrary mask
2449 tun_metadata20: arbitrary mask
2450 tun_metadata21: arbitrary mask
2451 tun_metadata22: arbitrary mask
2452 tun_metadata23: arbitrary mask
2453 tun_metadata24: arbitrary mask
2454 tun_metadata25: arbitrary mask
2455 tun_metadata26: arbitrary mask
2456 tun_metadata27: arbitrary mask
2457 tun_metadata28: arbitrary mask
2458 tun_metadata29: arbitrary mask
2459 tun_metadata30: arbitrary mask
2460 tun_metadata31: arbitrary mask
2461 tun_metadata32: arbitrary mask
2462 tun_metadata33: arbitrary mask
2463 tun_metadata34: arbitrary mask
2464 tun_metadata35: arbitrary mask
2465 tun_metadata36: arbitrary mask
2466 tun_metadata37: arbitrary mask
2467 tun_metadata38: arbitrary mask
2468 tun_metadata39: arbitrary mask
2469 tun_metadata40: arbitrary mask
2470 tun_metadata41: arbitrary mask
2471 tun_metadata42: arbitrary mask
2472 tun_metadata43: arbitrary mask
2473 tun_metadata44: arbitrary mask
2474 tun_metadata45: arbitrary mask
2475 tun_metadata46: arbitrary mask
2476 tun_metadata47: arbitrary mask
2477 tun_metadata48: arbitrary mask
2478 tun_metadata49: arbitrary mask
2479 tun_metadata50: arbitrary mask
2480 tun_metadata51: arbitrary mask
2481 tun_metadata52: arbitrary mask
2482 tun_metadata53: arbitrary mask
2483 tun_metadata54: arbitrary mask
2484 tun_metadata55: arbitrary mask
2485 tun_metadata56: arbitrary mask
2486 tun_metadata57: arbitrary mask
2487 tun_metadata58: arbitrary mask
2488 tun_metadata59: arbitrary mask
2489 tun_metadata60: arbitrary mask
2490 tun_metadata61: arbitrary mask
2491 tun_metadata62: arbitrary mask
2492 tun_metadata63: arbitrary mask
2493 metadata: arbitrary mask
2494 in_port: exact match or wildcard
2495 in_port_oxm: exact match or wildcard
2496 actset_output: exact match or wildcard
2497 pkt_mark: arbitrary mask
2498 ct_state: arbitrary mask
2499 ct_zone: exact match or wildcard
2500 ct_mark: arbitrary mask
2501 ct_label: arbitrary mask
2502 ct_nw_proto: exact match or wildcard
2503 ct_nw_src: arbitrary mask
2504 ct_nw_dst: arbitrary mask
2505 ct_ipv6_src: arbitrary mask
2506 ct_ipv6_dst: arbitrary mask
2507 ct_tp_src: arbitrary mask
2508 ct_tp_dst: arbitrary mask
2509 reg0: arbitrary mask
2510 reg1: arbitrary mask
2511 reg2: arbitrary mask
2512 reg3: arbitrary mask
2513 reg4: arbitrary mask
2514 reg5: arbitrary mask
2515 reg6: arbitrary mask
2516 reg7: arbitrary mask
2517 reg8: arbitrary mask
2518 reg9: arbitrary mask
2519 reg10: arbitrary mask
2520 reg11: arbitrary mask
2521 reg12: arbitrary mask
2522 reg13: arbitrary mask
2523 reg14: arbitrary mask
2524 reg15: arbitrary mask
2525 xreg0: arbitrary mask
2526 xreg1: arbitrary mask
2527 xreg2: arbitrary mask
2528 xreg3: arbitrary mask
2529 xreg4: arbitrary mask
2530 xreg5: arbitrary mask
2531 xreg6: arbitrary mask
2532 xreg7: arbitrary mask
2533 xxreg0: arbitrary mask
2534 xxreg1: arbitrary mask
2535 xxreg2: arbitrary mask
2536 xxreg3: arbitrary mask
2537 eth_src: arbitrary mask
2538 eth_dst: arbitrary mask
2539 eth_type: exact match or wildcard
2540 vlan_tci: arbitrary mask
2541 vlan_vid: arbitrary mask
2542 vlan_pcp: exact match or wildcard
2543 mpls_label: exact match or wildcard
2544 mpls_tc: exact match or wildcard
2545 mpls_bos: exact match or wildcard
2546 mpls_ttl: exact match or wildcard
2547 ip_src: arbitrary mask
2548 ip_dst: arbitrary mask
2549 ipv6_src: arbitrary mask
2550 ipv6_dst: arbitrary mask
2551 ipv6_label: arbitrary mask
2552 nw_proto: exact match or wildcard
2553 nw_tos: exact match or wildcard
2554 ip_dscp: exact match or wildcard
2555 nw_ecn: exact match or wildcard
2556 nw_ttl: exact match or wildcard
2557 ip_frag: arbitrary mask
2558 arp_op: exact match or wildcard
2559 arp_spa: arbitrary mask
2560 arp_tpa: arbitrary mask
2561 arp_sha: arbitrary mask
2562 arp_tha: arbitrary mask
2563 tcp_src: arbitrary mask
2564 tcp_dst: arbitrary mask
2565 tcp_flags: arbitrary mask
2566 udp_src: arbitrary mask
2567 udp_dst: arbitrary mask
2568 sctp_src: arbitrary mask
2569 sctp_dst: arbitrary mask
2570 icmp_type: exact match or wildcard
2571 icmp_code: exact match or wildcard
2572 icmpv6_type: exact match or wildcard
2573 icmpv6_code: exact match or wildcard
2574 nd_target: arbitrary mask
2575 nd_sll: arbitrary mask
2576 nd_tll: arbitrary mask
2577 nd_reserved: exact match or wildcard
2578 nd_options_type: exact match or wildcard
2579 nsh_flags: arbitrary mask
2580 nsh_mdtype: exact match or wildcard
2581 nsh_np: exact match or wildcard
2582 nsh_spi: exact match or wildcard
2583 nsh_si: exact match or wildcard
2584 nsh_c1: arbitrary mask
2585 nsh_c2: arbitrary mask
2586 nsh_c3: arbitrary mask
2587 nsh_c4: arbitrary mask
2588 nsh_ttl: exact match or wildcard
2594 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2596 instructions (table miss and others):
2597 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata
2603 printf ' tables 1...252: ditto\n\n'
2604 tail_tables) > expout
2605 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
2606 # Change the configuration.
2609 -- --id=@t0 create Flow_Table name=main \
2610 -- --id=@t1 create Flow_Table flow-limit=1024 \
2611 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
2616 # Check that the configuration was updated.
2617 (head_table ' ("main")'
2619 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2625 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
2630 tables 3...252: ditto
2632 tail_tables) > expout
2633 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
2637 AT_SETUP([ofproto - flow table names])
2639 add_of_ports br0 1 2
2641 # Set a table name via OpenFlow 1.3 and one via OpenFlow 1.5.
2642 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 0 name:xyzzy])
2643 AT_CHECK([ovs-ofctl -O OpenFlow15 mod-table br0 1 name:quux])
2644 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2647 table 1 ("quux"): ditto
2648 tables 2...252: ditto
2652 # Set some table names via OVSDB.
2655 -- --id=@t0 create Flow_Table name=zero \
2656 -- --id=@t1 create Flow_Table name=one \
2657 -- --id=@t2 create Flow_Table name=two \
2658 -- set bridge br0 'flow_tables={0=@t0,1=@t1,2=@t2}' \
2664 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2667 table 1 ("one"): ditto
2668 table 2 ("two"): ditto
2669 tables 3...252: ditto
2673 # Check that flow table parsing and dumping uses the names.
2674 AT_DATA([flows.txt], [dnl
2675 table=zero in_port=p2 actions=p1,resubmit(,one)
2676 table=one,in_port=p1,ip,actions=ct(table=two)
2677 table=one,in_port=p1,arp,actions=goto_table(two)
2679 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2680 AT_CHECK([ovs-ofctl --names --no-stats dump-flows br0], [0], [dnl
2681 table=zero, in_port=p2 actions=output:p1,resubmit(,one)
2682 table=one, ip,in_port=p1 actions=ct(table=two)
2683 table=one, arp,in_port=p1 actions=resubmit(,two)
2685 AT_CHECK([ovs-ofctl --no-names --no-stats dump-flows br0], [0], [dnl
2686 in_port=2 actions=output:1,resubmit(,1)
2687 table=1, ip,in_port=1 actions=ct(table=2)
2688 table=1, arp,in_port=1 actions=resubmit(,2)
2691 # Setting the same table names via OpenFlow 1.3 or OpenFlow 1.5 is a no-op.
2692 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 0 name:zero])
2693 AT_CHECK([ovs-ofctl -O OpenFlow15 mod-table br0 1 name:one])
2694 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2697 table 1 ("one"): ditto
2698 table 2 ("two"): ditto
2699 tables 3...252: ditto
2703 # Setting different tables names via OpenFlow 1.3 or OpenFlow 1.5 yield errors.
2704 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 0 name:xyzzy], 1, [], [stderr])
2705 AT_CHECK([head -1 stderr], [0], [OFPT_ERROR (OF1.3) (xid=0x5): OFPTFFC_EPERM
2707 AT_CHECK([ovs-ofctl -O OpenFlow15 mod-table br0 1 name:quux], 1, [], [stderr])
2708 AT_CHECK([head -1 stderr], [0], [OFPT_ERROR (OF1.5) (xid=0x5): OFPTFFC_EPERM
2711 # But we can still set table names for those not set via OVSDB.
2712 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 3 name:three])
2713 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2716 table 1 ("one"): ditto
2717 table 2 ("two"): ditto
2718 table 3 ("three"): ditto
2719 tables 4...252: ditto
2723 # Unsetting names via OVSDB then setting them via OpenFlow works too.
2724 AT_CHECK([ovs-vsctl remove bridge br0 Flow_Table 2])
2725 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2728 table 1 ("one"): ditto
2730 table 3 ("three"): ditto
2731 tables 4...252: ditto
2734 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 2 name:foobar])
2735 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2738 table 1 ("one"): ditto
2739 table 2 ("foobar"): ditto
2740 table 3 ("three"): ditto
2741 tables 4...252: ditto
2745 # We can clear names via OpenFlow, at least if they were set that way.
2746 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 2 name:])
2747 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^ table'],
2750 table 1 ("one"): ditto
2752 table 3 ("three"): ditto
2753 tables 4...252: ditto
2760 AT_SETUP([ofproto - table description (OpenFlow 1.4)])
2763 while test $x -lt 254; do
2766 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
2770 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
2771 /^OFPST_TABLE_DESC/d'], [0], [expout])
2773 # Change the configuration.
2774 AT_CHECK([ovs-ofctl -O Openflow14 mod-table br0 0 evict])
2775 # Check that the configuration was updated.
2776 mv expout orig-expout
2777 sed -e '2s/eviction=off/eviction=on/' <orig-expout > expout
2778 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
2779 /^OFPST_TABLE_DESC/d'], [0], [expout])
2781 AT_CHECK([ovs-ofctl -O Openflow14 mod-table br0 0 vacancy:20,80])
2782 # Check that the configuration was updated.
2783 mv expout orig-expout
2784 sed -e '3s/vacancy=off/vacancy=on vacancy_down=20% vacancy_up=80% vacancy=100%/' <orig-expout > expout
2785 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
2786 /^OFPST_TABLE_DESC/d'], [0], [expout])
2790 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)])
2792 # Configure a maximum of 4 flows.
2795 -- --id=@t0 create Flow_Table flow-limit=4 \
2796 -- set bridge br0 flow_tables:0=@t0 \
2801 for in_port in 1 2 3 4; do
2802 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
2804 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2805 in_port=1 actions=drop
2806 in_port=2 actions=drop
2807 in_port=3 actions=drop
2808 in_port=4 actions=drop
2811 # Adding another flow will be refused.
2812 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
2813 AT_CHECK([ofctl_strip < stderr], [0],
2814 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2815 OFPT_FLOW_MOD: ADD in_port=5 actions=drop
2817 # Also a mod-flow that would add a flow will be refused.
2818 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
2819 AT_CHECK([ofctl_strip < stderr], [0],
2820 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2821 OFPT_FLOW_MOD: MOD in_port=5 actions=drop
2823 # Replacing or modifying an existing flow is allowed.
2824 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
2825 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
2826 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2827 in_port=1 actions=drop
2828 in_port=2 actions=drop
2829 in_port=3 actions=output:1
2830 in_port=4 actions=NORMAL
2836 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)])
2838 # Configure a maximum of 4 flows.
2841 -- --id=@t0 create Flow_Table flow-limit=4 \
2842 -- set bridge br0 flow_tables:0=@t0 \
2847 for in_port in 1 2 3 4; do
2848 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
2850 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2851 in_port=1 actions=drop
2852 in_port=2 actions=drop
2853 in_port=3 actions=drop
2854 in_port=4 actions=drop
2855 OFPST_FLOW reply (OF1.2):
2857 # Adding another flow will be refused.
2858 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
2859 AT_CHECK([ofctl_strip < stderr], [0],
2860 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
2861 OFPT_FLOW_MOD (OF1.2): ADD in_port=5 actions=drop
2863 # Replacing or modifying an existing flow is allowed.
2864 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
2865 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
2866 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2867 in_port=1 actions=drop
2868 in_port=2 actions=drop
2869 in_port=3 actions=output:1
2870 in_port=4 actions=NORMAL
2871 OFPST_FLOW reply (OF1.2):
2876 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
2878 # Configure a maximum of 4 flows.
2881 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2882 -- set bridge br0 flow_tables:0=@t0 \
2887 for in_port in 4 3 2 1; do
2888 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
2890 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2891 idle_timeout=10, in_port=1 actions=drop
2892 idle_timeout=20, in_port=2 actions=drop
2893 idle_timeout=30, in_port=3 actions=drop
2894 idle_timeout=40, in_port=4 actions=drop
2897 # Adding another flow will cause the one that expires soonest to be evicted.
2898 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
2899 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2900 idle_timeout=20, in_port=2 actions=drop
2901 idle_timeout=30, in_port=3 actions=drop
2902 idle_timeout=40, in_port=4 actions=drop
2903 in_port=5 actions=drop
2906 # A mod-flow that adds a flow also causes eviction, but replacing or
2907 # modifying an existing flow doesn't.
2908 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
2909 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
2910 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
2911 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2912 idle_timeout=30, in_port=3 actions=output:1
2913 in_port=4 actions=NORMAL
2914 in_port=5 actions=drop
2915 in_port=6 actions=drop
2918 # Flows with no timeouts at all cannot be evicted.
2919 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
2920 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
2921 AT_CHECK([ofctl_strip < stderr], [0],
2922 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2923 OFPT_FLOW_MOD: ADD in_port=8 actions=drop
2925 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2926 in_port=4 actions=NORMAL
2927 in_port=5 actions=drop
2928 in_port=6 actions=drop
2929 in_port=7 actions=NORMAL
2935 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
2937 # Configure a maximum of 4 flows.
2940 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2941 -- set bridge br0 flow_tables:0=@t0 \
2946 for in_port in 4 3 2 1; do
2947 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
2949 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2950 idle_timeout=10, in_port=1 actions=drop
2951 idle_timeout=20, in_port=2 actions=drop
2952 idle_timeout=30, in_port=3 actions=drop
2953 idle_timeout=40, in_port=4 actions=drop
2954 OFPST_FLOW reply (OF1.2):
2956 # Adding another flow will cause the one that expires soonest to be evicted.
2957 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
2958 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2959 idle_timeout=20, in_port=2 actions=drop
2960 idle_timeout=30, in_port=3 actions=drop
2961 idle_timeout=40, in_port=4 actions=drop
2962 in_port=5 actions=drop
2963 OFPST_FLOW reply (OF1.2):
2965 # In OpenFlow 1.2 a mod-flow does not ever add a flow and thus
2966 # has no effect on eviction
2967 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
2968 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
2969 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
2970 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2971 idle_timeout=20, in_port=2 actions=drop
2972 idle_timeout=30, in_port=3 actions=output:1
2973 in_port=4 actions=NORMAL
2974 in_port=5 actions=drop
2975 OFPST_FLOW reply (OF1.2):
2977 # Flows with no timeouts at all cannot be evicted.
2978 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
2979 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
2980 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
2981 AT_CHECK([ofctl_strip < stderr], [0],
2982 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
2983 OFPT_FLOW_MOD (OF1.2): ADD in_port=8 actions=drop
2985 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2986 in_port=4 actions=NORMAL
2987 in_port=5 actions=drop
2988 in_port=6 actions=drop
2989 in_port=7 actions=NORMAL
2990 OFPST_FLOW reply (OF1.2):
2995 AT_SETUP([ofproto - eviction using importance upon table overflow (OpenFlow 1.4)])
2997 # Configure a maximum of 4 flows.
3000 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
3001 -- set bridge br0 flow_tables:0=@t0 \
3005 # Use mod-table to turn on eviction just to demonstrate that it works.
3006 AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 evict])
3008 for in_port in 4 3 2 1; do
3009 ovs-ofctl -O Openflow14 add-flow br0 importance=$((in_port + 30)),priority=$((in_port + 5)),hard_timeout=$((in_port + 500)),actions=drop
3011 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3012 hard_timeout=501, importance=31, priority=6 actions=drop
3013 hard_timeout=502, importance=32, priority=7 actions=drop
3014 hard_timeout=503, importance=33, priority=8 actions=drop
3015 hard_timeout=504, importance=34, priority=9 actions=drop
3016 OFPST_FLOW reply (OF1.4):
3018 # Adding another flow will cause the one with lowest importance to be evicted.
3019 AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=505,importance=35,priority=10,in_port=2,actions=drop])
3020 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3021 hard_timeout=502, importance=32, priority=7 actions=drop
3022 hard_timeout=503, importance=33, priority=8 actions=drop
3023 hard_timeout=504, importance=34, priority=9 actions=drop
3024 hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop
3025 OFPST_FLOW reply (OF1.4):
3027 # Disable the Eviction configuration.
3028 AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 noevict])
3029 # Adding another flow will cause the system to give error for FULL TABLE.
3030 AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=506,importance=36,priority=11,actions=drop],[1], [], [stderr])
3031 AT_CHECK([ofctl_strip < stderr], [0],
3032 [OFPT_ERROR (OF1.4): OFPFMFC_TABLE_FULL
3033 OFPT_FLOW_MOD (OF1.4): ADD priority=11 hard:506 importance:36 actions=drop
3035 #Dump flows. It should show only the old values
3036 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3037 hard_timeout=502, importance=32, priority=7 actions=drop
3038 hard_timeout=503, importance=33, priority=8 actions=drop
3039 hard_timeout=504, importance=34, priority=9 actions=drop
3040 hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop
3041 OFPST_FLOW reply (OF1.4):
3043 # mod-flow that would modify a flow will be done successfully.
3044 AT_CHECK([ovs-ofctl -O Openflow14 mod-flows br0 in_port=2,actions=NORMAL])
3045 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3046 hard_timeout=502, importance=32, priority=7 actions=drop
3047 hard_timeout=503, importance=33, priority=8 actions=drop
3048 hard_timeout=504, importance=34, priority=9 actions=drop
3049 hard_timeout=505, importance=35, priority=10,in_port=2 actions=NORMAL
3050 OFPST_FLOW reply (OF1.4):
3052 # Also a mod-flow that would add a flow will be refused.
3053 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
3054 AT_CHECK([ofctl_strip < stderr], [0],
3055 [OFPT_ERROR: OFPFMFC_TABLE_FULL
3056 OFPT_FLOW_MOD: MOD in_port=5 actions=drop
3061 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
3063 # Configure a maximum of 4 flows.
3066 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
3067 overflow-policy=evict \
3068 groups='"NXM_OF_IN_PORT[[]]"' \
3069 -- set bridge br0 flow_tables:0=@t0 \
3074 ovs-ofctl add-flows br0 - <<EOF
3075 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
3076 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
3077 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
3078 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
3080 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3081 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
3082 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
3083 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
3084 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
3087 # Adding another flow will cause the one that expires soonest within
3088 # the largest group (those with in_port=1) to be evicted. In this
3089 # case this is not the same as the one that expires soonest overall
3090 # (which is what makes the test interesting):
3091 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
3092 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3093 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
3094 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
3095 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
3096 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
3099 # Enlarge the flow limit, change the eviction policy back to strictly
3100 # based on expiration, and and add some flows.
3101 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
3102 ovs-ofctl add-flows br0 - <<EOF
3103 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
3104 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
3105 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
3107 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3108 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
3109 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
3110 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
3111 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3112 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
3113 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
3114 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
3117 # Adding another flow will cause the one that expires soonest overall
3119 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
3120 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3121 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
3122 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
3123 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3124 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
3125 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
3126 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
3127 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
3130 # Reducing the flow limit also causes the flows that expire soonest
3131 # overall to be evicted.
3132 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
3133 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3134 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
3135 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
3136 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
3137 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
3143 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
3145 # Configure a maximum of 4 flows.
3148 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
3149 overflow-policy=evict \
3150 groups='"NXM_OF_IN_PORT[[]]"' \
3151 -- set bridge br0 flow_tables:0=@t0 \
3156 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
3157 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
3158 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
3159 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
3160 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
3162 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3163 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
3164 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
3165 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
3166 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
3167 OFPST_FLOW reply (OF1.2):
3169 # Adding another flow will cause the one that expires soonest within
3170 # the largest group (those with in_port=1) to be evicted. In this
3171 # case this is not the same as the one that expires soonest overall
3172 # (which is what makes the test interesting):
3173 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
3174 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3175 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
3176 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
3177 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
3178 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
3179 OFPST_FLOW reply (OF1.2):
3181 # Enlarge the flow limit, change the eviction policy back to strictly
3182 # based on expiration, and and add some flows.
3183 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
3184 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
3185 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
3186 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
3187 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
3189 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3190 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
3191 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
3192 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
3193 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3194 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
3195 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
3196 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
3197 OFPST_FLOW reply (OF1.2):
3199 # Adding another flow will cause the one that expires soonest overall
3201 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'])
3202 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3203 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
3204 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
3205 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3206 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
3207 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
3208 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
3209 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
3210 OFPST_FLOW reply (OF1.2):
3212 # Reducing the flow limit also causes the flows that expire soonest
3213 # overall to be evicted.
3214 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
3215 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3216 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
3217 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
3218 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
3219 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
3220 OFPST_FLOW reply (OF1.2):
3225 AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout])
3227 # Configure a maximum of 4 flows.
3230 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
3231 -- set bridge br0 flow_tables:0=@t0 \
3235 ovs-appctl time/stop
3237 for in_port in 4 3 2 1; do
3238 ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
3240 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3241 hard_timeout=13, in_port=1 actions=drop
3242 hard_timeout=16, in_port=2 actions=drop
3243 hard_timeout=19, in_port=3 actions=drop
3244 hard_timeout=22, in_port=4 actions=drop
3247 # Sleep and modify the one that expires soonest
3248 ovs-appctl time/warp 5000
3249 AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop])
3250 # At this point the table would looks like:
3251 # in_port seconds to expire
3256 ovs-appctl time/warp 2000
3257 # Adding another flow will cause the one that expires soonest to be evicted.
3258 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
3259 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3260 hard_timeout=13, in_port=1 actions=drop
3261 hard_timeout=19, in_port=3 actions=drop
3262 hard_timeout=22, in_port=4 actions=drop
3263 in_port=5 actions=drop
3269 AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout])
3270 OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1])
3271 # Configure a maximum of 4 flows.
3274 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
3275 -- set bridge br0 flow_tables:0=@t0 \
3280 for in_port in 4 3 2 1; do
3281 ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
3283 ovs-appctl time/stop
3284 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3285 idle_timeout=13, in_port=1 actions=drop
3286 idle_timeout=16, in_port=2 actions=drop
3287 idle_timeout=19, in_port=3 actions=drop
3288 idle_timeout=22, in_port=4 actions=drop
3291 # Sleep and receive on the flow that expires soonest
3292 ovs-appctl time/warp 5000
3293 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)'])
3294 # At this point the table would looks like:
3295 # in_port seconds to expire
3300 ovs-appctl time/warp 2000
3301 # Adding another flow will cause the one that expires soonest to be evicted.
3302 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
3303 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3304 idle_timeout=19, in_port=3 actions=drop
3305 idle_timeout=22, in_port=4 actions=drop
3306 in_port=5 actions=drop
3307 n_packets=1, n_bytes=14, idle_timeout=13, in_port=1 actions=drop
3313 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
3314 OVS_VSWITCHD_START([set bridge br0 other_config:hwaddr=00:01:02:03:04:05])
3315 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
3317 printf '\n\n--- check_async %d ---\n\n\n' $1
3320 ovs-appctl -t ovs-ofctl ofctl/barrier
3321 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3324 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
3325 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
3326 if test X"$1" = X"OFPR_ACTION"; then shift;
3327 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3328 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3331 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
3332 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
3333 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
3334 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
3335 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3338 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
3339 ovs-ofctl packet-out br0 "in_port=controller packet=002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00 actions=dec_ttl"
3340 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
3341 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
3342 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"
3345 # OFPT_PORT_STATUS, OFPPR_ADD
3346 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
3347 if test X"$1" = X"OFPPR_ADD"; then shift;
3348 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
3351 speed: 0 Mbps now, 0 Mbps max"
3354 # OFPT_PORT_STATUS, OFPPR_DELETE
3355 ovs-vsctl del-port br0 test
3356 if test X"$1" = X"OFPPR_DELETE"; then shift;
3357 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
3360 speed: 0 Mbps now, 0 Mbps max"
3363 # OFPT_FLOW_REMOVED, OFPRR_DELETE
3364 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
3365 ovs-ofctl --strict del-flows br0 ''
3366 if test X"$1" = X"OFPRR_DELETE"; then shift;
3367 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
3369 AT_FAIL_IF([test X"$1" != X])
3371 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3375 s/ (xid=0x[0-9a-fA-F]*)//
3377 s/00:0.$/00:0x/' < monitor.log]],
3381 # It's a service connection so initially there should be no async messages.
3384 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3385 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
3386 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3388 # Set miss_send_len to 128 and enable invalid_ttl.
3389 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
3390 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3392 # Become slave, which should disable everything except port status.
3393 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
3394 check_async 4 OFPPR_ADD OFPPR_DELETE
3396 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
3397 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
3398 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
3400 # Set controller ID 123.
3401 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
3402 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
3404 # Restore controller ID 0.
3405 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
3408 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
3409 check_async 7 OFPR_ACTION OFPPR_ADD
3411 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3415 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
3417 AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile])
3419 printf '\n\n--- check_async %d ---\n\n\n' $1
3423 ovs-appctl -t ovs-ofctl ofctl/barrier
3424 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3427 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
3428 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
3429 if test X"$1" = X"OFPR_ACTION"; then shift;
3430 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3431 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3434 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
3435 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
3436 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
3437 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
3438 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3441 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
3442 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
3443 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
3444 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
3445 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"
3448 # OFPT_PORT_STATUS, OFPPR_ADD
3449 ovs-vsctl add-port br0 test -- set Interface test type=dummy
3450 if test X"$1" = X"OFPPR_ADD"; then shift;
3451 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3454 speed: 0 Mbps now, 0 Mbps max
3455 OFPT_PORT_STATUS (OF1.2): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3458 speed: 0 Mbps now, 0 Mbps max"
3461 # OFPT_PORT_STATUS, OFPPR_DELETE
3462 ovs-vsctl del-port br0 test
3463 if test X"$1" = X"OFPPR_DELETE"; then shift;
3464 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3467 speed: 0 Mbps now, 0 Mbps max"
3470 # OFPT_FLOW_REMOVED, OFPRR_DELETE
3471 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
3472 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
3473 if test X"$1" = X"OFPRR_DELETE"; then shift;
3474 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
3476 AT_FAIL_IF([test X"$1" != X])
3478 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3482 s/ (xid=0x[0-9a-fA-F]*)//
3484 s/00:0.$/00:0x/' < monitor.log]],
3488 # It's a service connection so initially there should be no async messages.
3491 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3492 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
3493 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3495 # Set miss_send_len to 128 and enable invalid_ttl.
3496 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
3497 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
3499 # Become slave (OF 1.2), which should disable everything except port status.
3500 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
3501 check_async 4 OFPPR_ADD OFPPR_DELETE
3503 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
3504 ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
3505 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
3507 # Set controller ID 123.
3508 ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
3509 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
3511 # Restore controller ID 0.
3512 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
3514 # Become master (OF 1.2).
3515 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
3516 check_async 7 OFPR_ACTION OFPPR_ADD
3518 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3522 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
3523 OVS_VSWITCHD_START([dnl
3524 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=10
3526 AT_CHECK([ovs-ofctl -O OpenFlow13 -P standard monitor br0 --detach --no-chdir --pidfile])
3528 printf '\n\n--- check_async %d ---\n\n\n' $1
3532 ovs-appctl -t ovs-ofctl ofctl/barrier
3533 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3536 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
3537 # OFPR_ACTION_SET is treated as OFPR_ACTION in OpenFlow 1.3
3538 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
3539 ovs-ofctl -O OpenFlow13 add-flow br0 'in_port=10 actions=write_actions(output(CONTROLLER))'
3540 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)'
3541 if test X"$1" = X"OFPR_ACTION"; then shift;
3542 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3543 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3544 echo >>expout "OFPT_PACKET_IN (OF1.3): cookie=0x0 total_len=14 in_port=10 (via action) data_len=14 (unbuffered)
3545 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3548 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
3549 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
3550 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
3551 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
3552 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3555 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
3556 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
3557 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
3558 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
3559 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"
3562 # OFPT_PORT_STATUS, OFPPR_ADD
3563 ovs-vsctl add-port br0 test -- set Interface test type=dummy
3564 if test X"$1" = X"OFPPR_ADD"; then shift;
3565 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3568 speed: 0 Mbps now, 0 Mbps max
3569 OFPT_PORT_STATUS (OF1.3): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3572 speed: 0 Mbps now, 0 Mbps max"
3575 # OFPT_PORT_STATUS, OFPPR_DELETE
3576 ovs-vsctl del-port br0 test
3577 if test X"$1" = X"OFPPR_DELETE"; then shift;
3578 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3581 speed: 0 Mbps now, 0 Mbps max"
3584 # OFPT_FLOW_REMOVED, OFPRR_DELETE
3585 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
3586 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
3587 if test X"$1" = X"OFPRR_DELETE"; then shift;
3588 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
3591 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
3592 ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10
3593 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234
3594 ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234
3595 if test X"$1" = X"OFPRR_GROUP_DELETE"; then shift;
3596 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=group_delete table_id=0"
3599 AT_FAIL_IF([test X"$1" != X])
3601 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3605 s/ (xid=0x[0-9a-fA-F]*)//
3607 s/00:0.$/00:0x/' < monitor.log]],
3611 # It's a service connection so initially there should be no async messages.
3614 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3615 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
3616 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
3618 # Become slave (OF 1.3), which should disable everything except port status.
3619 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
3620 check_async 3 OFPPR_ADD OFPPR_DELETE
3622 # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
3623 ovs-appctl -t ovs-ofctl ofctl/send 041c00200000000200000002000000050000000500000002000000020000000d
3624 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
3626 # Set controller ID 123.
3627 ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
3628 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
3630 # Restore controller ID 0.
3631 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
3633 # Become master (OF 1.3).
3634 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
3635 check_async 6 OFPR_ACTION OFPPR_ADD
3637 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3641 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.4)])
3642 OVS_VSWITCHD_START([dnl
3643 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=10
3645 AT_CHECK([ovs-ofctl -O OpenFlow14 -P standard monitor br0 --detach --no-chdir --pidfile])
3647 printf '\n\n--- check_async %d ---\n\n\n' $1
3651 ovs-appctl -t ovs-ofctl ofctl/barrier
3652 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3655 # OFPT_PACKET_IN, OFPR_PACKET_OUT (controller_id=0)
3656 ovs-ofctl -O OpenFlow14 -v packet-out br0 none controller '0001020304050010203040501234'
3657 if test X"$1" = X"OFPR_PACKET_OUT"; then shift;
3658 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via packet_out) data_len=14 (unbuffered)
3659 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3662 # OFPT_PACKET_IN, OFPR_ACTION_SET (controller_id=0)
3663 ovs-ofctl -O OpenFlow14 add-flow br0 'in_port=10 actions=write_actions(output(CONTROLLER))'
3664 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)'
3665 if test X"$1" = X"OFPR_ACTION_SET"; then shift;
3666 echo >>expout "OFPT_PACKET_IN (OF1.4): cookie=0x0 total_len=14 in_port=10 (via action_set) data_len=14 (unbuffered)
3667 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3670 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
3671 ovs-ofctl -O OpenFlow14 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
3672 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
3673 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
3674 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
3677 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
3678 ovs-ofctl -O OpenFlow14 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
3679 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
3680 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
3681 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"
3684 # OFPT_PORT_STATUS, OFPPR_ADD
3685 ovs-vsctl add-port br0 test -- set Interface test type=dummy
3686 if test X"$1" = X"OFPPR_ADD"; then shift;
3687 echo >>expout "OFPT_PORT_STATUS (OF1.4): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3690 speed: 0 Mbps now, 0 Mbps max
3691 OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3694 speed: 0 Mbps now, 0 Mbps max"
3697 # OFPT_PORT_STATUS, OFPPR_MODIFY
3698 ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 test down
3699 if test X"$1" = X"OFPPR_MODIFY"; then shift;
3700 echo >>expout "OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3703 speed: 0 Mbps now, 0 Mbps max
3704 OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3707 speed: 0 Mbps now, 0 Mbps max"
3710 # OFPT_PORT_STATUS, OFPPR_DELETE
3711 ovs-vsctl del-port br0 test
3712 if test X"$1" = X"OFPPR_DELETE"; then shift;
3713 echo >>expout "OFPT_PORT_STATUS (OF1.4): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3716 speed: 0 Mbps now, 0 Mbps max"
3719 # OFPT_FLOW_REMOVED, OFPRR_DELETE
3720 ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=drop
3721 ovs-ofctl -O OpenFlow14 --strict del-flows br0 ''
3722 if test X"$1" = X"OFPRR_DELETE"; then shift;
3723 echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=delete table_id=0"
3726 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
3727 ovs-ofctl -O OpenFlow14 add-group br0 group_id=1234,type=all,bucket=output:10
3728 ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=group:1234
3729 ovs-ofctl -O OpenFlow14 --strict del-groups br0 group_id=1234
3730 if test X"$1" = X"OFPRR_GROUP_DELETE"; then shift;
3731 echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=group_delete table_id=0"
3734 # OFPT_TABLE_STATUS, OFPTR_VACANCY_UP
3735 if test X"$1" = X"OFPTR_VACANCY_UP"; then shift;
3736 ovs-vsctl -- --id=@t1 create Flow_Table flow-limit=10 -- set bridge br0 flow_tables:1=@t1
3738 # Turn on vacancy events, then add flows until we're full.
3739 # With initial vacancy of 100% and vacancy_up of 80%, so that
3740 # vacancy >= vacancy_up, this enables VACANY_DOWN events, so
3741 # we get a single such message when vacancy dips below 20%.
3742 ovs-ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80
3743 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2
3744 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2
3745 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2
3746 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2
3747 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2
3748 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2
3749 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2
3750 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2
3751 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2
3752 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2
3753 echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_DOWN
3756 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
3757 vacancy=on vacancy_down=20% vacancy_up=80% vacancy=10%"
3758 # Then delete flows until we're empty. Sending the
3759 # VACANCY_DOWN message enabled VACANCY_UP events, so we get a
3760 # single such message when vacancy rises above 80%.
3761 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1
3762 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2
3763 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3
3764 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4
3765 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5
3766 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6
3767 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7
3768 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8
3769 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9
3770 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10
3771 echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_UP
3774 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
3775 vacancy=on vacancy_down=20% vacancy_up=80% vacancy=90%"
3777 # Now approach vacancy from the other direction. First
3778 # disable vacancy events. With initial vacancy of 70%, so
3779 # that vacancy < vacancy_up, this enables VACANCY_UP events.
3780 # That means that filling up the table generates no message,
3781 # but deleting all the flows generates VACANCY_UP at the point
3782 # vacancy rises above 80%.
3783 ovs-ofctl -O OpenFlow14 mod-table br0 1 novacancy
3784 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2
3785 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2
3786 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2
3787 ovs-ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80
3788 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2
3789 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2
3790 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2
3791 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2
3792 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2
3793 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2
3794 ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2
3795 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1
3796 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2
3797 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3
3798 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4
3799 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5
3800 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6
3801 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7
3802 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8
3803 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9
3804 ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10
3805 echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_UP
3808 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
3809 vacancy=on vacancy_down=20% vacancy_up=80% vacancy=90%"
3812 AT_FAIL_IF([test X"$1" != X])
3814 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3818 s/ (xid=0x[0-9a-fA-F]*)//
3820 s/00:0.$/00:0x/' < monitor.log]],
3824 # It's a service connection so initially there should be no async messages.
3827 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3828 ovs-appctl -t ovs-ofctl ofctl/send 0509000c0123456700000080
3829 check_async 2 OFPR_PACKET_OUT OFPR_ACTION_SET OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
3831 # Become slave (OF 1.4), which should disable everything except port status.
3832 ovs-appctl -t ovs-ofctl ofctl/send 051800180000000200000003000000000000000000000001
3833 check_async 3 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
3835 # Use OF 1.4 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
3836 ovs-appctl -t ovs-ofctl ofctl/send 051c0040000000020000000800000005000100080000002000020008000000020003000800000005000400080000001c00050008000000050008000800000018
3837 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE OFPTR_VACANCY_UP
3839 # Set controller ID 123.
3840 ovs-appctl -t ovs-ofctl ofctl/send 05040018000000030000232000000014000000000000007b
3841 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
3843 # Restore controller ID 0.
3844 ovs-appctl -t ovs-ofctl ofctl/send 050400180000000300002320000000140000000000000000
3846 # Become master (OF 1.4).
3847 ovs-appctl -t ovs-ofctl ofctl/send 051800180000000400000002000000000000000000000002
3848 check_async 6 OFPR_PACKET_OUT OFPPR_ADD OFPPR_MODIFY OFPRR_DELETE
3850 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3854 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.5)])
3856 AT_CHECK([ovs-ofctl -O OpenFlow15 -P standard monitor br0 --detach --no-chdir --pidfile])
3858 printf '\n\n--- check_async %d ---\n\n\n' $1
3862 ovs-appctl -t ovs-ofctl ofctl/barrier
3863 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3866 # Other tests are not working with OF 1.5, and message
3867 # format may change, so leave them out.
3869 # OFPT_PORT_STATUS, OFPPR_ADD
3870 ovs-vsctl add-port br0 test -- set Interface test type=dummy
3871 if test X"$1" = X"OFPPR_ADD"; then shift;
3872 echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3875 speed: 0 Mbps now, 0 Mbps max
3876 OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3879 speed: 0 Mbps now, 0 Mbps max"
3882 # OFPT_PORT_STATUS, OFPPR_MODIFY
3883 ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test down
3884 if test X"$1" = X"OFPPR_MODIFY"; then shift;
3885 echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3888 speed: 0 Mbps now, 0 Mbps max
3889 OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3892 speed: 0 Mbps now, 0 Mbps max"
3895 # OFPT_PORT_STATUS, OFPPR_DELETE
3896 ovs-vsctl del-port br0 test
3897 if test X"$1" = X"OFPPR_DELETE"; then shift;
3898 echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
3901 speed: 0 Mbps now, 0 Mbps max"
3904 AT_FAIL_IF([test X"$1" != X])
3906 OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
3910 s/ (xid=0x[0-9a-fA-F]*)//
3912 s/00:0.$/00:0x/' < monitor.log]],
3916 # It's a service connection so initially there should be no async messages.
3919 # If we don't set this, async messages are not received.
3920 # Set miss_send_len to 128, turning on packet-ins for our service connection.
3921 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
3922 check_async 2 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
3924 # Set-async has changed in OF 1.4 and is not yet implemented.
3926 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3930 dnl This test checks that the role request/response messaging works
3931 dnl and that generation_id is handled properly.
3932 AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
3934 on_exit 'kill `cat c1.pid c2.pid`'
3936 # Start two ovs-ofctl controller processes.
3937 AT_CAPTURE_FILE([monitor1.log])
3938 AT_CAPTURE_FILE([expout1])
3939 AT_CAPTURE_FILE([experr1])
3940 AT_CAPTURE_FILE([monitor2.log])
3941 AT_CAPTURE_FILE([expout2])
3942 AT_CAPTURE_FILE([experr2])
3944 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=c$i.pid --unixctl=c$i])
3945 ovs-appctl -t `pwd`/c$i ofctl/barrier
3946 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
3950 # find out current role
3951 ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000
3952 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange"
3953 echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
3956 # controller 1: Become slave (generation_id is initially undefined, so
3957 # 2^63+2 should not be stale)
3958 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
3959 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
3960 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
3962 # controller 2: Become master.
3963 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
3964 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
3965 echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
3967 # controller 1: Try to become the master using a stale generation ID
3968 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
3969 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
3970 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
3971 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
3973 # controller 1: Become master using a valid generation ID
3974 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
3975 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
3976 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
3979 ovs-appctl -t `pwd`/c$i ofctl/barrier
3980 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):"
3986 AT_CHECK([grep -v '^send:' monitor$i.log | strip_xids], [0], [expout])
3988 AT_CHECK([grep '^send:' monitor$i.log | strip_xids], [0], [expout])
3993 dnl This test checks that the role request/response messaging works,
3994 dnl that generation_id is handled properly, and that role status update
3995 dnl messages are sent when a controller's role gets changed from master
3997 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
3999 on_exit 'kill `cat c1.pid c2.pid`'
4001 # Start two ovs-ofctl controller processes.
4002 AT_CAPTURE_FILE([monitor1.log])
4003 AT_CAPTURE_FILE([expout1])
4004 AT_CAPTURE_FILE([experr1])
4005 AT_CAPTURE_FILE([monitor2.log])
4006 AT_CAPTURE_FILE([expout2])
4007 AT_CAPTURE_FILE([experr2])
4009 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=c$i.pid --unixctl=c$i])
4010 ovs-appctl -t `pwd`/c$i ofctl/barrier
4011 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
4015 # find out current role
4016 ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000
4017 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange"
4018 echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
4021 # controller 1: Become slave (generation_id is initially undefined, so
4022 # 2^63+2 should not be stale)
4023 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
4024 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
4025 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
4027 # controller 2: Become master.
4028 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
4029 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
4030 echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
4032 # controller 1: Try to become the master using a stale generation ID
4033 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
4034 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
4035 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
4036 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
4038 # controller 1: Become master using a valid generation ID
4039 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
4040 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
4041 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
4042 echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
4045 ovs-appctl -t `pwd`/c$i ofctl/barrier
4046 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):"
4052 AT_CHECK([grep -v '^send:' monitor$i.log | strip_xids], [0], [expout])
4054 AT_CHECK([grep '^send:' monitor$i.log | strip_xids], [0], [expout])
4059 dnl This test checks that the role request/response messaging works,
4060 dnl that generation_id is handled properly, and that role status update
4061 dnl messages are sent when a controller's role gets changed from master
4063 AT_SETUP([ofproto - controller role (OpenFlow 1.3)])
4065 on_exit 'kill `cat c1.pid c2.pid`'
4067 # Start two ovs-ofctl controller processes.
4068 AT_CAPTURE_FILE([monitor1.log])
4069 AT_CAPTURE_FILE([expout1])
4070 AT_CAPTURE_FILE([experr1])
4071 AT_CAPTURE_FILE([monitor2.log])
4072 AT_CAPTURE_FILE([expout2])
4073 AT_CAPTURE_FILE([experr2])
4075 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile=c$i.pid --unixctl=c$i])
4076 ovs-appctl -t `pwd`/c$i ofctl/barrier
4077 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
4081 # find out current role
4082 ovs-appctl -t `pwd`/c$i ofctl/send 041800180000000200000000000000000000000000000000
4083 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.3): role=nochange"
4084 echo >>expout$i "OFPT_ROLE_REPLY (OF1.3): role=equal"
4087 # controller 1: Become slave (generation_id is initially undefined, so
4088 # 2^63+2 should not be stale)
4089 ovs-appctl -t `pwd`/c1 ofctl/send 041800180000000300000003000000008000000000000002
4090 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.3): role=slave generation_id=9223372036854775810"
4091 echo >>expout1 "OFPT_ROLE_REPLY (OF1.3): role=slave generation_id=9223372036854775810"
4093 # controller 2: Become master.
4094 ovs-appctl -t `pwd`/c2 ofctl/send 041800180000000300000002000000008000000000000003
4095 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.3): role=master generation_id=9223372036854775811"
4096 echo >>expout2 "OFPT_ROLE_REPLY (OF1.3): role=master generation_id=9223372036854775811"
4098 # controller 1: Try to become the master using a stale generation ID
4099 ovs-appctl -t `pwd`/c1 ofctl/send 041800180000000400000002000000000000000000000003
4100 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.3): role=master generation_id=3"
4101 echo >>expout1 "OFPT_ERROR (OF1.3): OFPRRFC_STALE"
4102 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.3): role=master generation_id=3"
4104 # controller 1: Become master using a valid generation ID
4105 ovs-appctl -t `pwd`/c1 ofctl/send 041800180000000500000002000000000000000000000001
4106 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.3): role=master generation_id=1"
4107 echo >>expout1 "OFPT_ROLE_REPLY (OF1.3): role=master generation_id=1"
4108 echo >>expout2 "ONFT_ROLE_STATUS (OF1.3): role=slave generation_id=1 reason=master_request"
4111 ovs-appctl -t `pwd`/c$i ofctl/barrier
4112 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.3):"
4118 AT_CHECK([grep -v '^send:' monitor$i.log | strip_xids], [0], [expout])
4120 AT_CHECK([grep '^send:' monitor$i.log | strip_xids], [0], [expout])
4125 dnl This test checks the Group and meter notifications when a group mod
4126 dnl command is sent from one controller and the reply is received by
4127 dnl other controllers.
4128 AT_SETUP([ofproto - requestforward (OpenFlow 1.4)])
4130 on_exit 'kill `cat c1.pid c2.pid c3.pid`'
4132 # Start two ovs-ofctl controller processes.
4133 AT_CAPTURE_FILE([monitor1.log])
4134 AT_CAPTURE_FILE([expout1])
4135 AT_CAPTURE_FILE([monitor2.log])
4136 AT_CAPTURE_FILE([expout2])
4137 AT_CAPTURE_FILE([monitor3.log])
4138 AT_CAPTURE_FILE([expout3])
4140 ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile=c1.pid --unixctl=c1
4141 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=c2.pid --unixctl=c2
4142 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=c3.pid --unixctl=c3
4146 ovs-appctl -t `pwd`/c$i ofctl/barrier
4147 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
4151 printf '\n\n--- check_async %d ---\n\n\n' $1
4156 ovs-appctl -t `pwd`/c2 ofctl/send "050f0020000000020000000000000001 00100000 ffffffffffffffff 00000000"
4157 if test X"$1" = X"OFPGC_ADD"; then shift;
4158 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
4159 ADD group_id=1,type=all,bucket=actions=drop"
4160 echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
4161 ADD group_id=1,type=all,bucket=bucket_id:0,actions=drop"
4162 echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
4163 ADD group_id=1,type=all,bucket=actions=drop"
4167 ovs-appctl -t `pwd`/c2 ofctl/send "050f0020000000020001010000000001 00100000 ffffffffffffffff 00000000"
4168 if test X"$1" = X"OFPGC_MODIFY"; then shift;
4169 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
4170 MOD group_id=1,type=select,bucket=weight:0,actions=drop"
4171 echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
4172 MOD group_id=1,type=select,bucket=bucket_id:0,weight:0,actions=drop"
4173 echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
4174 MOD group_id=1,type=select,bucket=weight:0,actions=drop"
4177 ovs-appctl -t `pwd`/c1 ofctl/barrier
4178 echo >>expout1 "OFPT_BARRIER_REPLY (OF1.5):"
4179 ovs-appctl -t `pwd`/c2 ofctl/barrier
4180 echo >>expout2 "OFPT_BARRIER_REPLY (OF1.4):"
4181 ovs-appctl -t `pwd`/c3 ofctl/barrier
4182 echo >>expout3 "OFPT_BARRIER_REPLY (OF1.4):"
4189 s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
4194 # controller 1: Become slave
4195 ovs-appctl -t `pwd`/c1 ofctl/send 061800180000000300000003000000008000000000000002
4197 # controller 2: Become master
4198 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
4200 # controller 1: Become slave
4201 ovs-appctl -t `pwd`/c3 ofctl/send 051800180000000300000003000000008000000000000004
4203 # controller 1: Enabled requestforward using set Asynchronous message
4204 ovs-appctl -t `pwd`/c1 ofctl/send 061c00280000000200000008000000050002000800000002000400080000001a000a000800000003
4206 # controller 2: Enabled requestforward using set Asynchronous message
4207 ovs-appctl -t `pwd`/c2 ofctl/send 051c002800000002000100080000000200030008000000050005000800000005000b000800000003
4209 # controller 1: Enabled requestforward using set Asynchronous message
4210 ovs-appctl -t `pwd`/c3 ofctl/send 051c00280000000200000008000000050002000800000002000400080000001a000a000800000003
4211 check_async 1 OFPGC_ADD OFPGC_MODIFY
4216 dnl This test checks the backwards compatibility of the NXT_REQUESTFORWARD
4217 dnl message type to OpenFlow 1.0, also relying on the Nicira Extensions:
4218 dnl NXT_GROUP_MOD, NXT_ROLE_REQUEST, and OFPRAW_NXT_SET_ASYNC_CONFIG2,
4219 dnl while also testing the functionality of the previous test.
4220 AT_SETUP([ofproto - NXT requestforward (OpenFlow 1.0)])
4222 on_exit 'kill `cat c1.pid c2.pid c3.pid`'
4224 # Start two ovs-ofctl controller processes.
4225 AT_CAPTURE_FILE([monitor1.log])
4226 AT_CAPTURE_FILE([expout1])
4227 AT_CAPTURE_FILE([monitor2.log])
4228 AT_CAPTURE_FILE([expout2])
4229 AT_CAPTURE_FILE([monitor3.log])
4230 AT_CAPTURE_FILE([expout3])
4232 ovs-ofctl -O OpenFlow10 monitor br0 --detach --no-chdir --pidfile=c1.pid --unixctl=c1
4233 ovs-ofctl -O OpenFlow10 monitor br0 --detach --no-chdir --pidfile=c2.pid --unixctl=c2
4234 ovs-ofctl -O OpenFlow10 monitor br0 --detach --no-chdir --pidfile=c3.pid --unixctl=c3
4238 ovs-appctl -t `pwd`/c$i ofctl/barrier
4239 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
4243 printf '\n\n--- check_async %d ---\n\n\n' $1
4248 # NXT_GROUP_MOD (xid=0x2):
4249 # 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
4250 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"
4251 if test X"$1" = X"OFPGC_ADD"; then shift;
4252 echo >>expout2 "send: NXT_GROUP_MOD:
4253 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"
4254 echo >>expout1 "NXT_REQUESTFORWARD: reason=group_mod
4255 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"
4256 echo >>expout3 "NXT_REQUESTFORWARD: reason=group_mod
4257 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"
4261 # NXT_GROUP_MOD (xid=0x2):
4262 # 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
4263 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"
4264 if test X"$1" = X"OFPGC_MODIFY"; then shift;
4265 echo >>expout2 "send: NXT_GROUP_MOD:
4266 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"
4267 echo >>expout1 "NXT_REQUESTFORWARD: reason=group_mod
4268 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"
4269 echo >>expout3 "NXT_REQUESTFORWARD: reason=group_mod
4270 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"
4273 ovs-appctl -t `pwd`/c1 ofctl/barrier
4274 echo >>expout1 "OFPT_BARRIER_REPLY:"
4275 ovs-appctl -t `pwd`/c2 ofctl/barrier
4276 echo >>expout2 "OFPT_BARRIER_REPLY:"
4277 ovs-appctl -t `pwd`/c3 ofctl/barrier
4278 echo >>expout3 "OFPT_BARRIER_REPLY:"
4285 s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
4290 # controller 1: Become slave
4291 # NXT_ROLE_REQUEST (xid=0x3): role=slave
4292 ovs-appctl -t `pwd`/c1 ofctl/send 0104001400000003000023200000000a00000002
4294 # controller 2: Become master
4295 # NXT_ROLE_REQUEST (xid=0x3): role=master
4296 ovs-appctl -t `pwd`/c2 ofctl/send 0104001400000003000023200000000a00000001
4298 # controller 1: Become slave
4299 # NXT_ROLE_REQUEST (xid=0x3): role=slave
4300 ovs-appctl -t `pwd`/c3 ofctl/send 0104001400000003000023200000000a00000002
4302 # controller 1: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2
4303 ovs-appctl -t `pwd`/c1 ofctl/send 0104003000000002000023200000001b00000008000000050002000800000002000400080000001a000a000800000003
4305 # controller 2: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2
4306 ovs-appctl -t `pwd`/c2 ofctl/send 0104003000000002000023200000001b000100080000000200030008000000050005000800000005000b000800000003
4308 # controller 1: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2
4309 ovs-appctl -t `pwd`/c3 ofctl/send 0104003000000002000023200000001b00000008000000050002000800000002000400080000001a000a000800000003
4310 check_async 1 OFPGC_ADD OFPGC_MODIFY
4315 dnl This test checks the Group and meter notifications when a group mod
4316 dnl command is sent from one controller and the reply is received by
4317 dnl other controllers, using the ONF Extension for OF 1.3.
4318 AT_SETUP([ofproto - ONF requestforward (OpenFlow 1.3)])
4320 on_exit 'kill `cat c1.pid c2.pid c3.pid`'
4322 # Start two ovs-ofctl controller processes.
4323 AT_CAPTURE_FILE([monitor1.log])
4324 AT_CAPTURE_FILE([expout1])
4325 AT_CAPTURE_FILE([monitor2.log])
4326 AT_CAPTURE_FILE([expout2])
4327 AT_CAPTURE_FILE([monitor3.log])
4328 AT_CAPTURE_FILE([expout3])
4330 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile=c1.pid --unixctl=c1
4331 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile=c2.pid --unixctl=c2
4332 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile=c3.pid --unixctl=c3
4336 ovs-appctl -t `pwd`/c$i ofctl/barrier
4337 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
4341 printf '\n\n--- check_async %d ---\n\n\n' $1
4346 # OFPT_GROUP_MOD (OF1.3) (xid=0x2):
4347 # ADD group_id=1,type=all,bucket=actions=drop
4348 ovs-appctl -t `pwd`/c2 ofctl/send "040f0020000000020000000000000001 00100000 ffffffffffffffff 00000000"
4349 if test X"$1" = X"OFPGC_ADD"; then shift;
4350 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.3):
4351 ADD group_id=1,type=all,bucket=actions=drop"
4352 echo >>expout1 "ONFT_REQUESTFORWARD (OF1.3): reason=group_mod
4353 ADD group_id=1,type=all,bucket=actions=drop"
4354 echo >>expout3 "ONFT_REQUESTFORWARD (OF1.3): reason=group_mod
4355 ADD group_id=1,type=all,bucket=actions=drop"
4359 # OFPT_GROUP_MOD (OF1.3) (xid=0x2):
4360 # MOD group_id=1,type=select,bucket=weight:0,actions=drop
4361 ovs-appctl -t `pwd`/c2 ofctl/send "040f0020000000020001010000000001 00100000 ffffffffffffffff 00000000"
4362 if test X"$1" = X"OFPGC_MODIFY"; then shift;
4363 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.3):
4364 MOD group_id=1,type=select,bucket=weight:0,actions=drop"
4365 echo >>expout1 "ONFT_REQUESTFORWARD (OF1.3): reason=group_mod
4366 MOD group_id=1,type=select,bucket=weight:0,actions=drop"
4367 echo >>expout3 "ONFT_REQUESTFORWARD (OF1.3): reason=group_mod
4368 MOD group_id=1,type=select,bucket=weight:0,actions=drop"
4371 ovs-appctl -t `pwd`/c1 ofctl/barrier
4372 echo >>expout1 "OFPT_BARRIER_REPLY (OF1.3):"
4373 ovs-appctl -t `pwd`/c2 ofctl/barrier
4374 echo >>expout2 "OFPT_BARRIER_REPLY (OF1.3):"
4375 ovs-appctl -t `pwd`/c3 ofctl/barrier
4376 echo >>expout3 "OFPT_BARRIER_REPLY (OF1.3):"
4383 s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
4388 # controller 1: Become slave
4389 # OFPT_ROLE_REQUEST (OF1.3) (xid=0x3): role=slave
4390 ovs-appctl -t `pwd`/c1 ofctl/send 041800180000000300000003000000008000000000000002
4392 # controller 2: Become master
4393 # OFPT_ROLE_REQUEST (OF1.3) (xid=0x3): role=master
4394 ovs-appctl -t `pwd`/c2 ofctl/send 041800180000000300000002000000008000000000000003
4396 # controller 1: Become slave
4397 # OFPT_ROLE_REQUEST (OF1.3) (xid=0x3): role=slave
4398 ovs-appctl -t `pwd`/c3 ofctl/send 041800180000000300000003000000008000000000000004
4400 # controller 1: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2 (necessary for OF1.3)
4401 ovs-appctl -t `pwd`/c1 ofctl/send 0404003000000002000023200000001b00000008000000050002000800000002000400080000001a000a000800000003
4403 # controller 2: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2 (necessary for OF1.3)
4404 ovs-appctl -t `pwd`/c2 ofctl/send 0404003000000002000023200000001b000100080000000200030008000000050005000800000005000b000800000003
4406 # controller 1: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2 (necessary for OF1.3)
4407 ovs-appctl -t `pwd`/c3 ofctl/send 0404003000000002000023200000001b00000008000000050002000800000002000400080000001a000a000800000003
4408 check_async 1 OFPGC_ADD OFPGC_MODIFY
4415 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
4416 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
4417 dnl controllers despite the spec) as meaning a packet that was generated
4418 dnl by the controller.
4419 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
4423 # Start a monitor listening for packet-ins.
4424 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
4425 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
4426 ovs-appctl -t ovs-ofctl ofctl/barrier
4427 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4428 AT_CAPTURE_FILE([monitor.log])
4430 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
4431 AT_CHECK([ovs-ofctl packet-out br0 "in_port=none packet=0001020304050010203040501234 actions=controller,1"])
4432 AT_CHECK([ovs-ofctl packet-out br0 "in_port=controller packet=0001020304050010203040505678 actions=controller,1"])
4434 # Stop the monitor and check its output.
4435 ovs-appctl -t ovs-ofctl ofctl/barrier
4436 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4438 ovs-ofctl dump-ports br0
4440 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4441 OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
4442 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4443 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4444 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
4451 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
4452 dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
4453 dnl controllers despite the spec) as meaning a packet that was generated
4454 dnl by the controller.
4455 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
4458 # Start a monitor listening for packet-ins.
4459 AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile])
4460 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
4461 ovs-appctl -t ovs-ofctl ofctl/barrier
4462 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4463 AT_CAPTURE_FILE([monitor.log])
4465 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
4466 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
4467 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
4469 # Stop the monitor and check its output.
4470 ovs-appctl -t ovs-ofctl ofctl/barrier
4471 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4473 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4474 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
4475 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4476 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4477 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
4478 OFPT_BARRIER_REPLY (OF1.2):
4484 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
4485 dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some
4486 dnl controllers despite the spec) as meaning a packet that was generated
4487 dnl by the controller.
4488 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)])
4491 # Start a monitor listening for packet-ins.
4492 AT_CHECK([ovs-ofctl -O OpenFlow11 -P standard monitor br0 --detach --no-chdir --pidfile])
4493 ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080
4494 ovs-appctl -t ovs-ofctl ofctl/barrier
4495 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4496 AT_CAPTURE_FILE([monitor.log])
4498 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER as in_port.
4499 AT_CHECK([ovs-appctl -t ovs-ofctl ofctl/packet-out "in_port=none, packet=0001020304050010203040501234 actions=controller"])
4500 AT_CHECK([ovs-appctl -t ovs-ofctl ofctl/packet-out "in_port=controller packet=0001020304050010203040505678 actions=controller"])
4502 # Stop the monitor and check its output.
4503 ovs-appctl -t ovs-ofctl ofctl/barrier
4504 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4506 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//
4507 /PACKET_OUT/d' monitor.log], [0], [dnl
4508 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
4509 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4510 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4511 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
4512 OFPT_BARRIER_REPLY (OF1.1):
4518 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.5)])
4521 # Start a monitor listening for packet-ins.
4522 AT_CHECK([ovs-ofctl -O OpenFlow15 -P standard monitor br0 --detach --no-chdir --pidfile])
4523 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
4524 ovs-appctl -t ovs-ofctl ofctl/barrier
4525 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4526 AT_CAPTURE_FILE([monitor.log])
4528 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
4529 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=none tun_id=0x11 metadata=0x22 packet=0001020304050010203040501234 actions=controller"])
4530 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=controller tun_id=0x11 metadata=0x33 packet=0001020304050010203040505678 actions=controller"])
4532 # Stop the monitor and check its output.
4533 ovs-appctl -t ovs-ofctl ofctl/barrier
4534 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4536 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4537 OFPT_PACKET_IN (OF1.5): total_len=14 tun_id=0x11,metadata=0x22,in_port=ANY (via packet_out) data_len=14 (unbuffered)
4538 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4539 OFPT_PACKET_IN (OF1.5): total_len=14 tun_id=0x11,metadata=0x33,in_port=CONTROLLER (via packet_out) data_len=14 (unbuffered)
4540 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
4541 OFPT_BARRIER_REPLY (OF1.5):
4547 dnl This test checks that metadata and userdata are encoded in NXT_PACKET_IN2.
4548 AT_SETUP([ofproto - packet-out with metadata and userdata (NXT_PACKET_IN2)])
4551 # Start a monitor listening for packet-ins.
4552 AT_CHECK([ovs-ofctl -P nxt_packet_in2 monitor br0 --detach --no-chdir --pidfile])
4553 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
4554 ovs-appctl -t ovs-ofctl ofctl/barrier
4555 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4556 AT_CAPTURE_FILE([monitor.log])
4558 # Send a packet-out with a load action to set some metadata, and forward to controller
4559 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)"])
4561 # Stop the monitor and check its output.
4562 ovs-appctl -t ovs-ofctl ofctl/barrier
4563 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4565 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4566 NXT_PACKET_IN2: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4567 userdata=01.02.03.04.05
4568 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4575 dnl This test checks that 1.5 packet_out is properly encoded/decoded.
4576 AT_SETUP([ofproto - packet-out with set_field metadata (OpenFlow 1.5)])
4579 # Start a monitor listening for packet-ins.
4580 AT_CHECK([ovs-ofctl -P standard -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
4581 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
4582 ovs-appctl -t ovs-ofctl ofctl/barrier
4583 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4584 AT_CAPTURE_FILE([monitor.log])
4586 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
4587 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 CONTROLLER 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234'])
4589 # Stop the monitor and check its output.
4590 ovs-appctl -t ovs-ofctl ofctl/barrier
4591 ovs-appctl -t ovs-ofctl exit
4593 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4594 OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4595 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4596 OFPT_BARRIER_REPLY (OF1.3):
4602 dnl This test checks that packet_type PT_ETH is properly encoded/decoded in 1.5 packet_out.
4603 AT_SETUP([ofproto - packet-out with set_field metadata with packet_type PT_ETH (OpenFlow 1.5)])
4606 # Start a monitor listening for packet-ins.
4607 AT_CHECK([ovs-ofctl -P standard -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
4608 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
4609 ovs-appctl -t ovs-ofctl ofctl/barrier
4610 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4611 AT_CAPTURE_FILE([monitor.log])
4613 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
4614 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=controller packet=0001020304050010203040501234 packet_type(0,0x0) actions=set_field:0xfafafafa5a5a5a5a->metadata,controller"])
4616 # Stop the monitor and check its output.
4617 ovs-appctl -t ovs-ofctl ofctl/barrier
4618 ovs-appctl -t ovs-ofctl exit
4620 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4621 OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4622 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4623 OFPT_BARRIER_REPLY (OF1.3):
4629 dnl This test checks that packet_type PT_IPV4 is properly encoded/decoded in 1.5 packet_out.
4630 AT_SETUP([ofproto - packet-out with set_field metadata with packet_type PT_IPV4 on PTAP bridge (OpenFlow 1.5)])
4633 # Start a monitor listening for packet-ins.
4634 AT_CHECK([ovs-ofctl -P standard -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
4635 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
4636 ovs-appctl -t ovs-ofctl ofctl/barrier
4637 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4638 AT_CAPTURE_FILE([monitor.log])
4640 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
4641 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=controller packet=4500002012344000ff1155670a0000140a00001e006400c8000cea78ffffffff packet_type(1,0x800) actions=set_field:0xfafafafa5a5a5a5a->metadata,controller"])
4643 # Stop the monitor and check its output.
4644 ovs-appctl -t ovs-ofctl ofctl/barrier
4645 ovs-appctl -t ovs-ofctl exit
4647 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4648 OFPT_PACKET_IN (OF1.3): total_len=32 packet_type=(1,0x800),metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=32 (unbuffered)
4649 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
4650 OFPT_BARRIER_REPLY (OF1.3):
4656 dnl This test checks that metadata is encoded in packet_in structures,
4657 dnl supported by NXAST.
4658 AT_SETUP([ofproto - packet-out with metadata (NXM)])
4661 # Start a monitor listening for packet-ins.
4662 AT_CHECK([ovs-ofctl -P nxt_packet_in monitor br0 --detach --no-chdir --pidfile])
4663 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
4664 ovs-appctl -t ovs-ofctl ofctl/barrier
4665 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4666 AT_CAPTURE_FILE([monitor.log])
4668 # Send a packet-out with a load action to set some metadata, and forward to controller
4669 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"])
4671 # Stop the monitor and check its output.
4672 ovs-appctl -t ovs-ofctl ofctl/barrier
4673 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4675 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4676 NXT_PACKET_IN: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4677 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4684 dnl This test checks that metadata is encoded in packet_in structures,
4685 dnl supported by NXAST.
4686 AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
4689 # Start a monitor listening for packet-ins.
4690 AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile])
4691 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
4692 ovs-appctl -t ovs-ofctl ofctl/barrier
4693 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4694 AT_CAPTURE_FILE([monitor.log])
4696 # Send a packet-out with a set-field action to set some metadata, and forward to controller
4697 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234'])
4699 # Stop the monitor and check its output.
4700 ovs-appctl -t ovs-ofctl ofctl/barrier
4701 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4703 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4704 OFPT_PACKET_IN (OF1.2): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=ANY (via action) data_len=14 (unbuffered)
4705 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4706 OFPT_BARRIER_REPLY (OF1.2):
4712 dnl This test checks that metadata is encoded in packet_in structures,
4713 dnl supported by NXAST.
4714 AT_SETUP([ofproto - packet-out with metadata and dual set_field (OpenFlow 1.3)])
4717 # Start a monitor listening for packet-ins.
4718 AT_CHECK([ovs-ofctl -O OpenFlow13 -P standard monitor br0 --detach --no-chdir --pidfile])
4719 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
4720 ovs-appctl -t ovs-ofctl ofctl/barrier
4721 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4722 AT_CAPTURE_FILE([monitor.log])
4724 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
4725 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, set_field:0x6b->metadata, controller' '0001020304050010203040501234'])
4727 # Stop the monitor and check its output.
4728 ovs-appctl -t ovs-ofctl ofctl/barrier
4729 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4731 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4732 OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0x6b,in_port=ANY (via action) data_len=14 (unbuffered)
4733 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4734 OFPT_BARRIER_REPLY (OF1.3):
4740 dnl This test checks that tunnel metadata is encoded in packet_in structures.
4741 AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
4744 # Start a monitor listening for packet-ins.
4745 AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile])
4746 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
4747 ovs-appctl -t ovs-ofctl ofctl/barrier
4748 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4749 AT_CAPTURE_FILE([monitor.log])
4751 # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
4752 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'])
4754 # Stop the monitor and check its output.
4755 ovs-appctl -t ovs-ofctl ofctl/barrier
4756 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4758 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
4759 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)
4760 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
4761 OFPT_BARRIER_REPLY (OF1.2):
4767 m4_divert_push([PREPARE_TESTS])
4768 # Sorts groups of lines that start with a space, without moving them
4769 # past the nearest line that does not start with a space.
4777 line = sys.stdin.readline()
4780 if line.startswith(" "):
4783 sys.stdout.write("".join(sorted(buffer)))
4784 sys.stdout.write(line)
4786 sys.stdout.write("".join(sorted(buffer)))
4790 m4_divert_pop([PREPARE_TESTS])
4792 AT_SETUP([ofproto - flow monitoring])
4793 AT_KEYWORDS([monitor])
4796 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
4798 # Start a monitor watching the flow table and check the initial reply.
4799 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
4800 AT_CAPTURE_FILE([monitor.log])
4801 ovs-appctl -t ovs-ofctl ofctl/barrier
4802 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4803 [NXST_FLOW_MONITOR reply:
4804 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
4808 # Add, delete, and modify some flows and check the updates.
4809 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4810 ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
4811 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
4812 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
4813 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
4814 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
4815 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
4816 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
4817 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
4818 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
4819 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
4820 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
4821 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
4822 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
4823 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
4824 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
4825 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
4826 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
4827 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
4828 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
4829 ovs-ofctl add-flow br0 in_port=0,actions=output:23
4830 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
4831 ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
4832 ovs-ofctl del-flows br0 dl_vlan=123
4833 ovs-ofctl del-flows br0
4834 ovs-appctl -t ovs-ofctl ofctl/barrier
4835 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
4836 [NXST_FLOW_MONITOR reply (xid=0x0):
4837 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
4838 NXST_FLOW_MONITOR reply (xid=0x0):
4839 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
4840 NXST_FLOW_MONITOR reply (xid=0x0):
4841 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
4842 NXST_FLOW_MONITOR reply (xid=0x0):
4843 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
4844 NXST_FLOW_MONITOR reply (xid=0x0):
4845 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
4846 NXST_FLOW_MONITOR reply (xid=0x0):
4847 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
4848 NXST_FLOW_MONITOR reply (xid=0x0):
4849 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
4850 NXST_FLOW_MONITOR reply (xid=0x0):
4851 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
4852 NXST_FLOW_MONITOR reply (xid=0x0):
4853 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
4854 NXST_FLOW_MONITOR reply (xid=0x0):
4855 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
4856 NXST_FLOW_MONITOR reply (xid=0x0):
4857 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
4858 NXST_FLOW_MONITOR reply (xid=0x0):
4859 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
4860 NXST_FLOW_MONITOR reply (xid=0x0):
4861 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
4862 NXST_FLOW_MONITOR reply (xid=0x0):
4863 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
4864 NXST_FLOW_MONITOR reply (xid=0x0):
4865 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
4866 NXST_FLOW_MONITOR reply (xid=0x0):
4867 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
4868 NXST_FLOW_MONITOR reply (xid=0x0):
4869 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
4870 NXST_FLOW_MONITOR reply (xid=0x0):
4871 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
4872 NXST_FLOW_MONITOR reply (xid=0x0):
4873 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
4874 NXST_FLOW_MONITOR reply (xid=0x0):
4875 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
4876 NXST_FLOW_MONITOR reply (xid=0x0):
4877 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
4878 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
4879 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
4880 NXST_FLOW_MONITOR reply (xid=0x0):
4881 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
4882 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
4883 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
4884 NXST_FLOW_MONITOR reply (xid=0x0):
4885 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
4886 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
4887 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
4888 NXST_FLOW_MONITOR reply (xid=0x0):
4889 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
4890 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
4891 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
4892 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
4893 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
4894 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
4895 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
4896 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
4897 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
4898 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
4899 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
4903 # Check that our own changes are reported as full updates.
4904 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4905 ovs-ofctl add-flow br0 in_port=1,actions=output:2
4906 ovs-ofctl add-flow br0 in_port=2,actions=output:1
4907 ovs-appctl -t ovs-ofctl ofctl/barrier
4908 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
4909 ovs-appctl -t ovs-ofctl ofctl/barrier
4910 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
4912 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
4913 [NXST_FLOW_MONITOR reply (xid=0x0):
4914 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
4915 NXST_FLOW_MONITOR reply (xid=0x0):
4916 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
4918 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
4919 NXST_FLOW_MONITOR reply (xid=0x0):
4920 event=DELETED reason=delete table=0 cookie=0 in_port=1 actions=output:2
4921 event=DELETED reason=delete table=0 cookie=0 in_port=2 actions=output:1
4925 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4929 AT_SETUP([ofproto - flow monitoring with !own])
4930 AT_KEYWORDS([monitor])
4933 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
4935 # Start a monitor watching the flow table and check the initial reply.
4936 ovs-ofctl monitor br0 watch:\!own --detach --no-chdir --pidfile >monitor.log 2>&1
4937 AT_CAPTURE_FILE([monitor.log])
4938 ovs-appctl -t ovs-ofctl ofctl/barrier
4939 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4940 [NXST_FLOW_MONITOR reply:
4941 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
4945 # Check that our own changes are reported as abbreviations.
4946 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4947 ovs-ofctl add-flow br0 in_port=1,actions=output:2
4948 ovs-ofctl add-flow br0 in_port=2,actions=output:1
4949 ovs-appctl -t ovs-ofctl ofctl/barrier
4950 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
4951 ovs-appctl -t ovs-ofctl ofctl/barrier
4952 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
4954 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4955 [NXST_FLOW_MONITOR reply (xid=0x0):
4956 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
4957 NXST_FLOW_MONITOR reply (xid=0x0):
4958 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
4960 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
4961 NXST_FLOW_MONITOR reply (xid=0x0):
4962 event=ABBREV xid=0x12345678
4966 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4970 AT_SETUP([ofproto - flow monitoring with out_port])
4971 AT_KEYWORDS([monitor])
4974 ovs-ofctl add-flow br0 in_port=0,dl_vlan=121,actions=output:1
4975 ovs-ofctl add-flow br0 in_port=0,dl_vlan=122,actions=output:1
4976 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:2
4978 # Start a monitor watching the flow table and check the initial reply.
4979 ovs-ofctl monitor br0 watch:out_port=2 --detach --no-chdir --pidfile >monitor.log 2>&1
4980 AT_CAPTURE_FILE([monitor.log])
4981 ovs-appctl -t ovs-ofctl ofctl/barrier
4982 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
4983 [NXST_FLOW_MONITOR reply:
4984 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
4988 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
4990 # Add, modify flows and check the updates.
4991 ovs-ofctl mod-flows br0 dl_vlan=121,actions=drop
4992 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1,output:2
4993 ovs-appctl -t ovs-ofctl ofctl/barrier
4995 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:1,output:2
4996 ovs-appctl -t ovs-ofctl ofctl/barrier
4998 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1
4999 ovs-appctl -t ovs-ofctl ofctl/barrier
5000 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:2
5001 ovs-appctl -t ovs-ofctl ofctl/barrier
5003 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
5004 [NXST_FLOW_MONITOR reply (xid=0x0):
5005 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1,output:2
5007 NXST_FLOW_MONITOR reply (xid=0x0):
5008 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1,output:2
5010 NXST_FLOW_MONITOR reply (xid=0x0):
5011 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1
5013 NXST_FLOW_MONITOR reply (xid=0x0):
5014 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
5018 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5022 AT_SETUP([ofproto - flow monitoring pause and resume])
5023 AT_KEYWORDS([monitor])
5025 # The maximum socket receive buffer size is important for this test, which
5026 # tests behavior when the receive buffer overflows.
5027 if test -e /proc/sys/net/core/rmem_max; then
5029 rmem_max=`cat /proc/sys/net/core/rmem_max`
5030 elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
5033 # Don't know how to get maximum socket receive buffer on this OS
5036 # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
5037 # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
5038 queue_size=`expr $rmem_max + 128 \* 1024`
5039 echo rmem_max=$rmem_max queue_size=$queue_size
5041 # If there's too much queuing skip the test to avoid timing out.
5042 AT_SKIP_IF([test $rmem_max -gt 1048576])
5044 # Each flow update message takes up at least 48 bytes of space in queues
5045 # and in practice more than that.
5046 n_msgs=`expr $queue_size / 48`
5051 # Start a monitor watching the flow table, then make it block.
5052 on_exit 'kill `cat ovs-ofctl.pid`'
5053 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
5054 AT_CAPTURE_FILE([monitor.log])
5055 ovs-appctl -t ovs-ofctl ofctl/block
5057 # Add $n_msgs flows.
5058 (echo "in_port=2,actions=output:2"
5060 for i in range('$n_msgs'):
5061 print("cookie=1,reg1=%d,actions=drop" % i)
5063 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5064 # Check that multipart flow dumps work properly:
5065 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
5066 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
5067 AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
5068 AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
5070 ovs-appctl -t ovs-ofctl ofctl/unblock
5072 # Wait for the connection resumed.
5073 # A barrier doesn't work for this purpose.
5074 # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html
5075 # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html
5076 OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log])
5078 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5080 # Check that the flow monitor reported the same number of flows
5081 # added and deleted, but fewer than we actually added and deleted.
5082 adds=`grep -c 'ADDED.*reg1=' monitor.log`
5083 deletes=`grep -c 'DELETED.*reg1=' monitor.log`
5084 echo adds=$adds deletes=$deletes
5085 AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
5086 AT_CHECK([test $adds = $deletes])
5088 # Check that the flow monitor reported everything in the expected order:
5090 # event=ADDED table=0 cookie=0x1 reg1=0x22
5092 # NXT_FLOW_MONITOR_PAUSED:
5094 # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
5096 # event=ADDED table=0 cookie=0x3 in_port=1
5097 # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
5098 # NXT_FLOW_MONITOR_RESUMED:
5100 # except that, between the PAUSED and RESUMED, the order of the ADDED
5101 # and MODIFIED lines lines depends on hash order, that is, it varies
5102 # as we change the hash function or change architecture. Therefore,
5103 # we use a couple of tests below to accept both orders.
5104 AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
5107 /NXT_FLOW_MONITOR_PAUSED:/p
5108 /NXT_FLOW_MONITOR_RESUMED:/p
5109 ' > monitor.log.subset])
5110 AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
5111 event=ADDED table=0 cookie=0x1 reg1=0x22
5112 NXT_FLOW_MONITOR_PAUSED:
5113 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
5114 event=ADDED table=0 cookie=0x3 in_port=1
5115 NXT_FLOW_MONITOR_RESUMED:
5117 AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
5118 NXT_FLOW_MONITOR_PAUSED:
5119 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
5120 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
5121 NXT_FLOW_MONITOR_RESUMED:
5127 AT_SETUP([ofproto - flow monitoring usable protocols])
5128 AT_KEYWORDS([monitor])
5132 on_exit 'kill `cat ovs-ofctl.pid`'
5133 ovs-ofctl -OOpenFlow14 monitor br0 watch:udp,udp_dst=8 --detach --no-chdir --pidfile >monitor.log 2>&1
5134 AT_CAPTURE_FILE([monitor.log])
5136 # ovs-ofctl should exit because monitor is not supported in OpenFlow 1.4
5137 OVS_WAIT_UNTIL([grep "ovs-ofctl: none of the usable flow formats (OpenFlow10,NXM) is among the allowed flow formats (OXM-OpenFlow14)" monitor.log])
5139 # check that only NXM flag is returned as usable protocols for sctp_dst
5140 # and ovs-ofctl should exit since monitor is not supported in OpenFlow 1.4
5141 ovs-ofctl -OOpenFlow14 monitor br0 watch:sctp,sctp_dst=9 --detach --no-chdir --pidfile >monitor.log 2>&1
5142 OVS_WAIT_UNTIL([grep "ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OXM-OpenFlow14)" monitor.log])
5148 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
5149 AT_KEYWORDS([monitor])
5152 # Start a monitor, use the required protocol version
5153 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5154 AT_CAPTURE_FILE([monitor.log])
5156 # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a)
5157 ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a
5158 ovs-appctl -t ovs-ofctl ofctl/barrier
5160 # Check default setting
5161 read -r -d '' expected <<'EOF'
5164 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5165 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
5166 OFPT_GET_ASYNC_REPLY (OF1.3):
5168 PACKET_IN: no_match action
5169 PORT_STATUS: add delete modify
5170 FLOW_REMOVED: idle hard delete group_delete
5173 REQUESTFORWARD: (off)
5177 PORT_STATUS: add delete modify
5181 REQUESTFORWARD: (off)
5182 OFPT_BARRIER_REPLY (OF1.3):
5188 AT_SETUP([ofproto - ofport_request])
5190 add_of_ports br0 1 2 3
5192 set_and_check_specific_ofports () {
5193 ovs-vsctl set Interface p1 ofport_request="$1" -- \
5194 set Interface p2 ofport_request="$2" -- \
5195 set Interface p3 ofport_request="$3"
5196 ofports=`ovs-vsctl get Interface p1 ofport -- \
5197 get Interface p2 ofport -- \
5198 get Interface p3 ofport`
5199 AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
5202 for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
5203 for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
5204 echo -----------------------------------------------------------
5205 echo "Check changing port numbers from $pre to $post"
5206 set_and_check_specific_ofports $pre
5207 set_and_check_specific_ofports $post
5211 ovs-vsctl del-port p3
5213 set_and_check_poorly_specified_ofports () {
5214 ovs-vsctl set Interface p1 ofport_request="$1" -- \
5215 set Interface p2 ofport_request="$2"
5216 p1=`ovs-vsctl get Interface p1 ofport`
5217 p2=`ovs-vsctl get Interface p2 ofport`
5220 AT_CHECK([test "$p1" != "$p2"])
5221 if test "$1" = "$2" && test "$1" != '[[]]'; then
5222 # One port number must be the requested one.
5223 AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
5224 # The other port number must be different (already tested above).
5226 AT_CHECK([test "$1" = '[[]]' || test "$p1" = "$1"])
5227 AT_CHECK([test "$2" = '[[]]' || test "$p2" = "$2"])
5230 for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
5232 for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
5234 echo -----------------------------------------------------------
5235 echo "Check changing port numbers from $pre to $post"
5236 set_and_check_poorly_specified_ofports $pre
5237 set_and_check_poorly_specified_ofports $post
5244 AT_SETUP([ofproto - bundle open (OpenFlow 1.4)])
5245 AT_KEYWORDS([monitor])
5248 # Start a monitor, use the required protocol version
5249 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5250 AT_CAPTURE_FILE([monitor.log])
5252 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
5253 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
5254 ovs-appctl -t ovs-ofctl ofctl/barrier
5255 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5257 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5258 send: OFPT_BUNDLE_CONTROL (OF1.4):
5259 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5260 OFPT_BUNDLE_CONTROL (OF1.4):
5261 bundle_id=0x1 type=OPEN_REPLY flags=0
5262 OFPT_BARRIER_REPLY (OF1.4):
5268 AT_SETUP([ofproto - bundle double open (OpenFlow 1.4)])
5269 AT_KEYWORDS([monitor])
5272 # Start a monitor, use the required protocol version
5273 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5274 AT_CAPTURE_FILE([monitor.log])
5276 # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
5277 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
5278 ovs-appctl -t ovs-ofctl ofctl/barrier
5279 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
5280 ovs-appctl -t ovs-ofctl ofctl/barrier
5281 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5283 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5284 send: OFPT_BUNDLE_CONTROL (OF1.4):
5285 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5286 OFPT_BUNDLE_CONTROL (OF1.4):
5287 bundle_id=0x1 type=OPEN_REPLY flags=0
5288 OFPT_BARRIER_REPLY (OF1.4):
5289 send: OFPT_BUNDLE_CONTROL (OF1.4):
5290 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5291 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5292 OFPT_BUNDLE_CONTROL (OF1.4):
5293 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5294 OFPT_BARRIER_REPLY (OF1.4):
5300 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)])
5301 AT_KEYWORDS([monitor])
5304 # Start a monitor, use the required protocol version
5305 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5306 AT_CAPTURE_FILE([monitor.log])
5308 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
5309 ovs-appctl -t ovs-ofctl ofctl/barrier
5310 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5312 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5313 send: OFPT_BUNDLE_CONTROL (OF1.4):
5314 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5315 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5316 OFPT_BUNDLE_CONTROL (OF1.4):
5317 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5318 OFPT_BARRIER_REPLY (OF1.4):
5324 AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)])
5325 AT_KEYWORDS([monitor])
5328 # Start a monitor, use the required protocol version
5329 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5330 AT_CAPTURE_FILE([monitor.log])
5332 # Open, Close, Close
5333 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
5334 ovs-appctl -t ovs-ofctl ofctl/barrier
5335 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
5336 ovs-appctl -t ovs-ofctl ofctl/barrier
5337 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
5338 ovs-appctl -t ovs-ofctl ofctl/barrier
5339 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5341 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5342 send: OFPT_BUNDLE_CONTROL (OF1.4):
5343 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5344 OFPT_BUNDLE_CONTROL (OF1.4):
5345 bundle_id=0x1 type=OPEN_REPLY flags=0
5346 OFPT_BARRIER_REPLY (OF1.4):
5347 send: OFPT_BUNDLE_CONTROL (OF1.4):
5348 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5349 OFPT_BUNDLE_CONTROL (OF1.4):
5350 bundle_id=0x1 type=CLOSE_REPLY flags=0
5351 OFPT_BARRIER_REPLY (OF1.4):
5352 send: OFPT_BUNDLE_CONTROL (OF1.4):
5353 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5354 OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED
5355 OFPT_BUNDLE_CONTROL (OF1.4):
5356 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5357 OFPT_BARRIER_REPLY (OF1.4):
5363 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)])
5364 AT_KEYWORDS([monitor])
5367 # Start a monitor, use the required protocol version
5368 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5369 AT_CAPTURE_FILE([monitor.log])
5372 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
5373 ovs-appctl -t ovs-ofctl ofctl/barrier
5374 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
5375 ovs-appctl -t ovs-ofctl ofctl/barrier
5376 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5378 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5379 send: OFPT_BUNDLE_CONTROL (OF1.4):
5380 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5381 OFPT_BUNDLE_CONTROL (OF1.4):
5382 bundle_id=0x1 type=OPEN_REPLY flags=0
5383 OFPT_BARRIER_REPLY (OF1.4):
5384 send: OFPT_BUNDLE_CONTROL (OF1.4):
5385 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
5386 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
5387 OFPT_BUNDLE_CONTROL (OF1.4):
5388 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
5389 OFPT_BARRIER_REPLY (OF1.4):
5395 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)])
5396 AT_KEYWORDS([monitor])
5399 # Start a monitor, use the required protocol version
5400 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5401 AT_CAPTURE_FILE([monitor.log])
5404 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02"
5405 ovs-appctl -t ovs-ofctl ofctl/barrier
5406 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5408 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5409 send: OFPT_BUNDLE_CONTROL (OF1.4):
5410 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
5411 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5412 OFPT_BUNDLE_CONTROL (OF1.4):
5413 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
5414 OFPT_BARRIER_REPLY (OF1.4):
5420 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)])
5421 AT_KEYWORDS([monitor])
5424 # Start a monitor, use the required protocol version
5425 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5426 AT_CAPTURE_FILE([monitor.log])
5429 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
5430 ovs-appctl -t ovs-ofctl ofctl/barrier
5431 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01"
5432 ovs-appctl -t ovs-ofctl ofctl/barrier
5433 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5435 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5436 send: OFPT_BUNDLE_CONTROL (OF1.4):
5437 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5438 OFPT_BUNDLE_CONTROL (OF1.4):
5439 bundle_id=0x1 type=OPEN_REPLY flags=0
5440 OFPT_BARRIER_REPLY (OF1.4):
5441 send: OFPT_BUNDLE_CONTROL (OF1.4):
5442 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
5443 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
5444 OFPT_BUNDLE_CONTROL (OF1.4):
5445 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
5446 OFPT_BARRIER_REPLY (OF1.4):
5452 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)])
5453 AT_KEYWORDS([monitor])
5456 # Start a monitor, use the required protocol version
5457 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5458 AT_CAPTURE_FILE([monitor.log])
5461 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 02"
5462 ovs-appctl -t ovs-ofctl ofctl/barrier
5463 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5465 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5466 send: OFPT_BUNDLE_CONTROL (OF1.4):
5467 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
5468 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5469 OFPT_BUNDLE_CONTROL (OF1.4):
5470 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
5471 OFPT_BARRIER_REPLY (OF1.4):
5478 AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.4)])
5481 AT_CHECK([ovs-appctl vlog/set vconn:dbg])
5483 AT_CHECK([ovs-ofctl --no-names del-flows br0])
5485 AT_DATA([flows.txt], [dnl
5486 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
5487 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
5488 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
5489 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
5491 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
5492 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
5493 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
5494 delete in_port=2 dl_src=00:88:99:aa:bb:cc
5497 AT_CHECK([ovs-ofctl --no-names --bundle add-flows br0 flows.txt])
5499 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5500 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
5501 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
5505 AT_DATA([flows.txt], [dnl
5507 modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7
5510 AT_CHECK([ovs-ofctl --no-names --bundle add-flows br0 flows.txt])
5512 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5513 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5514 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
5518 # Adding an existing flow acts as a modify, and delete_strict also works.
5519 AT_DATA([flows.txt], [dnl
5520 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8
5521 delete_strict in_port=2 dl_src=00:66:77:88:99:aa
5522 add in_port=2 dl_src=00:66:77:88:99:aa actions=drop
5525 AT_CHECK([ovs-ofctl --no-names --bundle add-flows br0 flows.txt])
5527 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5528 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
5529 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5533 dnl Check logs for OpenFlow trace
5535 OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3])
5536 AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl
5537 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5538 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5539 vconn|DBG|unix: received: OFPT_HELLO:
5540 version bitmap: 0x01
5541 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
5542 vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop
5543 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5544 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5545 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5546 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5547 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
5548 version bitmap: 0x05
5549 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
5550 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5551 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
5552 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5553 bundle_id=0 type=OPEN_REPLY flags=0
5554 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5555 bundle_id=0 flags=atomic ordered
5556 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1
5557 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5558 bundle_id=0 flags=atomic ordered
5559 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2
5560 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5561 bundle_id=0 flags=atomic ordered
5562 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3
5563 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5564 bundle_id=0 flags=atomic ordered
5565 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:4
5566 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5567 bundle_id=0 flags=atomic ordered
5568 OFPT_FLOW_MOD (OF1.4): DEL table:255 actions=drop
5569 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5570 bundle_id=0 flags=atomic ordered
5571 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:5
5572 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5573 bundle_id=0 flags=atomic ordered
5574 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:6
5575 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5576 bundle_id=0 flags=atomic ordered
5577 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7
5578 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5579 bundle_id=0 flags=atomic ordered
5580 OFPT_FLOW_MOD (OF1.4): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
5581 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
5582 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
5583 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5584 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5585 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5586 bundle_id=0 type=COMMIT_REPLY flags=0
5587 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5588 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5589 vconn|DBG|unix: received: OFPT_HELLO:
5590 version bitmap: 0x01
5591 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
5592 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
5593 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5594 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5595 vconn|DBG|unix: received: NXST_FLOW request:
5596 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
5597 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
5598 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
5599 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5600 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5601 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
5602 version bitmap: 0x05
5603 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
5604 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5605 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
5606 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5607 bundle_id=0 type=OPEN_REPLY flags=0
5608 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5609 bundle_id=0 flags=atomic ordered
5610 OFPT_FLOW_MOD (OF1.4): MOD actions=drop
5611 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5612 bundle_id=0 flags=atomic ordered
5613 OFPT_FLOW_MOD (OF1.4): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
5614 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
5615 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
5616 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5617 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5618 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5619 bundle_id=0 type=COMMIT_REPLY flags=0
5620 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5621 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5622 vconn|DBG|unix: received: OFPT_HELLO:
5623 version bitmap: 0x01
5624 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
5625 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
5626 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5627 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5628 vconn|DBG|unix: received: NXST_FLOW request:
5629 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
5630 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5631 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
5632 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5633 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5634 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
5635 version bitmap: 0x05
5636 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
5637 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5638 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
5639 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5640 bundle_id=0 type=OPEN_REPLY flags=0
5641 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5642 bundle_id=0 flags=atomic ordered
5643 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8
5644 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5645 bundle_id=0 flags=atomic ordered
5646 OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5647 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5648 bundle_id=0 flags=atomic ordered
5649 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5650 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
5651 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
5652 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
5653 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
5654 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
5655 bundle_id=0 type=COMMIT_REPLY flags=0
5656 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
5657 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
5658 vconn|DBG|unix: received: OFPT_HELLO:
5659 version bitmap: 0x01
5660 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
5661 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
5662 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
5663 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
5664 vconn|DBG|unix: received: NXST_FLOW request:
5665 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
5666 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
5667 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
5670 AT_CHECK([grep " flow_mods in the last " ovs-vswitchd.log | sed -e 's/^.*connmgr|INFO|//' | vconn_sub], [0], [dnl
5671 br0<->unix: 1 flow_mods in the last 0 s (1 deletes)
5672 br0<->unix: 9 flow_mods in the last 0 s (7 adds, 2 deletes)
5673 br0<->unix: 2 flow_mods in the last 0 s (2 modifications)
5674 br0<->unix: 3 flow_mods in the last 0 s (2 adds, 1 deletes)
5681 AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.4)])
5684 AT_CHECK([ovs-ofctl del-flows br0])
5686 ovs-ofctl add-flows br0 - <<EOF
5687 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=11
5688 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=22
5689 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=33
5691 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5692 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
5693 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
5694 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
5698 # last line uses illegal table number (OVS internal table)
5699 AT_DATA([flows.txt], [dnl
5700 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
5701 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
5702 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
5703 modify idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
5705 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
5706 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
5707 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
5708 delete in_port=2 dl_src=00:88:99:aa:bb:cc
5709 add table=254 actions=drop
5712 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt 2>&1 | sed '/talking to/,$d' | strip_xids],
5714 Error OFPBRC_EPERM for: OFPT_FLOW_MOD (OF1.4): ADD table:254 actions=drop
5717 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5718 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
5719 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
5720 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
5728 AT_SETUP([ofproto - bundle timeout (OpenFlow 1.4)])
5729 AT_KEYWORDS([monitor])
5732 # Start a monitor, use the required protocol version
5733 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5734 AT_CAPTURE_FILE([monitor.log])
5736 ovs-appctl time/stop
5738 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (01)
5739 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 01 00 00 00 01 00 00 00 03"
5740 ovs-appctl time/warp 8000
5741 # Send a bundle flow mod, it should keep the bundle alive.
5742 ovs-appctl -t ovs-ofctl ofctl/send "05 22 00 a0 00 00 00 02 00 00 00 01 00 00 00 03 \
5743 05 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \
5744 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \
5745 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \
5746 00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \
5747 50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \
5748 80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \
5749 00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \
5750 00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \
5751 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \
5753 ovs-appctl time/warp 8000
5754 # Send a bundle close, it should keep the bundle alive.
5755 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 03 00 00 00 01 00 02 00 03"
5756 ovs-appctl time/warp 11000
5757 # Make sure that timeouts are processed after the expiry
5758 ovs-appctl time/warp 1000
5759 # Send a Commit, but too late.
5760 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 04 00 00 00 01 00 04 00 03"
5761 ovs-appctl -t ovs-ofctl ofctl/barrier
5762 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5764 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5765 send: OFPT_BUNDLE_CONTROL (OF1.4):
5766 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5767 OFPT_BUNDLE_CONTROL (OF1.4):
5768 bundle_id=0x1 type=OPEN_REPLY flags=0
5769 send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5770 bundle_id=0x1 flags=atomic ordered
5771 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
5772 send: OFPT_BUNDLE_CONTROL (OF1.4):
5773 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic ordered
5774 OFPT_BUNDLE_CONTROL (OF1.4):
5775 bundle_id=0x1 type=CLOSE_REPLY flags=0
5776 OFPT_ERROR (OF1.4): OFPBFC_TIMEOUT
5777 OFPT_BUNDLE_CONTROL (OF1.4):
5778 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5779 send: OFPT_BUNDLE_CONTROL (OF1.4):
5780 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5781 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5782 OFPT_BUNDLE_CONTROL (OF1.4):
5783 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5784 OFPT_BARRIER_REPLY (OF1.4):
5790 AT_SETUP([ofproto - bundle custom timeout (OpenFlow 1.4)])
5791 AT_KEYWORDS([monitor])
5794 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:bundle-idle-timeout=4])
5796 # Start a monitor, use the required protocol version
5797 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5798 AT_CAPTURE_FILE([monitor.log])
5800 ovs-appctl time/stop
5802 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (01)
5803 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 01 00 00 00 01 00 00 00 03"
5804 ovs-appctl time/warp 2000
5805 # Send a bundle flow mod, it should keep the bundle alive.
5806 ovs-appctl -t ovs-ofctl ofctl/send "05 22 00 a0 00 00 00 02 00 00 00 01 00 00 00 03 \
5807 05 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \
5808 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \
5809 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \
5810 00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \
5811 50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \
5812 80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \
5813 00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \
5814 00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \
5815 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \
5817 ovs-appctl time/warp 2000
5818 # Send a bundle close, it should keep the bundle alive.
5819 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 03 00 00 00 01 00 02 00 03"
5820 ovs-appctl time/warp 4000
5821 # Make sure that timeouts are processed after the expiry, but still before the
5822 # current timeout of 4s.
5823 ovs-appctl time/warp 1000
5824 # Send a Commit, but too late.
5825 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 04 00 00 00 01 00 04 00 03"
5826 ovs-appctl -t ovs-ofctl ofctl/barrier
5827 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5829 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5830 send: OFPT_BUNDLE_CONTROL (OF1.4):
5831 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5832 OFPT_BUNDLE_CONTROL (OF1.4):
5833 bundle_id=0x1 type=OPEN_REPLY flags=0
5834 send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5835 bundle_id=0x1 flags=atomic ordered
5836 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
5837 send: OFPT_BUNDLE_CONTROL (OF1.4):
5838 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic ordered
5839 OFPT_BUNDLE_CONTROL (OF1.4):
5840 bundle_id=0x1 type=CLOSE_REPLY flags=0
5841 OFPT_ERROR (OF1.4): OFPBFC_TIMEOUT
5842 OFPT_BUNDLE_CONTROL (OF1.4):
5843 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5844 send: OFPT_BUNDLE_CONTROL (OF1.4):
5845 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5846 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5847 OFPT_BUNDLE_CONTROL (OF1.4):
5848 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5849 OFPT_BARRIER_REPLY (OF1.4):
5855 AT_SETUP([ofproto - bundle reset timeout to default (OpenFlow 1.4)])
5856 AT_KEYWORDS([monitor])
5859 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:bundle-idle-timeout=15])
5860 AT_CHECK([ovs-vsctl remove Open_vSwitch . other_config bundle-idle-timeout])
5862 # Start a monitor, use the required protocol version
5863 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5864 AT_CAPTURE_FILE([monitor.log])
5866 ovs-appctl time/stop
5868 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (01)
5869 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 01 00 00 00 01 00 00 00 03"
5870 ovs-appctl time/warp 8000
5871 # Send a bundle flow mod, it should keep the bundle alive.
5872 ovs-appctl -t ovs-ofctl ofctl/send "05 22 00 a0 00 00 00 02 00 00 00 01 00 00 00 03 \
5873 05 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \
5874 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \
5875 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \
5876 00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \
5877 50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \
5878 80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \
5879 00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \
5880 00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \
5881 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \
5883 ovs-appctl time/warp 8000
5884 # Send a bundle close, it should keep the bundle alive.
5885 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 03 00 00 00 01 00 02 00 03"
5886 ovs-appctl time/warp 11000
5887 # Make sure that timeouts are processed after the expiry
5888 ovs-appctl time/warp 1000
5889 # Send a Commit, but too late.
5890 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 04 00 00 00 01 00 04 00 03"
5891 ovs-appctl -t ovs-ofctl ofctl/barrier
5892 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5894 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5895 send: OFPT_BUNDLE_CONTROL (OF1.4):
5896 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5897 OFPT_BUNDLE_CONTROL (OF1.4):
5898 bundle_id=0x1 type=OPEN_REPLY flags=0
5899 send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
5900 bundle_id=0x1 flags=atomic ordered
5901 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
5902 send: OFPT_BUNDLE_CONTROL (OF1.4):
5903 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic ordered
5904 OFPT_BUNDLE_CONTROL (OF1.4):
5905 bundle_id=0x1 type=CLOSE_REPLY flags=0
5906 OFPT_ERROR (OF1.4): OFPBFC_TIMEOUT
5907 OFPT_BUNDLE_CONTROL (OF1.4):
5908 bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
5909 send: OFPT_BUNDLE_CONTROL (OF1.4):
5910 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5911 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
5912 OFPT_BUNDLE_CONTROL (OF1.4):
5913 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
5914 OFPT_BARRIER_REPLY (OF1.4):
5920 AT_SETUP([ofproto - bundle open (OpenFlow 1.3)])
5921 AT_KEYWORDS([monitor])
5924 # Start a monitor, use the required protocol version
5925 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5926 AT_CAPTURE_FILE([monitor.log])
5928 # Send an OpenFlow13 message (04), OFPT_EXPERIMENTER (04), length (0018),
5929 # xid (0000000a), ONF_EXPERIMENTER_ID (4F4E4600),
5930 # ONFT_BUNDLE_CONTROL (2300 = 0x08FC), bundle id (00000001),
5931 # message type (0000), and flags (0002)
5932 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"
5933 ovs-appctl -t ovs-ofctl ofctl/barrier
5934 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5936 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
5937 send: ONFT_BUNDLE_CONTROL (OF1.3):
5938 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5939 ONFT_BUNDLE_CONTROL (OF1.3):
5940 bundle_id=0x1 type=OPEN_REPLY flags=0
5941 OFPT_BARRIER_REPLY (OF1.3):
5947 AT_SETUP([ofproto - bundle double open (OpenFlow 1.3)])
5948 AT_KEYWORDS([monitor])
5951 # Start a monitor, use the required protocol version
5952 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5953 AT_CAPTURE_FILE([monitor.log])
5955 # Send twice an OpenFlow13 message (04), OFPT_EXPERIMENTER (04), length (0018),
5956 # xid (0000000a), ONF_EXPERIMENTER_ID (4F4E4600),
5957 # ONFT_BUNDLE_CONTROL (2300 = 0x08FC), bundle id (00000001),
5958 # message type (0000), and flags (0002)
5959 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"
5960 ovs-appctl -t ovs-ofctl ofctl/barrier
5961 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"
5962 ovs-appctl -t ovs-ofctl ofctl/barrier
5963 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5965 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5966 send: ONFT_BUNDLE_CONTROL (OF1.3):
5967 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5968 ONFT_BUNDLE_CONTROL (OF1.3):
5969 bundle_id=0x1 type=OPEN_REPLY flags=0
5970 OFPT_BARRIER_REPLY (OF1.3):
5971 send: ONFT_BUNDLE_CONTROL (OF1.3):
5972 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5973 OFPT_ERROR (OF1.3): OFPBFC_BAD_ID
5974 ONFT_BUNDLE_CONTROL (OF1.3):
5975 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
5976 OFPT_BARRIER_REPLY (OF1.3):
5982 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.3)])
5983 AT_KEYWORDS([monitor])
5986 # Start a monitor, use the required protocol version
5987 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
5988 AT_CAPTURE_FILE([monitor.log])
5990 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"
5991 ovs-appctl -t ovs-ofctl ofctl/barrier
5992 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
5994 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
5995 send: ONFT_BUNDLE_CONTROL (OF1.3):
5996 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
5997 OFPT_ERROR (OF1.3): OFPBFC_BAD_ID
5998 ONFT_BUNDLE_CONTROL (OF1.3):
5999 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
6000 OFPT_BARRIER_REPLY (OF1.3):
6006 AT_SETUP([ofproto - bundle double close (OpenFlow 1.3)])
6007 AT_KEYWORDS([monitor])
6010 # Start a monitor, use the required protocol version
6011 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
6012 AT_CAPTURE_FILE([monitor.log])
6014 # Open, Close, Close
6015 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"
6016 ovs-appctl -t ovs-ofctl ofctl/barrier
6017 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"
6018 ovs-appctl -t ovs-ofctl ofctl/barrier
6019 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"
6020 ovs-appctl -t ovs-ofctl ofctl/barrier
6021 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
6023 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
6024 send: ONFT_BUNDLE_CONTROL (OF1.3):
6025 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
6026 ONFT_BUNDLE_CONTROL (OF1.3):
6027 bundle_id=0x1 type=OPEN_REPLY flags=0
6028 OFPT_BARRIER_REPLY (OF1.3):
6029 send: ONFT_BUNDLE_CONTROL (OF1.3):
6030 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
6031 ONFT_BUNDLE_CONTROL (OF1.3):
6032 bundle_id=0x1 type=CLOSE_REPLY flags=0
6033 OFPT_BARRIER_REPLY (OF1.3):
6034 send: ONFT_BUNDLE_CONTROL (OF1.3):
6035 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
6036 OFPT_ERROR (OF1.3): OFPBFC_BUNDLE_CLOSED
6037 ONFT_BUNDLE_CONTROL (OF1.3):
6038 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
6039 OFPT_BARRIER_REPLY (OF1.3):
6045 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.3)])
6046 AT_KEYWORDS([monitor])
6049 # Start a monitor, use the required protocol version
6050 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
6051 AT_CAPTURE_FILE([monitor.log])
6054 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"
6055 ovs-appctl -t ovs-ofctl ofctl/barrier
6056 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"
6057 ovs-appctl -t ovs-ofctl ofctl/barrier
6058 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
6060 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
6061 send: ONFT_BUNDLE_CONTROL (OF1.3):
6062 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
6063 ONFT_BUNDLE_CONTROL (OF1.3):
6064 bundle_id=0x1 type=OPEN_REPLY flags=0
6065 OFPT_BARRIER_REPLY (OF1.3):
6066 send: ONFT_BUNDLE_CONTROL (OF1.3):
6067 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
6068 OFPT_ERROR (OF1.3): OFPBFC_BAD_FLAGS
6069 ONFT_BUNDLE_CONTROL (OF1.3):
6070 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
6071 OFPT_BARRIER_REPLY (OF1.3):
6077 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.3)])
6078 AT_KEYWORDS([monitor])
6081 # Start a monitor, use the required protocol version
6082 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
6083 AT_CAPTURE_FILE([monitor.log])
6086 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"
6087 ovs-appctl -t ovs-ofctl ofctl/barrier
6088 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
6090 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
6091 send: ONFT_BUNDLE_CONTROL (OF1.3):
6092 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
6093 OFPT_ERROR (OF1.3): OFPBFC_BAD_ID
6094 ONFT_BUNDLE_CONTROL (OF1.3):
6095 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
6096 OFPT_BARRIER_REPLY (OF1.3):
6102 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.3)])
6103 AT_KEYWORDS([monitor])
6106 # Start a monitor, use the required protocol version
6107 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
6108 AT_CAPTURE_FILE([monitor.log])
6111 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"
6112 ovs-appctl -t ovs-ofctl ofctl/barrier
6113 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"
6114 ovs-appctl -t ovs-ofctl ofctl/barrier
6115 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
6117 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
6118 send: ONFT_BUNDLE_CONTROL (OF1.3):
6119 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
6120 ONFT_BUNDLE_CONTROL (OF1.3):
6121 bundle_id=0x1 type=OPEN_REPLY flags=0
6122 OFPT_BARRIER_REPLY (OF1.3):
6123 send: ONFT_BUNDLE_CONTROL (OF1.3):
6124 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
6125 OFPT_ERROR (OF1.3): OFPBFC_BAD_FLAGS
6126 ONFT_BUNDLE_CONTROL (OF1.3):
6127 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
6128 OFPT_BARRIER_REPLY (OF1.3):
6134 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.3)])
6135 AT_KEYWORDS([monitor])
6138 # Start a monitor, use the required protocol version
6139 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
6140 AT_CAPTURE_FILE([monitor.log])
6143 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"
6144 ovs-appctl -t ovs-ofctl ofctl/barrier
6145 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
6147 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
6148 send: ONFT_BUNDLE_CONTROL (OF1.3):
6149 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
6150 OFPT_ERROR (OF1.3): OFPBFC_BAD_ID
6151 ONFT_BUNDLE_CONTROL (OF1.3):
6152 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
6153 OFPT_BARRIER_REPLY (OF1.3):
6160 AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.3)])
6163 AT_CHECK([ovs-appctl vlog/set vconn:dbg])
6165 AT_CHECK([ovs-ofctl --no-names del-flows br0])
6167 AT_DATA([flows.txt], [dnl
6168 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
6169 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
6170 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
6171 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
6173 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
6174 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
6175 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
6176 delete in_port=2 dl_src=00:88:99:aa:bb:cc
6179 AT_CHECK([ovs-ofctl -O OpenFlow13 --no-names --bundle add-flows br0 flows.txt])
6181 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6182 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
6183 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
6187 AT_DATA([flows.txt], [dnl
6189 modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7
6192 AT_CHECK([ovs-ofctl -O OpenFlow13 --no-names --bundle add-flows br0 flows.txt])
6194 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6195 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
6196 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
6200 # Adding an existing flow acts as a modify, and delete_strict also works.
6201 AT_DATA([flows.txt], [dnl
6202 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8
6203 delete_strict in_port=2 dl_src=00:66:77:88:99:aa
6204 add in_port=2 dl_src=00:66:77:88:99:aa actions=drop
6207 AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle --no-names add-flows br0 flows.txt])
6209 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6210 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
6211 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
6215 dnl Check logs for OpenFlow trace
6217 OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3])
6218 AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl
6219 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6220 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6221 vconn|DBG|unix: received: OFPT_HELLO:
6222 version bitmap: 0x01
6223 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
6224 vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop
6225 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
6226 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
6227 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6228 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6229 vconn|DBG|unix: received: OFPT_HELLO (OF1.3):
6230 version bitmap: 0x04
6231 vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x06 and earlier, peer supports version 0x04)
6232 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
6233 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
6234 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
6235 bundle_id=0 type=OPEN_REPLY flags=0
6236 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6237 bundle_id=0 flags=atomic ordered
6238 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1
6239 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6240 bundle_id=0 flags=atomic ordered
6241 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2
6242 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6243 bundle_id=0 flags=atomic ordered
6244 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3
6245 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6246 bundle_id=0 flags=atomic ordered
6247 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:4
6248 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6249 bundle_id=0 flags=atomic ordered
6250 OFPT_FLOW_MOD (OF1.3): DEL table:255 actions=drop
6251 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6252 bundle_id=0 flags=atomic ordered
6253 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:5
6254 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6255 bundle_id=0 flags=atomic ordered
6256 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:6
6257 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6258 bundle_id=0 flags=atomic ordered
6259 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7
6260 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6261 bundle_id=0 flags=atomic ordered
6262 OFPT_FLOW_MOD (OF1.3): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
6263 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.3):
6264 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.3):
6265 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
6266 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
6267 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
6268 bundle_id=0 type=COMMIT_REPLY flags=0
6269 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6270 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6271 vconn|DBG|unix: received: OFPT_HELLO:
6272 version bitmap: 0x01
6273 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
6274 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
6275 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
6276 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
6277 vconn|DBG|unix: received: NXST_FLOW request:
6278 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
6279 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
6280 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
6281 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6282 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6283 vconn|DBG|unix: received: OFPT_HELLO (OF1.3):
6284 version bitmap: 0x04
6285 vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x06 and earlier, peer supports version 0x04)
6286 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
6287 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
6288 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
6289 bundle_id=0 type=OPEN_REPLY flags=0
6290 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6291 bundle_id=0 flags=atomic ordered
6292 OFPT_FLOW_MOD (OF1.3): MOD actions=drop
6293 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6294 bundle_id=0 flags=atomic ordered
6295 OFPT_FLOW_MOD (OF1.3): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
6296 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.3):
6297 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.3):
6298 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
6299 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
6300 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
6301 bundle_id=0 type=COMMIT_REPLY flags=0
6302 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6303 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6304 vconn|DBG|unix: received: OFPT_HELLO:
6305 version bitmap: 0x01
6306 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
6307 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
6308 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
6309 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
6310 vconn|DBG|unix: received: NXST_FLOW request:
6311 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
6312 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
6313 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
6314 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6315 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6316 vconn|DBG|unix: received: OFPT_HELLO (OF1.3):
6317 version bitmap: 0x04
6318 vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x06 and earlier, peer supports version 0x04)
6319 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
6320 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
6321 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
6322 bundle_id=0 type=OPEN_REPLY flags=0
6323 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6324 bundle_id=0 flags=atomic ordered
6325 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8
6326 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6327 bundle_id=0 flags=atomic ordered
6328 OFPT_FLOW_MOD (OF1.3): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
6329 vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3):
6330 bundle_id=0 flags=atomic ordered
6331 OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop
6332 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.3):
6333 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.3):
6334 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
6335 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
6336 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
6337 bundle_id=0 type=COMMIT_REPLY flags=0
6338 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
6339 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
6340 vconn|DBG|unix: received: OFPT_HELLO:
6341 version bitmap: 0x01
6342 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
6343 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
6344 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
6345 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
6346 vconn|DBG|unix: received: NXST_FLOW request:
6347 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
6348 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
6349 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
6356 AT_SETUP([ofproto - failing bundle add message (OpenFlow 1.3)])
6359 AT_CHECK([ovs-ofctl del-flows br0])
6361 ovs-ofctl add-flows br0 - <<EOF
6362 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=11
6363 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=22
6364 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=33
6366 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6367 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
6368 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
6369 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
6373 # last line uses illegal table number (OVS internal table)
6374 AT_DATA([flows.txt], [dnl
6375 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
6376 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
6377 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
6378 modify idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
6380 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
6381 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
6382 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
6383 delete in_port=2 dl_src=00:88:99:aa:bb:cc
6384 add table=254 actions=drop
6387 AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle add-flows br0 flows.txt 2>&1 | sed '/talking to/,$d' | strip_xids],
6389 Error OFPBRC_EPERM for: OFPT_FLOW_MOD (OF1.3): ADD table:254 actions=drop
6392 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6393 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
6394 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
6395 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
6403 AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.3)])
6406 AT_CHECK([ovs-ofctl del-flows br0])
6408 # Invalid group numbers are detected at commit time
6409 AT_DATA([flows.txt], [dnl
6410 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=group:1
6411 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=group:2
6412 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=group:3
6415 AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle add-flows br0 flows.txt 2>&1 | sed '/talking to/,$d' | strip_xids],
6417 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
6418 Error OFPBFC_MSG_FAILED for: ONFT_BUNDLE_CONTROL (OF1.3):
6419 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
6422 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6429 AT_SETUP([ofproto - monitor flows with tun_md])
6432 AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"])
6433 AT_CHECK([ovs-ofctl add-flow br0 tun_metadata0=0x1,actions=drop])
6435 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
6437 tun_metadata0=0x1 actions=drop
6440 AT_CAPTURE_FILE([ofctl_monitor.log])
6441 dnl Usually ovs-ofctl monitor outputs on stderr, but the first message here
6442 dnl is put on stdout, because it is handled by ofctl in dump_transaction()
6443 dnl and not in monitor_vconn().
6444 AT_CHECK([ovs-ofctl monitor br0 65534 watch: --detach --no-chdir --pidfile >ofctl_monitor.log 2>&1])
6446 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2])
6448 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
6449 NXST_FLOW_MONITOR reply:
6450 event=ADDED table=0 cookie=0 tun_metadata0=0x1
6453 AT_CHECK([ovs-ofctl del-flows br0])
6455 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
6457 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
6458 NXST_FLOW_MONITOR reply:
6459 event=ADDED table=0 cookie=0 tun_metadata0=0x1
6460 NXST_FLOW_MONITOR reply:
6461 event=DELETED reason=delete table=0 cookie=0 tun_metadata0=0x1
6464 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
6466 dnl Check that vswitchd hasn't crashed
6467 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
6474 AT_SETUP([ofproto - flow mod with tunnel metadata])
6475 AT_KEYWORDS([ofp-actions])
6478 AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"])
6479 AT_CHECK([ovs-ofctl add-flow br0 "in_port=1 actions=move:tun_metadata0[[0..31]]->NXM_NX_REG0[[]]"])
6481 dnl Check the length of tun_metadata0 in the replied OXM header.
6482 dnl Ignore the first 0x50 bytes of hex dump from the reply msg since the NXM
6483 dnl header that describes the tunnel metadata starts at offset 0x50.
6484 AT_CHECK([ovs-ofctl dump-flows br0 -mmmm], [0], [stdout])
6485 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
6487 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[[]]
6488 00000050 ff ff 00 18 00 00 23 20-00 06 00 20 00 00 00 00 |......# ... ....|
6489 00000060 00 01 50 04 00 01 00 04- |..P..... |
6492 dnl Check actions that may use tun_metadata
6493 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=move:tun_metadata1[[0..31]]->NXM_NX_REG0[[]]"], [1], [], [stderr])
6494 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6495 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6498 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=move:tun_metadata0[[32..63]]->NXM_NX_REG0[[]]"], [1], [], [stderr])
6499 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6500 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6503 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=push:tun_metadata1[[0..31]]"], [1], [], [stderr])
6504 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6505 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6508 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=pop:tun_metadata0[[32..63]]"], [1], [], [stderr])
6509 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6510 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6513 AT_CHECK([ovs-ofctl add-flow br0 "in_port=3, actions=load:0x11223344->tun_metadata1"], [1], [], [stderr])
6514 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6515 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6518 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=output:tun_metadata1[[0..31]]"], [1], [], [stderr])
6519 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6520 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6523 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=output:tun_metadata0[[32..63]]"], [1], [], [stderr])
6524 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6525 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6528 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])
6529 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6530 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6533 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])
6534 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6535 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6538 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])
6539 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6540 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6543 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])
6544 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6545 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6548 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=learn(tun_metadata1[[0..31]]=reg0[[0..31]])"], [1], [], [stderr])
6549 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6550 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6553 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=learn(tun_metadata0[[32..63]]=reg0[[0..31]])"], [1], [], [stderr])
6554 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6555 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6558 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=clone(move:tun_metadata1[[0..31]]->reg0[[0..31]])"], [1], [], [stderr])
6559 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6560 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6563 AT_CHECK([ovs-ofctl add-flow br0 "in_port=2 actions=clone(move:tun_metadata0[[32..63]]->reg0[[0..31]])"], [1], [], [stderr])
6564 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6565 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6568 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=ct(commit,zone=tun_metadata1[[0..15]],exec(set_field:0x01->ct_mark))"], [1], [], [stderr])
6569 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6570 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6573 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=ct(commit,zone=tun_metadata0[[32..47]],exec(set_field:0x01->ct_mark))"], [1], [], [stderr])
6574 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6575 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6578 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=ct(commit,zone=1,exec(move:tun_metadata1[[0..31]]->ct_mark))"], [1], [], [stderr])
6579 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6580 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6583 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=ct(commit,zone=1,exec(move:tun_metadata0[[32..63]]->ct_mark))"], [1], [], [stderr])
6584 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6585 OFPT_ERROR: OFPBAC_BAD_SET_LEN
6588 dnl Check match field with tun_metadata
6589 AT_CHECK([ovs-ofctl add-flow br0 "tun_metadata0=0x11223344 actions=output:2"], [0], [], [stderr])
6590 AT_CHECK([ovs-ofctl add-flow br0 "tun_metadata1=0x11223344 actions=output:2"], [1], [], [stderr])
6591 AT_CHECK([strip_xids < stderr | sed '/FLOW_MOD/,$d'], [0], [dnl
6592 OFPT_ERROR: NXFMFC_INVALID_TLV_FIELD
6595 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl)
6597 in_port=1 actions=move:NXM_NX_TUN_METADATA0[[0..31]]->NXM_NX_REG0[[]]
6598 tun_metadata0=0x11223344 actions=output:2
6601 OVS_VSWITCHD_STOP(["/NXFMFC_INVALID_TLV_FIELD/d
6603 /OFPBAC_BAD_SET_LEN/d"])
6606 AT_SETUP([ofproto - flush flows, groups, and meters for controller change])
6607 AT_KEYWORDS([flow flows group group meter])
6610 add_flow_group_and_meter () {
6611 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
6612 AT_CHECK([ovs-ofctl -O OpenFlow11 add-group br0 group_id=1234,type=all,bucket=output:10
6613 AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=1 pktps burst stats bands=type=drop rate=1 burst_size=1'])
6618 AT_CHECK([ovs-ofctl --no-stats dump-flows br0], [0], [dnl
6619 in_port=1 actions=output:2
6621 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-groups br0], [0], [dnl
6622 OFPST_GROUP_DESC reply (OF1.1) (xid=0x2):
6623 group_id=1234,type=all,bucket=actions=output:10
6625 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-meters br0], [0], [dnl
6626 OFPST_METER_CONFIG reply (OF1.3) (xid=0x2):
6627 meter=1 pktps burst stats bands=
6628 type=drop rate=1 burst_size=1
6633 AT_CHECK([ovs-ofctl --no-stats dump-flows br0])
6634 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-groups br0], [0], [dnl
6635 OFPST_GROUP_DESC reply (OF1.1) (xid=0x2):
6637 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-meters br0], [0], [dnl
6638 OFPST_METER_CONFIG reply (OF1.3) (xid=0x2):
6642 # Add flow, group, meter and check that they're there, without a controller.
6643 add_flow_group_and_meter
6646 # Set up a controller and verify that the flow and group were deleted,
6647 # then add them back.
6648 AT_CHECK([ovs-vsctl set-controller br0 'tcp:<invalid>:6653'])
6650 add_flow_group_and_meter
6653 # Change the controller and verify that the flow and group are still there.
6654 AT_CHECK([ovs-vsctl set-controller br0 'tcp:<invalid2>:6653'])
6657 # Clear the controller and verify that the flow and group were deleted.
6658 AT_CHECK([ovs-vsctl del-controller br0])
6661 OVS_VSWITCHD_STOP(["/<invalid/d"])