3 AT_SETUP([ofproto - echo request])
5 AT_CHECK([ovs-ofctl -vwarn probe br0])
9 AT_SETUP([ofproto - handling messages with bad version])
12 # Start a monitor running OpenFlow 1.0, then send the switch an OF1.1 features
14 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
15 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
16 AT_CAPTURE_FILE([monitor.log])
17 ovs-appctl -t ovs-ofctl ofctl/send 0205000801234567
18 ovs-appctl -t ovs-ofctl ofctl/barrier
19 ovs-appctl -t ovs-ofctl exit
21 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//
22 /ECHO/d' monitor.log], [0], [dnl
23 send: OFPT_FEATURES_REQUEST (OF1.1):
24 OFPT_ERROR (OF1.1): OFPBRC_BAD_VERSION
25 OFPT_FEATURES_REQUEST (OF1.1):
29 OVS_VSWITCHD_STOP(["/received OpenFlow version 0x02 != expected 01/d"])
32 AT_SETUP([ofproto - feature request, config request])
34 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
35 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
36 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
37 n_tables:254, n_buffers:256
38 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
39 actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
40 LOCAL(br0): addr:aa:55:aa:55:00:00
43 speed: 0 Mbps now, 0 Mbps max
44 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
49 AT_SETUP([ofproto - set OpenFlow port number])
51 [add-port br0 p1 -- set Interface p1 type=dummy --\
52 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=99])
53 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
55 s/ (xid=0x[0-9a-fA-F]*)//
56 s/00:0.$/00:0x/' < stdout]],
58 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
59 n_tables:254, n_buffers:256
60 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
61 actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
62 1(p1): addr:aa:55:aa:55:00:0x
65 speed: 0 Mbps now, 0 Mbps max
66 99(p2): addr:aa:55:aa:55:00:0x
69 speed: 0 Mbps now, 0 Mbps max
70 LOCAL(br0): addr:aa:55:aa:55:00:0x
73 speed: 0 Mbps now, 0 Mbps max
74 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
80 dnl This is really bare-bones.
81 dnl It at least checks request and reply serialization and deserialization.
82 AT_SETUP([ofproto - port stats - (OpenFlow 1.0)])
84 AT_CHECK([ovs-ofctl -vwarn dump-ports br0], [0], [stdout])
85 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
86 OFPST_PORT reply: 1 ports
87 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
88 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
93 AT_SETUP([ofproto - port stats - (OpenFlow 1.2)])
95 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports br0], [0], [stdout])
96 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
97 OFPST_PORT reply (OF1.2): 1 ports
98 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
99 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
104 AT_SETUP([ofproto - port stats - (OpenFlow 1.4)])
106 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-ports br0], [0], [stdout])
107 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/'],
109 OFPST_PORT reply (OF1.4): 1 ports
110 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
111 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
117 dnl This is really bare-bones.
118 dnl It at least checks request and reply serialization and deserialization.
119 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.0)])
121 AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], [stdout])
122 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
123 OFPST_PORT_DESC reply:
124 LOCAL(br0): addr:aa:55:aa:55:00:00
127 speed: 0 Mbps now, 0 Mbps max
132 dnl This is really bare-bones.
133 dnl It at least checks request and reply serialization and deserialization.
134 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.2)])
136 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc br0], [0], [stdout])
137 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
138 OFPST_PORT_DESC reply (OF1.2):
139 LOCAL(br0): addr:aa:55:aa:55:00:00
142 speed: 0 Mbps now, 0 Mbps max
147 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.5)])
149 ADD_OF_PORTS([br0], 1, 2, 3)
150 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0], [0], [stdout])
151 AT_CHECK([STRIP_XIDS stdout | sed 's/00:0./00:0x/'], [0], [dnl
152 OFPST_PORT_DESC reply (OF1.5):
153 1(p1): addr:aa:55:aa:55:00:0x
156 speed: 0 Mbps now, 0 Mbps max
157 2(p2): addr:aa:55:aa:55:00:0x
160 speed: 0 Mbps now, 0 Mbps max
161 3(p3): addr:aa:55:aa:55:00:0x
164 speed: 0 Mbps now, 0 Mbps max
165 LOCAL(br0): addr:aa:55:aa:55:00:0x
168 speed: 0 Mbps now, 0 Mbps max
170 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0 2], [0], [stdout])
171 AT_CHECK([STRIP_XIDS stdout | sed 's/00:0./00:0x/'], [0], [dnl
172 OFPST_PORT_DESC reply (OF1.5):
173 2(p2): addr:aa:55:aa:55:00:0x
176 speed: 0 Mbps now, 0 Mbps max
181 dnl This is really bare-bones.
182 dnl It at least checks request and reply serialization and deserialization.
183 AT_SETUP([ofproto - queue stats - (OpenFlow 1.0)])
185 AT_CHECK([ovs-ofctl -vwarn queue-stats br0], [0], [stdout])
186 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
187 OFPST_QUEUE reply: 0 queues
189 AT_CHECK([ovs-ofctl -vwarn queue-stats br0 ANY 5], [0],
190 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_QUEUE
191 OFPST_QUEUE request (xid=0x2):port=ANY queue=5
193 AT_CHECK([ovs-ofctl -vwarn queue-stats br0 10], [0],
194 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT
195 OFPST_QUEUE request (xid=0x2):port=10 queue=ALL
200 AT_SETUP([ofproto - queue stats - (OpenFlow 1.2)])
202 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0], [0], [stdout])
203 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
204 OFPST_QUEUE reply (OF1.2): 0 queues
206 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 ALL 5], [0],
207 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_QUEUE
208 OFPST_QUEUE request (OF1.2) (xid=0x2):port=ANY queue=5
210 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 10], [0],
211 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_PORT
212 OFPST_QUEUE request (OF1.2) (xid=0x2):port=10 queue=ALL
217 AT_SETUP([ofproto - queue stats - (OpenFlow 1.4)])
219 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0], [0], [stdout])
220 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
221 OFPST_QUEUE reply (OF1.4): 0 queues
223 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 ALL 5], [0],
224 [OFPT_ERROR (OF1.4) (xid=0x2): OFPQOFC_BAD_QUEUE
225 OFPST_QUEUE request (OF1.4) (xid=0x2):port=ANY queue=5
227 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 10], [0],
228 [OFPT_ERROR (OF1.4) (xid=0x2): OFPQOFC_BAD_PORT
229 OFPST_QUEUE request (OF1.4) (xid=0x2):port=10 queue=ALL
234 dnl This is really bare-bones.
235 dnl It at least checks request and reply serialization and deserialization.
236 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.0)])
238 ADD_OF_PORTS([br0], [1], [2])
239 AT_CHECK([ovs-ofctl queue-get-config br0 1], [0], [stdout])
240 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
241 OFPT_QUEUE_GET_CONFIG_REPLY: port=1
243 AT_CHECK([ovs-ofctl queue-get-config br0 10], [0],
244 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT
245 OFPT_QUEUE_GET_CONFIG_REQUEST (xid=0x2): port=10
250 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.2)])
252 ADD_OF_PORTS([br0], [1], [2])
253 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 1], [0], [stdout])
254 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
255 OFPT_QUEUE_GET_CONFIG_REPLY (OF1.2): port=1
257 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 10], [0],
258 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_PORT
259 OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.2) (xid=0x2): port=10
264 dnl This is really bare-bones.
265 dnl It at least checks request and reply serialization and deserialization.
266 AT_SETUP([ofproto - del group])
268 AT_DATA([groups.txt], [dnl
269 group_id=1234,type=all,bucket=output:10
270 group_id=1235,type=all,bucket=output:10
272 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
273 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
274 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
275 OFPST_GROUP_DESC reply (OF1.5):
276 group_id=1234,type=all,bucket=actions=output:10
278 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
279 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
280 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
281 OFPST_GROUP_DESC reply (OF1.1):
282 group_id=1235,type=all,bucket=actions=output:10
284 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
285 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
286 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
287 OFPST_GROUP_DESC reply (OF1.1):
288 group_id=1235,type=all,bucket=actions=output:10
290 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0], [0])
291 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
292 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
293 OFPST_GROUP_DESC reply (OF1.1):
298 dnl This is really bare-bones.
299 dnl It at least checks request and reply serialization and deserialization.
300 AT_SETUP([ofproto - del group deletes flows])
302 AT_DATA([groups.txt], [dnl
303 group_id=1234,type=all,bucket=output:10
304 group_id=1235,type=all,bucket=output:10
306 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
307 AT_DATA([flows.txt], [dnl
308 tcp actions=group:1234
309 udp actions=group:1235
311 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt])
312 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
314 tcp actions=group:1234
315 udp actions=group:1235
316 OFPST_FLOW reply (OF1.1):
318 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
319 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
321 udp actions=group:1235
322 OFPST_FLOW reply (OF1.1):
324 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
325 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
327 udp actions=group:1235
328 OFPST_FLOW reply (OF1.1):
330 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0])
331 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
333 OFPST_FLOW reply (OF1.1):
338 dnl This is really bare-bones.
339 dnl It at least checks request and reply serialization and deserialization.
340 AT_SETUP([ofproto - flow mod checks group availability])
342 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
343 AT_DATA([flows.txt], [dnl
344 tcp actions=group:1234
345 udp actions=group:1235
347 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
348 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'], [1], [], [stderr])
350 # The output should look like this:
352 # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................|
353 # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................|
354 # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................|
355 # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............|
357 # This 'sed' command captures the error message but drops details.
358 AT_CHECK([sed '/truncated/d
359 /^000000.0/d' stderr | STRIP_XIDS], [0],
360 [OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP
361 OFPT_FLOW_MOD (OF1.1):
366 dnl This is really bare-bones.
367 dnl It at least checks request and reply serialization and deserialization.
368 AT_SETUP([ofproto - group description])
370 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10], [0], [stdout])
371 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
372 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
373 OFPST_GROUP_DESC reply (OF1.1):
374 group_id=1234,type=all,bucket=actions=output:10
379 dnl This is really bare-bones.
380 dnl It at least checks request and reply serialization and deserialization.
381 AT_SETUP([ofproto - group description])
383 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
384 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
385 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
386 OFPST_GROUP_DESC reply (OF1.1):
387 group_id=1234,type=all,bucket=actions=output:10
392 dnl This is really bare-bones.
393 dnl It at least checks request and reply serialization and deserialization.
394 AT_SETUP([ofproto - group features])
396 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout])
397 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
398 OFPST_GROUP_FEATURES reply (OF1.2):
403 max_groups = 0xffffff00 actions=0x03ff9801
405 max_groups = 0xffffff00 actions=0x00000000
407 max_groups = 0xffffff00 actions=0x00000000
408 Fast Failover group :
409 max_groups = 0xffffff00 actions=0x00000000
414 dnl This is really bare-bones.
415 dnl It at least checks request and reply serialization and deserialization.
416 AT_SETUP([ofproto - group stats])
418 AT_DATA([groups.txt], [dnl
419 group_id=1234,type=all,bucket=output:10
420 group_id=1235,type=all,bucket=output:10
422 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
423 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
424 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
425 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
426 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
427 OFPST_GROUP reply (OF1.1):
429 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0], [0], [stdout])
430 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
431 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
432 group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
433 OFPST_GROUP reply (OF1.1):
438 AT_SETUP([ofproto - mod-port (OpenFlow 1.0)])
440 for command_config_state in \
442 'noflood NO_FLOOD 0' \
443 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
444 'flood PORT_DOWN LINK_DOWN' \
445 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
446 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
447 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
448 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
449 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
453 set $command_config_state
454 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
455 AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
456 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
457 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
458 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
459 n_tables:254, n_buffers:256
460 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
461 actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
462 LOCAL(br0): addr:aa:55:aa:55:00:00
465 speed: 0 Mbps now, 0 Mbps max
466 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
472 AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
474 for command_config_state in \
476 'down PORT_DOWN LINK_DOWN' \
477 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
478 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
479 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
480 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
481 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
485 set $command_config_state
486 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
487 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
488 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout])
489 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
490 OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210
491 n_tables:254, n_buffers:256
492 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS
493 LOCAL(br0): addr:aa:55:aa:55:00:00
496 speed: 0 Mbps now, 0 Mbps max
497 OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0
503 AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
505 for command_config_state in \
507 'down PORT_DOWN LINK_DOWN' \
508 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
509 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
510 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
511 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
512 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
516 set $command_config_state
517 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
518 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command])
519 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn show br0], [0], [stdout])
520 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
521 OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210
522 n_tables:254, n_buffers:256
523 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS
524 OFPST_PORT_DESC reply (OF1.4):
525 LOCAL(br0): addr:aa:55:aa:55:00:00
528 speed: 0 Mbps now, 0 Mbps max
529 OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0
535 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
537 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
539 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -])
540 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
541 AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3])
542 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
543 in_port=1 actions=output:2
544 in_port=2 actions=output:1
545 table=1, in_port=4 actions=output:3
548 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
549 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
551 AT_CHECK([ovs-ofctl del-flows br0])
552 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
557 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
559 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
561 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -])
562 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2])
563 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3])
564 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
565 in_port=1 actions=output:2
566 in_port=2 actions=output:1
567 table=1, in_port=4 actions=output:3
570 AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
571 OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
573 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
574 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
579 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)])
581 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
583 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -])
584 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2])
585 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3])
586 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
587 in_port=1 actions=output:2
588 in_port=2 actions=output:1
589 table=1, in_port=4 actions=output:3
590 OFPST_FLOW reply (OF1.1):
592 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
593 OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2
595 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
596 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
597 table=1, in_port=4 actions=output:3
602 AT_SETUP([ofproto - flow_mod negative test (OpenFlow 1.1)])
604 [set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13])
605 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2])
607 # The error message here actually comes from ovs-ofctl, not from ovs-vswitchd,
608 # but at least it's the same code in ofpacts_check() that issues the error.
609 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1],
611 [ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID)
616 AT_SETUP([ofproto - set-field flow_mod commands (NXM)])
618 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop])
619 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])
620 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
621 table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]]
627 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)])
629 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
631 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -])
632 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2])
633 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3])
634 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
635 in_port=1 actions=output:2
636 in_port=2 actions=output:1
637 table=1, in_port=4 actions=output:3
638 OFPST_FLOW reply (OF1.2):
640 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
641 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
646 AT_SETUP([ofproto - dump flows with cookie])
648 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
649 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
650 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
651 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
652 cookie=0x1, in_port=1 actions=output:1
653 cookie=0x2, in_port=2 actions=output:1
654 cookie=0x3, in_port=3 actions=output:1
657 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
658 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
660 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl
661 cookie=0x3, in_port=3 actions=output:1
664 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | STRIP_XIDS], [0], [dnl
665 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
670 AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)])
672 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1])
673 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
674 cookie=0x1, in_port=1 actions=output:1
678 AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1])
679 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
680 cookie=0x2, in_port=1 actions=output:1
686 AT_SETUP([ofproto - mod flow with cookie change (NXM)])
688 AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1])
689 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
690 cookie=0x1, in_port=1 actions=output:1
694 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1])
695 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
696 cookie=0x2, in_port=1 actions=output:1
702 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)])
704 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
705 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
706 cookie=0x1, in_port=1 actions=output:1
707 OFPST_FLOW reply (OF1.1):
709 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1])
710 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
711 cookie=0x1, in_port=1 actions=output:1
712 OFPST_FLOW reply (OF1.1):
717 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
718 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)])
720 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
721 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
722 cookie=0x1, in_port=1 actions=output:1
723 OFPST_FLOW reply (OF1.2):
726 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1])
727 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
728 cookie=0x1, in_port=1 actions=output:1
729 OFPST_FLOW reply (OF1.2):
734 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)])
736 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
737 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
738 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
739 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
740 cookie=0x1, in_port=1 actions=output:1
741 cookie=0x1, in_port=2 actions=output:1
742 cookie=0x2, in_port=3 actions=output:1
746 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4])
747 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
748 cookie=0x1, in_port=1 actions=output:4
749 cookie=0x1, in_port=2 actions=output:4
750 cookie=0x2, in_port=3 actions=output:1
756 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)])
758 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
759 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1])
760 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1])
761 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
762 cookie=0x1, in_port=1 actions=output:1
763 cookie=0x1, in_port=2 actions=output:1
764 cookie=0x2, in_port=3 actions=output:1
765 OFPST_FLOW reply (OF1.1):
768 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4])
769 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
770 cookie=0x1, in_port=1 actions=output:4
771 cookie=0x1, in_port=2 actions=output:4
772 cookie=0x2, in_port=3 actions=output:1
773 OFPST_FLOW reply (OF1.1):
778 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)])
780 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
781 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1])
782 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1])
783 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
784 cookie=0x1, in_port=1 actions=output:1
785 cookie=0x1, in_port=2 actions=output:1
786 cookie=0x2, in_port=3 actions=output:1
787 OFPST_FLOW reply (OF1.2):
790 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4])
791 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
792 cookie=0x1, in_port=1 actions=output:4
793 cookie=0x1, in_port=2 actions=output:4
794 cookie=0x2, in_port=3 actions=output:1
795 OFPST_FLOW reply (OF1.2):
800 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
801 AT_SETUP([ofproto - mod flows based on cookie mask with cookie change])
803 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
804 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
805 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
806 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
807 cookie=0x1, in_port=1 actions=output:1
808 cookie=0x1, in_port=2 actions=output:1
809 cookie=0x2, in_port=3 actions=output:1
813 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4])
814 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
815 cookie=0x2, in_port=3 actions=output:1
816 cookie=0x4, in_port=1 actions=output:4
817 cookie=0x4, in_port=2 actions=output:4
823 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM])
825 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1])
826 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
827 in_port=1 actions=output:1
833 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1])
835 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1])
836 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
837 in_port=1 actions=output:1
838 OFPST_FLOW reply (OF1.1):
843 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2])
845 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1])
846 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
847 OFPST_FLOW reply (OF1.2):
852 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM])
854 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1])
855 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
861 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1])
863 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1])
864 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
865 OFPST_FLOW reply (OF1.1):
870 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2])
872 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1])
873 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
874 OFPST_FLOW reply (OF1.2):
879 AT_SETUP([ofproto - del flows with cookies])
881 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
882 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
883 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
884 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
885 cookie=0x1, in_port=1 actions=output:1
886 cookie=0x2, in_port=2 actions=output:1
887 cookie=0x3, in_port=3 actions=output:1
891 AT_CHECK([ovs-ofctl del-flows br0])
892 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
898 AT_SETUP([ofproto - del flows based on cookie])
900 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
901 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
902 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
903 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
904 cookie=0x1, in_port=1 actions=output:1
905 cookie=0x2, in_port=2 actions=output:1
906 cookie=0x3, in_port=3 actions=output:1
910 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1])
911 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
912 cookie=0x1, in_port=1 actions=output:1
913 cookie=0x2, in_port=2 actions=output:1
919 AT_SETUP([ofproto - del flows based on cookie mask])
921 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
922 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
923 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
924 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
925 cookie=0x1, in_port=1 actions=output:1
926 cookie=0x2, in_port=2 actions=output:1
927 cookie=0x3, in_port=3 actions=output:1
930 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
931 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
932 cookie=0x2, in_port=2 actions=output:1
938 AT_SETUP([ofproto - del flows based on table id (NXM)])
940 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
941 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
942 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
943 cookie=0x1, in_port=1 actions=output:1
944 cookie=0x2, table=1, in_port=2 actions=output:1
947 AT_CHECK([ovs-ofctl del-flows br0 table=0])
948 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
949 cookie=0x2, table=1, in_port=2 actions=output:1
952 AT_CHECK([ovs-ofctl del-flows br0 table=1])
953 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
956 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
957 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
958 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
959 cookie=0x1, in_port=1 actions=output:1
960 cookie=0x2, table=1, in_port=2 actions=output:1
963 AT_CHECK([ovs-ofctl del-flows br0])
964 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
970 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)])
972 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
973 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
974 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
975 cookie=0x1, in_port=1 actions=output:1
976 cookie=0x2, table=1, in_port=2 actions=output:1
977 OFPST_FLOW reply (OF1.1):
979 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0])
980 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
981 cookie=0x2, table=1, in_port=2 actions=output:1
982 OFPST_FLOW reply (OF1.1):
984 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1])
985 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
986 OFPST_FLOW reply (OF1.1):
988 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
989 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
990 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
991 cookie=0x1, in_port=1 actions=output:1
992 cookie=0x2, table=1, in_port=2 actions=output:1
993 OFPST_FLOW reply (OF1.1):
995 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
996 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
997 OFPST_FLOW reply (OF1.1):
998 cookie=0x2, table=1, in_port=2 actions=output:1
1003 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)])
1005 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1006 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1007 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1008 cookie=0x1, in_port=1 actions=output:1
1009 cookie=0x2, table=1, in_port=2 actions=output:1
1010 OFPST_FLOW reply (OF1.2):
1012 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0])
1013 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1014 cookie=0x2, table=1, in_port=2 actions=output:1
1015 OFPST_FLOW reply (OF1.2):
1017 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1])
1018 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1019 OFPST_FLOW reply (OF1.2):
1021 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1022 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1023 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1024 cookie=0x1, in_port=1 actions=output:1
1025 cookie=0x2, table=1, in_port=2 actions=output:1
1026 OFPST_FLOW reply (OF1.2):
1028 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
1029 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1030 OFPST_FLOW reply (OF1.2):
1035 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)])
1037 # Check the default configuration.
1038 (echo "OFPST_TABLE reply (xid=0x2): 254 tables
1039 0: classifier: wild=0x3fffff, max=1000000, active=0
1040 lookup=0, matched=0"
1042 while test $x -lt 254; do
1043 printf " %d: %-8s: wild=0x3fffff, max=1000000, active=0
1048 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1049 # Change the configuration.
1052 -- --id=@t0 create Flow_Table name=main \
1053 -- --id=@t1 create Flow_Table flow-limit=1024 \
1054 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1055 | ${PERL} $srcdir/uuidfilt.pl],
1059 # Check that the configuration was updated.
1060 mv expout orig-expout
1061 (echo "OFPST_TABLE reply (xid=0x2): 254 tables
1062 0: main : wild=0x3fffff, max=1000000, active=0
1064 1: table1 : wild=0x3fffff, max= 1024, active=0
1065 lookup=0, matched=0"
1066 tail -n +6 orig-expout) > expout
1067 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1071 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)])
1073 # Check the default configuration.
1074 (mid="wild=0xfffffffff, max=1000000,"
1077 match=0xfffffffff, instructions=0x00000007, config=0x00000003
1078 write_actions=0x00000000, apply_actions=0x00000000
1079 write_setfields=0x0000000fffffffff
1080 apply_setfields=0x0000000fffffffff
1081 metadata_match=0xffffffffffffffff
1082 metadata_write=0xffffffffffffffff"
1083 echo "OFPST_TABLE reply (OF1.2) (xid=0x2): 254 tables
1084 0: classifier: $mid active=0$tail"
1086 while test $x -lt 254; do
1087 printf " %d: %-8s: $mid active=0$tail
1091 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1092 # Change the configuration.
1095 -- --id=@t0 create Flow_Table name=main \
1096 -- --id=@t1 create Flow_Table flow-limit=1024 \
1097 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1098 | ${PERL} $srcdir/uuidfilt.pl],
1102 # Check that the configuration was updated.
1103 mv expout orig-expout
1104 (echo "OFPST_TABLE reply (OF1.2) (xid=0x2): 254 tables
1105 0: main : wild=0xfffffffff, max=1000000, active=0"
1106 tail -n +3 orig-expout | head -7
1107 echo " 1: table1 : wild=0xfffffffff, max= 1024, active=0"
1108 tail -n +11 orig-expout) > expout
1109 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1113 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)])
1115 # Configure a maximum of 4 flows.
1118 -- --id=@t0 create Flow_Table flow-limit=4 \
1119 -- set bridge br0 flow_tables:0=@t0 \
1120 | ${PERL} $srcdir/uuidfilt.pl],
1124 for in_port in 1 2 3 4; do
1125 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
1127 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1128 in_port=1 actions=drop
1129 in_port=2 actions=drop
1130 in_port=3 actions=drop
1131 in_port=4 actions=drop
1134 # Adding another flow will be refused.
1135 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1136 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1137 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1139 # Also a mod-flow that would add a flow will be refused.
1140 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
1141 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1142 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1144 # Replacing or modifying an existing flow is allowed.
1145 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1146 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1147 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1148 in_port=1 actions=drop
1149 in_port=2 actions=drop
1150 in_port=3 actions=output:1
1151 in_port=4 actions=NORMAL
1157 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)])
1159 # Configure a maximum of 4 flows.
1162 -- --id=@t0 create Flow_Table flow-limit=4 \
1163 -- set bridge br0 flow_tables:0=@t0 \
1164 | ${PERL} $srcdir/uuidfilt.pl],
1168 for in_port in 1 2 3 4; do
1169 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
1171 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1172 in_port=1 actions=drop
1173 in_port=2 actions=drop
1174 in_port=3 actions=drop
1175 in_port=4 actions=drop
1176 OFPST_FLOW reply (OF1.2):
1178 # Adding another flow will be refused.
1179 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1180 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1181 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1183 # Replacing or modifying an existing flow is allowed.
1184 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1185 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1186 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1187 in_port=1 actions=drop
1188 in_port=2 actions=drop
1189 in_port=3 actions=output:1
1190 in_port=4 actions=NORMAL
1191 OFPST_FLOW reply (OF1.2):
1196 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
1198 # Configure a maximum of 4 flows.
1201 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1202 -- set bridge br0 flow_tables:0=@t0 \
1203 | ${PERL} $srcdir/uuidfilt.pl],
1207 for in_port in 4 3 2 1; do
1208 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1210 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1211 idle_timeout=10, in_port=1 actions=drop
1212 idle_timeout=20, in_port=2 actions=drop
1213 idle_timeout=30, in_port=3 actions=drop
1214 idle_timeout=40, in_port=4 actions=drop
1217 # Adding another flow will cause the one that expires soonest to be evicted.
1218 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1219 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1220 idle_timeout=20, in_port=2 actions=drop
1221 idle_timeout=30, in_port=3 actions=drop
1222 idle_timeout=40, in_port=4 actions=drop
1223 in_port=5 actions=drop
1226 # A mod-flow that adds a flow also causes eviction, but replacing or
1227 # modifying an existing flow doesn't.
1228 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
1229 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1230 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1231 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1232 idle_timeout=30, in_port=3 actions=output:1
1233 in_port=4 actions=NORMAL
1234 in_port=5 actions=drop
1235 in_port=6 actions=drop
1238 # Flows with no timeouts at all cannot be evicted.
1239 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
1240 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1241 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1242 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1244 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1245 in_port=4 actions=NORMAL
1246 in_port=5 actions=drop
1247 in_port=6 actions=drop
1248 in_port=7 actions=NORMAL
1254 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
1256 # Configure a maximum of 4 flows.
1259 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1260 -- set bridge br0 flow_tables:0=@t0 \
1261 | ${PERL} $srcdir/uuidfilt.pl],
1265 for in_port in 4 3 2 1; do
1266 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1268 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1269 idle_timeout=10, in_port=1 actions=drop
1270 idle_timeout=20, in_port=2 actions=drop
1271 idle_timeout=30, in_port=3 actions=drop
1272 idle_timeout=40, in_port=4 actions=drop
1273 OFPST_FLOW reply (OF1.2):
1275 # Adding another flow will cause the one that expires soonest to be evicted.
1276 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
1277 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1278 idle_timeout=20, in_port=2 actions=drop
1279 idle_timeout=30, in_port=3 actions=drop
1280 idle_timeout=40, in_port=4 actions=drop
1281 in_port=5 actions=drop
1282 OFPST_FLOW reply (OF1.2):
1284 # In Open Flow 1.2 a mod-flow does not ever add a flow and thus
1285 # has no effect on eviction
1286 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
1287 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1288 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1289 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1290 idle_timeout=20, in_port=2 actions=drop
1291 idle_timeout=30, in_port=3 actions=output:1
1292 in_port=4 actions=NORMAL
1293 in_port=5 actions=drop
1294 OFPST_FLOW reply (OF1.2):
1296 # Flows with no timeouts at all cannot be evicted.
1297 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
1298 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
1299 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1300 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1301 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1303 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1304 in_port=4 actions=NORMAL
1305 in_port=5 actions=drop
1306 in_port=6 actions=drop
1307 in_port=7 actions=NORMAL
1308 OFPST_FLOW reply (OF1.2):
1313 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
1315 # Configure a maximum of 4 flows.
1318 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1319 overflow-policy=evict \
1320 groups='"NXM_OF_IN_PORT[[]]"' \
1321 -- set bridge br0 flow_tables:0=@t0 \
1322 | ${PERL} $srcdir/uuidfilt.pl],
1326 ovs-ofctl add-flows br0 - <<EOF
1327 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1328 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1329 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1330 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1332 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1333 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1334 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1335 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1336 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1339 # Adding another flow will cause the one that expires soonest within
1340 # the largest group (those with in_port=1) to be evicted. In this
1341 # case this is not the same as the one that expires soonest overall
1342 # (which is what makes the test interesting):
1343 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1344 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1345 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1346 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1347 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1348 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1351 # Enlarge the flow limit, change the eviction policy back to strictly
1352 # based on expiration, and and add some flows.
1353 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1354 ovs-ofctl add-flows br0 - <<EOF
1355 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1356 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1357 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1359 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1360 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1361 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1362 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1363 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1364 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1365 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1366 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1369 # Adding another flow will cause the one that expires soonest overall
1371 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
1372 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1373 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1374 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1375 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1376 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1377 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1378 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1379 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1382 # Reducing the flow limit also causes the flows that expire soonest
1383 # overall to be evicted.
1384 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1385 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1386 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1387 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1388 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1389 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1395 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
1397 # Configure a maximum of 4 flows.
1400 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1401 overflow-policy=evict \
1402 groups='"NXM_OF_IN_PORT[[]]"' \
1403 -- set bridge br0 flow_tables:0=@t0 \
1404 | ${PERL} $srcdir/uuidfilt.pl],
1408 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1409 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1410 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1411 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1412 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1414 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1415 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1416 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1417 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1418 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1419 OFPST_FLOW reply (OF1.2):
1421 # Adding another flow will cause the one that expires soonest within
1422 # the largest group (those with in_port=1) to be evicted. In this
1423 # case this is not the same as the one that expires soonest overall
1424 # (which is what makes the test interesting):
1425 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1426 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1427 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1428 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1429 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1430 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1431 OFPST_FLOW reply (OF1.2):
1433 # Enlarge the flow limit, change the eviction policy back to strictly
1434 # based on expiration, and and add some flows.
1435 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1436 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1437 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1438 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1439 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1441 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1442 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1443 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1444 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1445 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1446 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1447 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1448 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1449 OFPST_FLOW reply (OF1.2):
1451 # Adding another flow will cause the one that expires soonest overall
1453 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'])
1454 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1455 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1456 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1457 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1458 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1459 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1460 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1461 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1462 OFPST_FLOW reply (OF1.2):
1464 # Reducing the flow limit also causes the flows that expire soonest
1465 # overall to be evicted.
1466 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1467 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1468 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1469 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1470 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1471 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1472 OFPST_FLOW reply (OF1.2):
1477 AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout])
1479 # Configure a maximum of 4 flows.
1482 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1483 -- set bridge br0 flow_tables:0=@t0 \
1484 | ${PERL} $srcdir/uuidfilt.pl],
1487 ovs-appctl time/stop
1489 for in_port in 4 3 2 1; do
1490 ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
1492 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1493 hard_timeout=13, in_port=1 actions=drop
1494 hard_timeout=16, in_port=2 actions=drop
1495 hard_timeout=19, in_port=3 actions=drop
1496 hard_timeout=22, in_port=4 actions=drop
1499 # Sleep and modify the one that expires soonest
1500 ovs-appctl time/warp 5000
1501 AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop])
1502 # At this point the table would looks like:
1503 # in_port seconds to expire
1508 ovs-appctl time/warp 2000
1509 # Adding another flow will cause the one that expires soonest to be evicted.
1510 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1511 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1512 hard_timeout=13, in_port=1 actions=drop
1513 hard_timeout=19, in_port=3 actions=drop
1514 hard_timeout=22, in_port=4 actions=drop
1515 in_port=5 actions=drop
1521 AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout])
1522 OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1])
1523 # Configure a maximum of 4 flows.
1526 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1527 -- set bridge br0 flow_tables:0=@t0 \
1528 | ${PERL} $srcdir/uuidfilt.pl],
1532 for in_port in 4 3 2 1; do
1533 ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
1535 ovs-appctl time/stop
1536 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1537 idle_timeout=13, in_port=1 actions=drop
1538 idle_timeout=16, in_port=2 actions=drop
1539 idle_timeout=19, in_port=3 actions=drop
1540 idle_timeout=22, in_port=4 actions=drop
1543 # Sleep and receive on the flow that expires soonest
1544 ovs-appctl time/warp 5000
1545 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)'])
1546 # At this point the table would looks like:
1547 # in_port seconds to expire
1552 ovs-appctl time/warp 2000
1553 # Adding another flow will cause the one that expires soonest to be evicted.
1554 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1555 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1556 idle_timeout=19, in_port=3 actions=drop
1557 idle_timeout=22, in_port=4 actions=drop
1558 in_port=5 actions=drop
1559 n_packets=1, n_bytes=60, idle_timeout=13, in_port=1 actions=drop
1565 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
1567 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
1569 printf '\n\n--- check_async %d ---\n\n\n' $1
1572 ovs-appctl -t ovs-ofctl ofctl/barrier
1573 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1576 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1577 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
1578 if test X"$1" = X"OFPR_ACTION"; then shift;
1579 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
1580 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1583 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1584 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1585 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1586 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
1587 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1590 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1591 ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1592 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1593 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
1594 udp,metadata=0,in_port=0,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"
1597 # OFPT_PORT_STATUS, OFPPR_ADD
1598 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
1599 if test X"$1" = X"OFPPR_ADD"; then shift;
1600 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
1603 speed: 0 Mbps now, 0 Mbps max"
1606 # OFPT_PORT_STATUS, OFPPR_DELETE
1607 ovs-vsctl del-port br0 test
1608 if test X"$1" = X"OFPPR_DELETE"; then shift;
1609 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
1612 speed: 0 Mbps now, 0 Mbps max"
1615 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1616 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
1617 ovs-ofctl --strict del-flows br0 ''
1618 if test X"$1" = X"OFPRR_DELETE"; then shift;
1619 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
1621 AT_FAIL_IF([test X"$1" != X])
1623 ovs-appctl -t ovs-ofctl ofctl/barrier
1624 echo >>expout "OFPT_BARRIER_REPLY:"
1628 s/ (xid=0x[0-9a-fA-F]*)//
1630 s/00:0.$/00:0x/' < monitor.log]],
1634 # It's a service connection so initially there should be no async messages.
1637 # Set miss_send_len to 128, turning on packet-ins for our service connection.
1638 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
1639 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1641 # Set miss_send_len to 128 and enable invalid_ttl.
1642 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
1643 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1645 # Become slave, which should disable everything except port status.
1646 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
1647 check_async 4 OFPPR_ADD OFPPR_DELETE
1649 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
1650 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
1651 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1653 # Set controller ID 123.
1654 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
1655 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1657 # Restore controller ID 0.
1658 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
1661 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
1662 check_async 7 OFPR_ACTION OFPPR_ADD
1664 ovs-appctl -t ovs-ofctl exit
1668 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
1670 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
1672 printf '\n\n--- check_async %d ---\n\n\n' $1
1676 ovs-appctl -t ovs-ofctl ofctl/barrier
1677 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1680 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1681 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
1682 if test X"$1" = X"OFPR_ACTION"; then shift;
1683 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
1684 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1687 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1688 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1689 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1690 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
1691 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1694 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1695 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1696 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1697 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
1698 udp,metadata=0,in_port=0,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"
1701 # OFPT_PORT_STATUS, OFPPR_ADD
1702 ovs-vsctl add-port br0 test -- set Interface test type=dummy
1703 if test X"$1" = X"OFPPR_ADD"; then shift;
1704 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1707 speed: 0 Mbps now, 0 Mbps max"
1710 # OFPT_PORT_STATUS, OFPPR_DELETE
1711 ovs-vsctl del-port br0 test
1712 if test X"$1" = X"OFPPR_DELETE"; then shift;
1713 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1716 speed: 0 Mbps now, 0 Mbps max"
1719 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1720 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
1721 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
1722 if test X"$1" = X"OFPRR_DELETE"; then shift;
1723 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
1725 AT_FAIL_IF([test X"$1" != X])
1727 ovs-appctl -t ovs-ofctl ofctl/barrier
1728 echo >>expout "OFPT_BARRIER_REPLY (OF1.2):"
1732 s/ (xid=0x[0-9a-fA-F]*)//
1734 s/00:0.$/00:0x/' < monitor.log]],
1738 # It's a service connection so initially there should be no async messages.
1741 # Set miss_send_len to 128, turning on packet-ins for our service connection.
1742 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
1743 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1745 # Set miss_send_len to 128 and enable invalid_ttl.
1746 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
1747 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1749 # Become slave (OF 1.2), which should disable everything except port status.
1750 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
1751 check_async 4 OFPPR_ADD OFPPR_DELETE
1753 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
1754 ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
1755 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1757 # Set controller ID 123.
1758 ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
1759 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1761 # Restore controller ID 0.
1762 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
1764 # Become master (OF 1.2).
1765 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
1766 check_async 7 OFPR_ACTION OFPPR_ADD
1768 ovs-appctl -t ovs-ofctl exit
1772 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
1774 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
1776 printf '\n\n--- check_async %d ---\n\n\n' $1
1780 ovs-appctl -t ovs-ofctl ofctl/barrier
1781 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1784 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1785 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
1786 if test X"$1" = X"OFPR_ACTION"; then shift;
1787 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
1788 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1791 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1792 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1793 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1794 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
1795 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1798 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1799 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1800 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1801 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
1802 udp,metadata=0,in_port=0,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"
1805 # OFPT_PORT_STATUS, OFPPR_ADD
1806 ovs-vsctl add-port br0 test -- set Interface test type=dummy
1807 if test X"$1" = X"OFPPR_ADD"; then shift;
1808 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1811 speed: 0 Mbps now, 0 Mbps max"
1814 # OFPT_PORT_STATUS, OFPPR_DELETE
1815 ovs-vsctl del-port br0 test
1816 if test X"$1" = X"OFPPR_DELETE"; then shift;
1817 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1820 speed: 0 Mbps now, 0 Mbps max"
1823 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1824 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
1825 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
1826 if test X"$1" = X"OFPRR_DELETE"; then shift;
1827 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
1829 AT_FAIL_IF([test X"$1" != X])
1831 ovs-appctl -t ovs-ofctl ofctl/barrier
1832 echo >>expout "OFPT_BARRIER_REPLY (OF1.3):"
1836 s/ (xid=0x[0-9a-fA-F]*)//
1838 s/00:0.$/00:0x/' < monitor.log]],
1842 # It's a service connection so initially there should be no async messages.
1845 # Set miss_send_len to 128, turning on packet-ins for our service connection.
1846 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
1847 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1849 # Become slave (OF 1.3), which should disable everything except port status.
1850 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
1851 check_async 3 OFPPR_ADD OFPPR_DELETE
1853 # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
1854 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005
1855 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1857 # Set controller ID 123.
1858 ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
1859 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1861 # Restore controller ID 0.
1862 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
1864 # Become master (OF 1.3).
1865 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
1866 check_async 6 OFPR_ACTION OFPPR_ADD
1868 ovs-appctl -t ovs-ofctl exit
1872 dnl This test checks that the role request/response messaging works
1873 dnl and that generation_id is handled properly.
1874 AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
1876 ON_EXIT([kill `cat c1.pid c2.pid`])
1878 # Start two ovs-ofctl controller processes.
1879 AT_CAPTURE_FILE([monitor1.log])
1880 AT_CAPTURE_FILE([expout1])
1881 AT_CAPTURE_FILE([experr1])
1882 AT_CAPTURE_FILE([monitor2.log])
1883 AT_CAPTURE_FILE([expout2])
1884 AT_CAPTURE_FILE([experr2])
1886 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
1887 ovs-appctl -t `pwd`/c$i ofctl/barrier
1888 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
1892 # find out current role
1893 ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000
1894 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange"
1895 echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
1898 # controller 1: Become slave (generation_id is initially undefined, so
1899 # 2^63+2 should not be stale)
1900 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
1901 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
1902 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
1904 # controller 2: Become master.
1905 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
1906 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
1907 echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
1909 # controller 1: Try to become the master using a stale generation ID
1910 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
1911 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
1912 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
1913 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
1915 # controller 1: Become master using a valid generation ID
1916 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
1917 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
1918 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
1921 ovs-appctl -t `pwd`/c$i ofctl/barrier
1922 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):"
1928 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
1930 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
1935 dnl This test checks that the role request/response messaging works,
1936 dnl that generation_id is handled properly, and that role status update
1937 dnl messages are sent when a controller's role gets changed from master
1939 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
1941 ON_EXIT([kill `cat c1.pid c2.pid`])
1943 # Start two ovs-ofctl controller processes.
1944 AT_CAPTURE_FILE([monitor1.log])
1945 AT_CAPTURE_FILE([expout1])
1946 AT_CAPTURE_FILE([experr1])
1947 AT_CAPTURE_FILE([monitor2.log])
1948 AT_CAPTURE_FILE([expout2])
1949 AT_CAPTURE_FILE([experr2])
1951 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
1952 ovs-appctl -t `pwd`/c$i ofctl/barrier
1953 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
1957 # find out current role
1958 ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000
1959 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange"
1960 echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
1963 # controller 1: Become slave (generation_id is initially undefined, so
1964 # 2^63+2 should not be stale)
1965 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
1966 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
1967 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
1969 # controller 2: Become master.
1970 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
1971 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
1972 echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
1974 # controller 1: Try to become the master using a stale generation ID
1975 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
1976 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
1977 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
1978 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
1980 # controller 1: Become master using a valid generation ID
1981 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
1982 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
1983 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
1984 echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
1987 ovs-appctl -t `pwd`/c$i ofctl/barrier
1988 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):"
1994 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
1996 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2001 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2002 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
2003 dnl controllers despite the spec) as meaning a packet that was generated
2004 dnl by the controller.
2005 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
2007 ADD_OF_PORTS([br0], [1])
2009 # Start a monitor listening for packet-ins.
2010 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
2011 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2012 ovs-appctl -t ovs-ofctl ofctl/barrier
2013 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2014 AT_CAPTURE_FILE([monitor.log])
2016 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2017 AT_CHECK([ovs-ofctl packet-out br0 none controller,1 '0001020304050010203040501234'])
2018 AT_CHECK([ovs-ofctl packet-out br0 controller controller,1 '0001020304050010203040505678'])
2020 # Stop the monitor and check its output.
2021 ovs-appctl -t ovs-ofctl ofctl/barrier
2022 ovs-appctl -t ovs-ofctl exit
2024 ovs-ofctl dump-ports br0
2026 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2027 OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2028 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2029 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2030 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
2037 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2038 dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
2039 dnl controllers despite the spec) as meaning a packet that was generated
2040 dnl by the controller.
2041 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
2044 # Start a monitor listening for packet-ins.
2045 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2046 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2047 ovs-appctl -t ovs-ofctl ofctl/barrier
2048 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2049 AT_CAPTURE_FILE([monitor.log])
2051 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2052 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
2053 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
2055 # Stop the monitor and check its output.
2056 ovs-appctl -t ovs-ofctl ofctl/barrier
2057 ovs-appctl -t ovs-ofctl exit
2059 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2060 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2061 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2062 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2063 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
2064 OFPT_BARRIER_REPLY (OF1.2):
2070 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2071 dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some
2072 dnl controllers despite the spec) as meaning a packet that was generated
2073 dnl by the controller.
2074 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)])
2077 # Start a monitor listening for packet-ins.
2078 AT_CHECK([ovs-ofctl -O OpenFlow11 monitor br0 --detach --no-chdir --pidfile])
2079 ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080
2080 ovs-appctl -t ovs-ofctl ofctl/barrier
2081 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2082 AT_CAPTURE_FILE([monitor.log])
2084 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2085 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 none controller '0001020304050010203040501234'])
2086 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 4294967293 controller '0001020304050010203040505678'])
2088 # Stop the monitor and check its output.
2089 ovs-appctl -t ovs-ofctl ofctl/barrier
2090 ovs-appctl -t ovs-ofctl exit
2092 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2093 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2094 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2095 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2096 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
2097 OFPT_BARRIER_REPLY (OF1.1):
2103 dnl This test checks that metadata is encoded in packet_in structures,
2104 dnl supported by NXAST.
2105 AT_SETUP([ofproto - packet-out with metadata (NXM)])
2108 # Start a monitor listening for packet-ins.
2109 AT_CHECK([ovs-ofctl -P nxm monitor br0 --detach --no-chdir --pidfile])
2110 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2111 ovs-appctl -t ovs-ofctl ofctl/barrier
2112 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2113 AT_CAPTURE_FILE([monitor.log])
2115 # Send a packet-out with a load action to set some metadata, and forward to controller
2116 AT_CHECK([ovs-ofctl packet-out br0 controller 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), load(0xaa->NXM_NX_PKT_MARK[[]]), controller' '0001020304050010203040501234'])
2118 # Stop the monitor and check its output.
2119 ovs-appctl -t ovs-ofctl ofctl/barrier
2120 ovs-appctl -t ovs-ofctl exit
2122 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2123 NXT_PACKET_IN: total_len=14 in_port=CONTROLLER metadata=0xfafafafa5a5a5a5a pkt_mark=0xaa (via action) data_len=14 (unbuffered)
2124 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2131 dnl This test checks that metadata is encoded in packet_in structures,
2132 dnl supported by NXAST.
2133 AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
2136 # Start a monitor listening for packet-ins.
2137 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2138 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2139 ovs-appctl -t ovs-ofctl ofctl/barrier
2140 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2141 AT_CAPTURE_FILE([monitor.log])
2143 # Send a packet-out with a load action to set some metadata, and forward to controller
2144 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), controller' '0001020304050010203040501234'])
2146 # Stop the monitor and check its output.
2147 ovs-appctl -t ovs-ofctl ofctl/barrier
2148 ovs-appctl -t ovs-ofctl exit
2150 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2151 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY metadata=0xfafafafa5a5a5a5a (via action) data_len=14 (unbuffered)
2152 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2153 OFPT_BARRIER_REPLY (OF1.2):
2159 dnl This test checks that tunnel metadata is encoded in packet_in structures.
2160 AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
2163 # Start a monitor listening for packet-ins.
2164 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2165 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
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 # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
2171 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'])
2173 # Stop the monitor and check its output.
2174 ovs-appctl -t ovs-ofctl ofctl/barrier
2175 ovs-appctl -t ovs-ofctl exit
2177 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2178 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY tun_id=0x1020304 tun_src=127.0.0.1 tun_dst=192.168.0.1 (via action) data_len=14 (unbuffered)
2179 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2180 OFPT_BARRIER_REPLY (OF1.2):
2186 AT_SETUP([ofproto - flow monitoring])
2187 AT_KEYWORDS([monitor])
2190 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
2192 # Start a monitor watching the flow table and check the initial reply.
2193 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
2194 AT_CAPTURE_FILE([monitor.log])
2195 ovs-appctl -t ovs-ofctl ofctl/barrier
2196 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2197 [NXST_FLOW_MONITOR reply:
2198 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
2202 # Add, delete, and modify some flows and check the updates.
2203 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2204 ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
2205 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
2206 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
2207 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
2208 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
2209 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
2210 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
2211 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
2212 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
2213 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
2214 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
2215 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
2216 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
2217 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
2218 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
2219 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
2220 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
2221 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
2222 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
2223 ovs-ofctl add-flow br0 in_port=0,actions=output:23
2224 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
2225 ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
2226 ovs-ofctl del-flows br0 dl_vlan=123
2227 ovs-ofctl del-flows br0
2228 ovs-appctl -t ovs-ofctl ofctl/barrier
2230 # Sorts groups of lines that start with a space, without moving them
2231 # past the nearest line that does not start with a space.
2239 print $_ foreach sort(@buffer);
2244 print $_ foreach sort(@buffer);
2246 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | ${PERL} -e "$sort"], [0],
2247 [NXST_FLOW_MONITOR reply (xid=0x0):
2248 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
2249 NXST_FLOW_MONITOR reply (xid=0x0):
2250 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
2251 NXST_FLOW_MONITOR reply (xid=0x0):
2252 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
2253 NXST_FLOW_MONITOR reply (xid=0x0):
2254 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
2255 NXST_FLOW_MONITOR reply (xid=0x0):
2256 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
2257 NXST_FLOW_MONITOR reply (xid=0x0):
2258 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
2259 NXST_FLOW_MONITOR reply (xid=0x0):
2260 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
2261 NXST_FLOW_MONITOR reply (xid=0x0):
2262 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2263 NXST_FLOW_MONITOR reply (xid=0x0):
2264 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
2265 NXST_FLOW_MONITOR reply (xid=0x0):
2266 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
2267 NXST_FLOW_MONITOR reply (xid=0x0):
2268 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
2269 NXST_FLOW_MONITOR reply (xid=0x0):
2270 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
2271 NXST_FLOW_MONITOR reply (xid=0x0):
2272 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
2273 NXST_FLOW_MONITOR reply (xid=0x0):
2274 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
2275 NXST_FLOW_MONITOR reply (xid=0x0):
2276 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
2277 NXST_FLOW_MONITOR reply (xid=0x0):
2278 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2279 NXST_FLOW_MONITOR reply (xid=0x0):
2280 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
2281 NXST_FLOW_MONITOR reply (xid=0x0):
2282 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
2283 NXST_FLOW_MONITOR reply (xid=0x0):
2284 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
2285 NXST_FLOW_MONITOR reply (xid=0x0):
2286 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
2287 NXST_FLOW_MONITOR reply (xid=0x0):
2288 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
2289 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2290 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2291 NXST_FLOW_MONITOR reply (xid=0x0):
2292 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
2293 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2294 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2295 NXST_FLOW_MONITOR reply (xid=0x0):
2296 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
2297 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2298 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2299 NXST_FLOW_MONITOR reply (xid=0x0):
2300 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
2301 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
2302 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
2303 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2304 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
2305 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
2306 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
2307 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
2308 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
2309 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
2310 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2314 # Check that our own changes are reported as abbreviations.
2315 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2316 ovs-ofctl add-flow br0 in_port=1,actions=output:2
2317 ovs-ofctl add-flow br0 in_port=2,actions=output:1
2318 ovs-appctl -t ovs-ofctl ofctl/barrier
2319 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
2320 ovs-appctl -t ovs-ofctl ofctl/barrier
2321 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
2323 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2324 [NXST_FLOW_MONITOR reply (xid=0x0):
2325 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
2326 NXST_FLOW_MONITOR reply (xid=0x0):
2327 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
2329 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
2330 NXST_FLOW_MONITOR reply (xid=0x0):
2331 event=ABBREV xid=0x12345678
2335 ovs-appctl -t ovs-ofctl exit
2339 AT_SETUP([ofproto - flow monitoring pause and resume])
2340 AT_KEYWORDS([monitor])
2342 # The maximum socket receive buffer size is important for this test, which
2343 # tests behavior when the receive buffer overflows.
2344 if test -e /proc/sys/net/core/rmem_max; then
2346 rmem_max=`cat /proc/sys/net/core/rmem_max`
2347 elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
2350 # Don't know how to get maximum socket receive buffer on this OS
2353 # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
2354 # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
2355 queue_size=`expr $rmem_max + 128 \* 1024`
2356 echo rmem_max=$rmem_max queue_size=$queue_size
2358 # If there's too much queuing skip the test to avoid timing out.
2359 AT_SKIP_IF([test $rmem_max -gt 1048576])
2361 # Each flow update message takes up at least 48 bytes of space in queues
2362 # and in practice more than that.
2363 n_msgs=`expr $queue_size / 48`
2368 # Start a monitor watching the flow table, then make it block.
2369 ON_EXIT([kill `cat ovs-ofctl.pid`])
2370 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
2371 AT_CAPTURE_FILE([monitor.log])
2372 ovs-appctl -t ovs-ofctl ofctl/block
2374 # Add $n_msgs flows.
2375 (echo "in_port=2,actions=output:2"
2377 for ($i = 0; $i < '$n_msgs'; $i++) {
2378 print "cookie=1,reg1=$i,actions=drop\n";
2381 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2382 # Check that multipart flow dumps work properly:
2383 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
2384 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
2385 AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
2386 AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
2388 ovs-appctl -t ovs-ofctl ofctl/unblock
2390 # Wait for the connection resumed.
2391 # A barrier doesn't work for this purpose.
2392 # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html
2393 # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html
2394 OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log])
2396 ovs-appctl -t ovs-ofctl exit
2398 # Check that the flow monitor reported the same number of flows
2399 # added and deleted, but fewer than we actually added and deleted.
2400 adds=`grep -c 'ADDED.*reg1=' monitor.log`
2401 deletes=`grep -c 'DELETED.*reg1=' monitor.log`
2402 echo adds=$adds deletes=$deletes
2403 AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
2404 AT_CHECK([test $adds = $deletes])
2406 # Check that the flow monitor reported everything in the expected order:
2408 # event=ADDED table=0 cookie=0x1 reg1=0x22
2410 # NXT_FLOW_MONITOR_PAUSED:
2412 # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2414 # event=ADDED table=0 cookie=0x3 in_port=1
2415 # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
2416 # NXT_FLOW_MONITOR_RESUMED:
2418 # except that, between the PAUSED and RESUMED, the order of the ADDED
2419 # and MODIFIED lines lines depends on hash order, that is, it varies
2420 # as we change the hash function or change architecture. Therefore,
2421 # we use a couple of tests below to accept both orders.
2422 AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
2425 /NXT_FLOW_MONITOR_PAUSED:/p
2426 /NXT_FLOW_MONITOR_RESUMED:/p
2427 ' > monitor.log.subset])
2428 AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
2429 event=ADDED table=0 cookie=0x1 reg1=0x22
2430 NXT_FLOW_MONITOR_PAUSED:
2431 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2432 event=ADDED table=0 cookie=0x3 in_port=1
2433 NXT_FLOW_MONITOR_RESUMED:
2435 AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
2436 NXT_FLOW_MONITOR_PAUSED:
2437 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2438 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
2439 NXT_FLOW_MONITOR_RESUMED:
2445 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
2446 AT_KEYWORDS([monitor])
2449 # Start a monitor, use the required protocol version
2450 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2451 AT_CAPTURE_FILE([monitor.log])
2453 # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a)
2454 ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a
2455 ovs-appctl -t ovs-ofctl ofctl/barrier
2457 # Check default setting
2458 read -r -d '' expected <<'EOF'
2461 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
2462 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
2463 OFPT_GET_ASYNC_REPLY (OF1.3):
2465 PACKET_IN: no_match action
2466 PORT_STATUS: add delete modify
2467 FLOW_REMOVED: idle hard delete
2471 PORT_STATUS: add delete modify
2473 OFPT_BARRIER_REPLY (OF1.3):
2479 AT_SETUP([ofproto - ofport_request])
2481 ADD_OF_PORTS([br0], [1], [2], [3])
2483 set_and_check_specific_ofports () {
2484 ovs-vsctl set Interface p1 ofport_request="$1" -- \
2485 set Interface p2 ofport_request="$2" -- \
2486 set Interface p3 ofport_request="$3"
2487 ofports=`ovs-vsctl get Interface p1 ofport -- \
2488 get Interface p2 ofport -- \
2489 get Interface p3 ofport`
2490 AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
2493 for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
2494 for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
2495 echo -----------------------------------------------------------
2496 echo "Check changing port numbers from $pre to $post"
2497 set_and_check_ofports $pre
2498 set_and_check_ofports $post
2502 ovs-vsctl del-port p3
2504 set_and_check_poorly_specified_ofports () {
2505 ovs-vsctl set Interface p1 ofport_request="$1" -- \
2506 set Interface p2 ofport_request="$2"
2507 p1=`ovs-vsctl get Interface p1 ofport`
2508 p2=`ovs-vsctl get Interface p2 ofport`
2511 AT_CHECK([test "$p1" != "$p2"])
2512 if test "$1" = "$2" && test "$1" != '[[]]'; then
2513 # One port number must be the requested one.
2514 AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
2515 # The other port number must be different (already tested above).
2517 AT_CHECK([test "$1" = '[[]]' || test "$p1" == "$1"])
2518 AT_CHECK([test "$2" = '[[]]' || test "$p2" == "$2"])
2521 for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
2523 for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
2525 echo -----------------------------------------------------------
2526 echo "Check changing port numbers from $pre to $post"
2527 set_and_check_poorly_specified_ofports $pre
2528 set_and_check_poorly_specified_ofports $post
2535 AT_SETUP([ofproto - bundles, open (OpenFlow 1.4)])
2536 AT_KEYWORDS([monitor])
2539 # Start a monitor, use the required protocol version
2540 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2541 AT_CAPTURE_FILE([monitor.log])
2543 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
2544 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2545 ovs-appctl -t ovs-ofctl ofctl/barrier
2546 ovs-appctl -t ovs-ofctl exit
2548 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
2549 send: OFPT_BUNDLE_CONTROL (OF1.4):
2550 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2551 OFPT_BUNDLE_CONTROL (OF1.4):
2552 bundle_id=0x1 type=OPEN_REPLY flags=0
2553 OFPT_BARRIER_REPLY (OF1.4):
2559 AT_SETUP([ofproto - bundles, double open (OpenFlow 1.4)])
2560 AT_KEYWORDS([monitor])
2563 # Start a monitor, use the required protocol version
2564 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2565 AT_CAPTURE_FILE([monitor.log])
2567 # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
2568 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2569 ovs-appctl -t ovs-ofctl ofctl/barrier
2570 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2571 ovs-appctl -t ovs-ofctl ofctl/barrier
2572 ovs-appctl -t ovs-ofctl exit
2574 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2575 send: OFPT_BUNDLE_CONTROL (OF1.4):
2576 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2577 OFPT_BUNDLE_CONTROL (OF1.4):
2578 bundle_id=0x1 type=OPEN_REPLY flags=0
2579 OFPT_BARRIER_REPLY (OF1.4):
2580 send: OFPT_BUNDLE_CONTROL (OF1.4):
2581 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2582 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
2583 OFPT_BUNDLE_CONTROL (OF1.4):
2584 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2585 OFPT_BARRIER_REPLY (OF1.4):
2591 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)])
2592 AT_KEYWORDS([monitor])
2595 # Start a monitor, use the required protocol version
2596 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2597 AT_CAPTURE_FILE([monitor.log])
2599 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
2600 ovs-appctl -t ovs-ofctl ofctl/barrier
2601 ovs-appctl -t ovs-ofctl exit
2603 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2604 send: OFPT_BUNDLE_CONTROL (OF1.4):
2605 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2606 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
2607 OFPT_BUNDLE_CONTROL (OF1.4):
2608 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2609 OFPT_BARRIER_REPLY (OF1.4):
2615 AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)])
2616 AT_KEYWORDS([monitor])
2619 # Start a monitor, use the required protocol version
2620 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2621 AT_CAPTURE_FILE([monitor.log])
2623 # Open, Close, Close
2624 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2625 ovs-appctl -t ovs-ofctl ofctl/barrier
2626 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
2627 ovs-appctl -t ovs-ofctl ofctl/barrier
2628 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
2629 ovs-appctl -t ovs-ofctl ofctl/barrier
2630 ovs-appctl -t ovs-ofctl exit
2632 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2633 send: OFPT_BUNDLE_CONTROL (OF1.4):
2634 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2635 OFPT_BUNDLE_CONTROL (OF1.4):
2636 bundle_id=0x1 type=OPEN_REPLY flags=0
2637 OFPT_BARRIER_REPLY (OF1.4):
2638 send: OFPT_BUNDLE_CONTROL (OF1.4):
2639 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2640 OFPT_BUNDLE_CONTROL (OF1.4):
2641 bundle_id=0x1 type=CLOSE_REPLY flags=0
2642 OFPT_BARRIER_REPLY (OF1.4):
2643 send: OFPT_BUNDLE_CONTROL (OF1.4):
2644 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2645 OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED
2646 OFPT_BUNDLE_CONTROL (OF1.4):
2647 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2648 OFPT_BARRIER_REPLY (OF1.4):
2654 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)])
2655 AT_KEYWORDS([monitor])
2658 # Start a monitor, use the required protocol version
2659 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2660 AT_CAPTURE_FILE([monitor.log])
2662 # Open, Close, Close
2663 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2664 ovs-appctl -t ovs-ofctl ofctl/barrier
2665 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
2666 ovs-appctl -t ovs-ofctl ofctl/barrier
2667 ovs-appctl -t ovs-ofctl exit
2669 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2670 send: OFPT_BUNDLE_CONTROL (OF1.4):
2671 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2672 OFPT_BUNDLE_CONTROL (OF1.4):
2673 bundle_id=0x1 type=OPEN_REPLY flags=0
2674 OFPT_BARRIER_REPLY (OF1.4):
2675 send: OFPT_BUNDLE_CONTROL (OF1.4):
2676 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
2677 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
2678 OFPT_BUNDLE_CONTROL (OF1.4):
2679 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
2680 OFPT_BARRIER_REPLY (OF1.4):
2686 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)])
2687 AT_KEYWORDS([monitor])
2690 # Start a monitor, use the required protocol version
2691 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2692 AT_CAPTURE_FILE([monitor.log])
2694 # Open, Close, Close
2695 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01"
2696 ovs-appctl -t ovs-ofctl ofctl/barrier
2697 ovs-appctl -t ovs-ofctl exit
2699 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2700 send: OFPT_BUNDLE_CONTROL (OF1.4):
2701 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
2702 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
2703 OFPT_BUNDLE_CONTROL (OF1.4):
2704 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
2705 OFPT_BARRIER_REPLY (OF1.4):
2711 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)])
2712 AT_KEYWORDS([monitor])
2715 # Start a monitor, use the required protocol version
2716 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2717 AT_CAPTURE_FILE([monitor.log])
2719 # Open, Close, Close
2720 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2721 ovs-appctl -t ovs-ofctl ofctl/barrier
2722 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02"
2723 ovs-appctl -t ovs-ofctl ofctl/barrier
2724 ovs-appctl -t ovs-ofctl exit
2726 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2727 send: OFPT_BUNDLE_CONTROL (OF1.4):
2728 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2729 OFPT_BUNDLE_CONTROL (OF1.4):
2730 bundle_id=0x1 type=OPEN_REPLY flags=0
2731 OFPT_BARRIER_REPLY (OF1.4):
2732 send: OFPT_BUNDLE_CONTROL (OF1.4):
2733 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
2734 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
2735 OFPT_BUNDLE_CONTROL (OF1.4):
2736 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
2737 OFPT_BARRIER_REPLY (OF1.4):
2743 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)])
2744 AT_KEYWORDS([monitor])
2747 # Start a monitor, use the required protocol version
2748 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2749 AT_CAPTURE_FILE([monitor.log])
2751 # Open, Close, Close
2752 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 01"
2753 ovs-appctl -t ovs-ofctl ofctl/barrier
2754 ovs-appctl -t ovs-ofctl exit
2756 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2757 send: OFPT_BUNDLE_CONTROL (OF1.4):
2758 bundle_id=0x1 type=DISCARD_REQUEST flags=atomic
2759 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
2760 OFPT_BUNDLE_CONTROL (OF1.4):
2761 bundle_id=0x1 type=DISCARD_REQUEST flags=atomic
2762 OFPT_BARRIER_REPLY (OF1.4):