3 AT_SETUP([ofproto - echo request])
5 AT_CHECK([ovs-ofctl -vwarn probe br0])
9 AT_SETUP([ofproto - handling messages with bad version])
12 # Start a monitor running OpenFlow 1.0, then send the switch an OF1.1 features
14 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
15 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
16 AT_CAPTURE_FILE([monitor.log])
17 ovs-appctl -t ovs-ofctl ofctl/send 0205000801234567
18 ovs-appctl -t ovs-ofctl ofctl/barrier
19 ovs-appctl -t ovs-ofctl exit
21 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//
22 /ECHO/d' monitor.log], [0], [dnl
23 send: OFPT_FEATURES_REQUEST (OF1.1):
24 OFPT_ERROR (OF1.1): OFPBRC_BAD_VERSION
25 OFPT_FEATURES_REQUEST (OF1.1):
29 OVS_VSWITCHD_STOP(["/received OpenFlow version 0x02 != expected 01/d"])
32 AT_SETUP([ofproto - feature request, config request])
34 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
35 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
36 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
37 n_tables:254, n_buffers:256
38 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
39 actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
40 LOCAL(br0): addr:aa:55:aa:55:00:00
43 speed: 0 Mbps now, 0 Mbps max
44 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
49 AT_SETUP([ofproto - set OpenFlow port number])
51 [add-port br0 p1 -- set Interface p1 type=dummy --\
52 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=99])
53 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
55 s/ (xid=0x[0-9a-fA-F]*)//
56 s/00:0.$/00:0x/' < stdout]],
58 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
59 n_tables:254, n_buffers:256
60 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
61 actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
62 1(p1): addr:aa:55:aa:55:00:0x
65 speed: 0 Mbps now, 0 Mbps max
66 99(p2): addr:aa:55:aa:55:00:0x
69 speed: 0 Mbps now, 0 Mbps max
70 LOCAL(br0): addr:aa:55:aa:55:00:0x
73 speed: 0 Mbps now, 0 Mbps max
74 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
80 dnl This is really bare-bones.
81 dnl It at least checks request and reply serialization and deserialization.
82 AT_SETUP([ofproto - port stats - (OpenFlow 1.0)])
84 AT_CHECK([ovs-ofctl -vwarn dump-ports br0], [0], [stdout])
85 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
86 OFPST_PORT reply: 1 ports
87 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
88 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
93 AT_SETUP([ofproto - port stats - (OpenFlow 1.2)])
95 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports br0], [0], [stdout])
96 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
97 OFPST_PORT reply (OF1.2): 1 ports
98 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
99 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
104 AT_SETUP([ofproto - port stats - (OpenFlow 1.4)])
106 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-ports br0], [0], [stdout])
107 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/'],
109 OFPST_PORT reply (OF1.4): 1 ports
110 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
111 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
117 dnl This is really bare-bones.
118 dnl It at least checks request and reply serialization and deserialization.
119 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.0)])
121 AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], [stdout])
122 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
123 OFPST_PORT_DESC reply:
124 LOCAL(br0): addr:aa:55:aa:55:00:00
127 speed: 0 Mbps now, 0 Mbps max
132 dnl This is really bare-bones.
133 dnl It at least checks request and reply serialization and deserialization.
134 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.2)])
136 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc br0], [0], [stdout])
137 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
138 OFPST_PORT_DESC reply (OF1.2):
139 LOCAL(br0): addr:aa:55:aa:55:00:00
142 speed: 0 Mbps now, 0 Mbps max
147 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.5)])
149 ADD_OF_PORTS([br0], 1, 2, 3)
150 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0], [0], [stdout])
151 AT_CHECK([STRIP_XIDS stdout | sed 's/00:0./00:0x/'], [0], [dnl
152 OFPST_PORT_DESC reply (OF1.5):
153 1(p1): addr:aa:55:aa:55:00:0x
156 speed: 0 Mbps now, 0 Mbps max
157 2(p2): addr:aa:55:aa:55:00:0x
160 speed: 0 Mbps now, 0 Mbps max
161 3(p3): addr:aa:55:aa:55:00:0x
164 speed: 0 Mbps now, 0 Mbps max
165 LOCAL(br0): addr:aa:55:aa:55:00:0x
168 speed: 0 Mbps now, 0 Mbps max
170 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0 2], [0], [stdout])
171 AT_CHECK([STRIP_XIDS stdout | sed 's/00:0./00:0x/'], [0], [dnl
172 OFPST_PORT_DESC reply (OF1.5):
173 2(p2): addr:aa:55:aa:55:00:0x
176 speed: 0 Mbps now, 0 Mbps max
181 dnl This is really bare-bones.
182 dnl It at least checks request and reply serialization and deserialization.
183 AT_SETUP([ofproto - queue stats - (OpenFlow 1.0)])
185 AT_CHECK([ovs-ofctl -vwarn queue-stats br0], [0], [stdout])
186 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
187 OFPST_QUEUE reply: 0 queues
189 AT_CHECK([ovs-ofctl -vwarn queue-stats br0 ANY 5], [0],
190 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_QUEUE
191 OFPST_QUEUE request (xid=0x2):port=ANY queue=5
193 AT_CHECK([ovs-ofctl -vwarn queue-stats br0 10], [0],
194 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT
195 OFPST_QUEUE request (xid=0x2):port=10 queue=ALL
200 AT_SETUP([ofproto - queue stats - (OpenFlow 1.2)])
202 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0], [0], [stdout])
203 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
204 OFPST_QUEUE reply (OF1.2): 0 queues
206 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 ALL 5], [0],
207 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_QUEUE
208 OFPST_QUEUE request (OF1.2) (xid=0x2):port=ANY queue=5
210 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 10], [0],
211 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_PORT
212 OFPST_QUEUE request (OF1.2) (xid=0x2):port=10 queue=ALL
217 AT_SETUP([ofproto - queue stats - (OpenFlow 1.4)])
219 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0], [0], [stdout])
220 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
221 OFPST_QUEUE reply (OF1.4): 0 queues
223 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 ALL 5], [0],
224 [OFPT_ERROR (OF1.4) (xid=0x2): OFPQOFC_BAD_QUEUE
225 OFPST_QUEUE request (OF1.4) (xid=0x2):port=ANY queue=5
227 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 10], [0],
228 [OFPT_ERROR (OF1.4) (xid=0x2): OFPQOFC_BAD_PORT
229 OFPST_QUEUE request (OF1.4) (xid=0x2):port=10 queue=ALL
234 dnl This is really bare-bones.
235 dnl It at least checks request and reply serialization and deserialization.
236 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.0)])
238 ADD_OF_PORTS([br0], [1], [2])
239 AT_CHECK([ovs-ofctl queue-get-config br0 1], [0], [stdout])
240 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
241 OFPT_QUEUE_GET_CONFIG_REPLY: port=1
243 AT_CHECK([ovs-ofctl queue-get-config br0 10], [0],
244 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT
245 OFPT_QUEUE_GET_CONFIG_REQUEST (xid=0x2): port=10
250 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.2)])
252 ADD_OF_PORTS([br0], [1], [2])
253 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 1], [0], [stdout])
254 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
255 OFPT_QUEUE_GET_CONFIG_REPLY (OF1.2): port=1
257 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 10], [0],
258 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_PORT
259 OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.2) (xid=0x2): port=10
264 dnl This is really bare-bones.
265 dnl It at least checks request and reply serialization and deserialization.
266 dnl Actions definition listed in both supported formats (w/ actions=)
267 AT_SETUP([ofproto - no group support (OpenFlow 1.0)])
269 AT_DATA([groups.txt], [dnl
270 group_id=1234,type=all,bucket=output:10
271 group_id=1235,type=all,bucket=actions=output:10
273 AT_DATA([stderr], [dnl
274 ovs-ofctl: none of the usable flow formats (OXM,OpenFlow11) is among the allowed flow formats (OpenFlow10,NXM)
276 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-groups br0 groups.txt], [1], ,[stderr])
277 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn mod-group br0 'group_id=1234,type=all,bucket=output:10'], [1], ,[stderr])
278 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0], [1], ,[stderr])
279 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0 ], [1], ,[stderr])
283 dnl This is really bare-bones.
284 dnl It at least checks request and reply serialization and deserialization.
285 dnl Actions definition listed in both supported formats (w/ actions=)
286 AT_SETUP([ofproto - del group (OpenFlow 1.1)])
288 AT_DATA([groups.txt], [dnl
289 group_id=1234,type=all,bucket=output:10
290 group_id=1235,type=all,bucket=actions=output:10
292 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
293 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0 ], [0], [stdout])
294 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
295 OFPST_GROUP_DESC reply (OF1.1):
296 group_id=1234,type=all,bucket=actions=output:10
297 group_id=1235,type=all,bucket=actions=output:10
299 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
300 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
301 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
302 OFPST_GROUP_DESC reply (OF1.1):
303 group_id=1235,type=all,bucket=actions=output:10
305 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
306 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
307 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
308 OFPST_GROUP_DESC reply (OF1.1):
309 group_id=1235,type=all,bucket=actions=output:10
311 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0], [0])
312 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
313 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
314 OFPST_GROUP_DESC reply (OF1.1):
319 dnl This is really bare-bones.
320 dnl It at least checks request and reply serialization and deserialization.
321 dnl Actions definition listed in both supported formats (w/ actions=)
322 AT_SETUP([ofproto - add indirect group])
324 dnl indirect group must have exactly one bucket
325 AT_DATA([stderr], [dnl
326 OFPT_ERROR (OF1.1) (xid=0x2): OFPGMFC_INVALID_GROUP
327 OFPT_GROUP_MOD (OF1.1) (xid=0x2): ***decode error: OFPGMFC_INVALID_GROUP***
329 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1234,type=indirect'], [1], , [stderr])
330 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1235,type=indirect,bucket=output:10'])
331 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1236,type=indirect,bucket=output:10,bucket=output:11'], [1], , [stderr])
335 dnl This is really bare-bones.
336 dnl It at least checks request and reply serialization and deserialization.
337 dnl Actions definition listed in both supported formats (w/ actions=)
338 AT_SETUP([ofproto - del group (OpenFlow 1.5)])
340 AT_DATA([groups.txt], [dnl
341 group_id=1234,type=all,bucket=output:10,bucket=output:11
342 group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
344 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
345 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
346 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
347 OFPST_GROUP_DESC reply (OF1.5):
348 group_id=1234,type=all,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
350 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
351 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
352 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
353 OFPST_GROUP_DESC reply (OF1.5):
354 group_id=1235,type=all,bucket=bucket_id:2,actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
356 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
357 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
358 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
359 OFPST_GROUP_DESC reply (OF1.5):
360 group_id=1235,type=all,bucket=bucket_id:2,actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
362 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0], [0])
363 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
364 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
365 OFPST_GROUP_DESC reply (OF1.5):
370 dnl This is really bare-bones.
371 dnl It at least checks request and reply serialization and deserialization.
372 AT_SETUP([ofproto - del group deletes flows])
374 AT_DATA([groups.txt], [dnl
375 group_id=1234,type=all,bucket=output:10
376 group_id=1235,type=all,bucket=output:10
378 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
379 AT_DATA([flows.txt], [dnl
380 tcp actions=group:1234
381 udp actions=group:1235
383 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt])
384 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
386 tcp actions=group:1234
387 udp actions=group:1235
388 OFPST_FLOW reply (OF1.1):
390 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
391 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
393 udp actions=group:1235
394 OFPST_FLOW reply (OF1.1):
396 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
397 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
399 udp actions=group:1235
400 OFPST_FLOW reply (OF1.1):
402 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0])
403 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
405 OFPST_FLOW reply (OF1.1):
410 dnl This is really bare-bones.
411 dnl It at least checks request and reply serialization and deserialization.
412 AT_SETUP([ofproto - flow mod checks group availability])
414 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
415 AT_DATA([flows.txt], [dnl
416 tcp actions=group:1234
417 udp actions=group:1235
419 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
420 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'], [1], [], [stderr])
422 # The output should look like this:
424 # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................|
425 # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................|
426 # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................|
427 # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............|
429 # This 'sed' command captures the error message but drops details.
430 AT_CHECK([sed '/truncated/d
431 /^000000.0/d' stderr | STRIP_XIDS], [0],
432 [OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP
433 OFPT_FLOW_MOD (OF1.1):
438 dnl This is really bare-bones.
439 dnl It at least checks request and reply serialization and deserialization.
440 AT_SETUP([ofproto - group description])
442 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10], [0], [stdout])
443 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
444 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
445 OFPST_GROUP_DESC reply (OF1.1):
446 group_id=1234,type=all,bucket=actions=output:10
451 dnl This is really bare-bones.
452 dnl It at least checks request and reply serialization and deserialization.
453 AT_SETUP([ofproto - group description])
455 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
456 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
457 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
458 OFPST_GROUP_DESC reply (OF1.1):
459 group_id=1234,type=all,bucket=actions=output:10
464 dnl This is really bare-bones.
465 dnl It at least checks request and reply serialization and deserialization.
466 AT_SETUP([ofproto - group features])
468 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout])
469 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
470 OFPST_GROUP_FEATURES reply (OF1.2):
475 max_groups=0xffffff00
476 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
478 max_groups=0xffffff00
479 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
481 max_groups=0xffffff00
482 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
484 max_groups=0xffffff00
485 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
490 dnl This is really bare-bones.
491 dnl It at least checks request and reply serialization and deserialization.
492 AT_SETUP([ofproto - group stats (OpenFlow 1.1)])
494 AT_DATA([groups.txt], [dnl
495 group_id=1234,type=all,bucket=output:10
496 group_id=1235,type=all,bucket=output:10
498 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
499 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
500 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
501 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
502 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
503 OFPST_GROUP reply (OF1.1):
505 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0], [0], [stdout])
506 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
507 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
508 group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
509 OFPST_GROUP reply (OF1.1):
514 dnl This is really bare-bones.
515 dnl It at least checks request and reply serialization and deserialization.
516 AT_SETUP([ofproto - group stats (OpenFlow 1.3)])
518 AT_DATA([groups.txt], [dnl
519 group_id=1234,type=all,bucket=output:10
520 group_id=1235,type=all,bucket=output:10
522 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
523 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-flow br0 'tcp actions=group:1234'])
524 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
525 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
526 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
527 OFPST_GROUP reply (OF1.3):
529 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0], [0], [stdout])
530 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
531 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
532 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
533 OFPST_GROUP reply (OF1.3):
538 dnl This is really bare-bones.
539 dnl It at least checks request and reply serialization and deserialization.
540 AT_SETUP([ofproto - group stats (OpenFlow 1.5)])
542 AT_DATA([groups.txt], [dnl
543 group_id=1234,type=all,bucket=output:10
544 group_id=1235,type=all,bucket=output:10
546 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
547 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-flow br0 'tcp actions=group:1234'])
548 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
549 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
550 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
551 OFPST_GROUP reply (OF1.5):
553 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0], [0], [stdout])
554 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
555 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
556 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
557 OFPST_GROUP reply (OF1.5):
562 AT_SETUP([ofproto - mod-port (OpenFlow 1.0)])
564 for command_config_state in \
566 'noflood NO_FLOOD 0' \
567 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
568 'flood PORT_DOWN LINK_DOWN' \
569 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
570 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
571 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
572 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
573 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
577 set $command_config_state
578 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
579 AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
580 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
581 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
582 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
583 n_tables:254, n_buffers:256
584 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
585 actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
586 LOCAL(br0): addr:aa:55:aa:55:00:00
589 speed: 0 Mbps now, 0 Mbps max
590 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
596 AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
598 for command_config_state in \
600 'down PORT_DOWN LINK_DOWN' \
601 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
602 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
603 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
604 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
605 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
609 set $command_config_state
610 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
611 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
612 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout])
613 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
614 OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210
615 n_tables:254, n_buffers:256
616 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
617 LOCAL(br0): addr:aa:55:aa:55:00:00
620 speed: 0 Mbps now, 0 Mbps max
621 OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0
627 AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
629 for command_config_state in \
631 'down PORT_DOWN LINK_DOWN' \
632 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
633 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
634 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
635 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
636 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
640 set $command_config_state
641 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
642 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command])
643 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn show br0], [0], [stdout])
644 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
645 OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210
646 n_tables:254, n_buffers:256
647 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
648 OFPST_PORT_DESC reply (OF1.4):
649 LOCAL(br0): addr:aa:55:aa:55:00:00
652 speed: 0 Mbps now, 0 Mbps max
653 OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0
659 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
661 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
663 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -])
664 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
665 AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3])
666 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
667 in_port=1 actions=output:2
668 in_port=2 actions=output:1
669 table=1, in_port=4 actions=output:3
672 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
673 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
675 AT_CHECK([ovs-ofctl del-flows br0])
676 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
681 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
683 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
685 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -])
686 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2])
687 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3])
688 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
689 in_port=1 actions=output:2
690 in_port=2 actions=output:1
691 table=1, in_port=4 actions=output:3
694 AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
695 OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
697 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
698 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
703 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)])
705 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
707 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -])
708 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2])
709 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3])
710 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
711 in_port=1 actions=output:2
712 in_port=2 actions=output:1
713 table=1, in_port=4 actions=output:3
714 OFPST_FLOW reply (OF1.1):
716 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
717 OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2
719 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
720 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
721 table=1, in_port=4 actions=output:3
726 AT_SETUP([ofproto - flow_mod negative test (OpenFlow 1.1)])
728 [set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13])
729 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2])
731 # The error message here actually comes from ovs-ofctl, not from ovs-vswitchd,
732 # but at least it's the same code in ofpacts_check() that issues the error.
733 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1],
735 [ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID)
740 AT_SETUP([ofproto - set-field flow_mod commands (NXM)])
742 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop])
743 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])
744 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
745 table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]]
751 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)])
753 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
755 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -])
756 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2])
757 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3])
758 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
759 in_port=1 actions=output:2
760 in_port=2 actions=output:1
761 table=1, in_port=4 actions=output:3
762 OFPST_FLOW reply (OF1.2):
764 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
765 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
770 AT_SETUP([ofproto - dump flows with cookie])
772 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
773 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
774 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
775 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
776 cookie=0x1, in_port=1 actions=output:1
777 cookie=0x2, in_port=2 actions=output:1
778 cookie=0x3, in_port=3 actions=output:1
781 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
782 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
784 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl
785 cookie=0x3, in_port=3 actions=output:1
788 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | STRIP_XIDS], [0], [dnl
789 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
794 AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)])
796 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1])
797 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
798 cookie=0x1, in_port=1 actions=output:1
802 AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1])
803 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
804 cookie=0x2, in_port=1 actions=output:1
810 AT_SETUP([ofproto - mod flow with cookie change (NXM)])
812 AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1])
813 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
814 cookie=0x1, in_port=1 actions=output:1
818 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1])
819 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
820 cookie=0x2, in_port=1 actions=output:1
826 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)])
828 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
829 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
830 cookie=0x1, in_port=1 actions=output:1
831 OFPST_FLOW reply (OF1.1):
833 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1])
834 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
835 cookie=0x1, in_port=1 actions=output:1
836 OFPST_FLOW reply (OF1.1):
841 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
842 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)])
844 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
845 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
846 cookie=0x1, in_port=1 actions=output:1
847 OFPST_FLOW reply (OF1.2):
850 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1])
851 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
852 cookie=0x1, in_port=1 actions=output:1
853 OFPST_FLOW reply (OF1.2):
858 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)])
860 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
861 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
862 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
863 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
864 cookie=0x1, in_port=1 actions=output:1
865 cookie=0x1, in_port=2 actions=output:1
866 cookie=0x2, in_port=3 actions=output:1
870 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4])
871 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
872 cookie=0x1, in_port=1 actions=output:4
873 cookie=0x1, in_port=2 actions=output:4
874 cookie=0x2, in_port=3 actions=output:1
880 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)])
882 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
883 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1])
884 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1])
885 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
886 cookie=0x1, in_port=1 actions=output:1
887 cookie=0x1, in_port=2 actions=output:1
888 cookie=0x2, in_port=3 actions=output:1
889 OFPST_FLOW reply (OF1.1):
892 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4])
893 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
894 cookie=0x1, in_port=1 actions=output:4
895 cookie=0x1, in_port=2 actions=output:4
896 cookie=0x2, in_port=3 actions=output:1
897 OFPST_FLOW reply (OF1.1):
902 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)])
904 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
905 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1])
906 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1])
907 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
908 cookie=0x1, in_port=1 actions=output:1
909 cookie=0x1, in_port=2 actions=output:1
910 cookie=0x2, in_port=3 actions=output:1
911 OFPST_FLOW reply (OF1.2):
914 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4])
915 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
916 cookie=0x1, in_port=1 actions=output:4
917 cookie=0x1, in_port=2 actions=output:4
918 cookie=0x2, in_port=3 actions=output:1
919 OFPST_FLOW reply (OF1.2):
924 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
925 AT_SETUP([ofproto - mod flows based on cookie mask with cookie change])
927 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
928 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
929 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
930 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
931 cookie=0x1, in_port=1 actions=output:1
932 cookie=0x1, in_port=2 actions=output:1
933 cookie=0x2, in_port=3 actions=output:1
937 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4])
938 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
939 cookie=0x2, in_port=3 actions=output:1
940 cookie=0x4, in_port=1 actions=output:4
941 cookie=0x4, in_port=2 actions=output:4
947 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM])
949 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1])
950 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
951 in_port=1 actions=output:1
957 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1])
959 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1])
960 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
961 in_port=1 actions=output:1
962 OFPST_FLOW reply (OF1.1):
967 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2])
969 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1])
970 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
971 OFPST_FLOW reply (OF1.2):
976 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM])
978 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1])
979 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
985 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1])
987 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1])
988 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
989 OFPST_FLOW reply (OF1.1):
994 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2])
996 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1])
997 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
998 OFPST_FLOW reply (OF1.2):
1003 AT_SETUP([ofproto - del flows with cookies])
1005 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1006 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1007 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1008 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1009 cookie=0x1, in_port=1 actions=output:1
1010 cookie=0x2, in_port=2 actions=output:1
1011 cookie=0x3, in_port=3 actions=output:1
1015 AT_CHECK([ovs-ofctl del-flows br0])
1016 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1022 AT_SETUP([ofproto - del flows based on cookie])
1024 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1025 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1026 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1027 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1028 cookie=0x1, in_port=1 actions=output:1
1029 cookie=0x2, in_port=2 actions=output:1
1030 cookie=0x3, in_port=3 actions=output:1
1034 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1])
1035 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1036 cookie=0x1, in_port=1 actions=output:1
1037 cookie=0x2, in_port=2 actions=output:1
1043 AT_SETUP([ofproto - del flows based on cookie mask])
1045 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1046 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1047 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1048 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1049 cookie=0x1, in_port=1 actions=output:1
1050 cookie=0x2, in_port=2 actions=output:1
1051 cookie=0x3, in_port=3 actions=output:1
1054 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
1055 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1056 cookie=0x2, in_port=2 actions=output:1
1062 AT_SETUP([ofproto - del flows based on table id (NXM)])
1064 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1065 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1066 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1067 cookie=0x1, in_port=1 actions=output:1
1068 cookie=0x2, table=1, in_port=2 actions=output:1
1071 AT_CHECK([ovs-ofctl del-flows br0 table=0])
1072 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1073 cookie=0x2, table=1, in_port=2 actions=output:1
1076 AT_CHECK([ovs-ofctl del-flows br0 table=1])
1077 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1080 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1081 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1082 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1083 cookie=0x1, in_port=1 actions=output:1
1084 cookie=0x2, table=1, in_port=2 actions=output:1
1087 AT_CHECK([ovs-ofctl del-flows br0])
1088 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1094 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)])
1096 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1097 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1098 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1099 cookie=0x1, in_port=1 actions=output:1
1100 cookie=0x2, table=1, in_port=2 actions=output:1
1101 OFPST_FLOW reply (OF1.1):
1103 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0])
1104 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1105 cookie=0x2, table=1, in_port=2 actions=output:1
1106 OFPST_FLOW reply (OF1.1):
1108 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1])
1109 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1110 OFPST_FLOW reply (OF1.1):
1112 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1113 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1114 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1115 cookie=0x1, in_port=1 actions=output:1
1116 cookie=0x2, table=1, in_port=2 actions=output:1
1117 OFPST_FLOW reply (OF1.1):
1119 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
1120 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
1121 OFPST_FLOW reply (OF1.1):
1122 cookie=0x2, table=1, in_port=2 actions=output:1
1127 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)])
1129 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1130 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1131 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1132 cookie=0x1, in_port=1 actions=output:1
1133 cookie=0x2, table=1, in_port=2 actions=output:1
1134 OFPST_FLOW reply (OF1.2):
1136 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0])
1137 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1138 cookie=0x2, table=1, in_port=2 actions=output:1
1139 OFPST_FLOW reply (OF1.2):
1141 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1])
1142 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1143 OFPST_FLOW reply (OF1.2):
1145 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1146 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1147 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1148 cookie=0x1, in_port=1 actions=output:1
1149 cookie=0x2, table=1, in_port=2 actions=output:1
1150 OFPST_FLOW reply (OF1.2):
1152 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
1153 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1154 OFPST_FLOW reply (OF1.2):
1159 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)])
1161 # Check the default configuration.
1162 (printf "OFPST_TABLE reply (xid=0x2):"
1165 while test $x -lt 254; do
1168 active=0, lookup=0, matched=0
1171 in_port: exact match or wildcard
1172 eth_src: exact match or wildcard
1173 eth_dst: exact match or wildcard
1174 eth_type: exact match or wildcard
1175 vlan_vid: exact match or wildcard
1176 vlan_pcp: exact match or wildcard
1177 ip_src: exact match or wildcard
1178 ip_dst: exact match or wildcard
1179 nw_proto: exact match or wildcard
1180 nw_tos: exact match or wildcard
1181 tcp_src: exact match or wildcard
1182 tcp_dst: exact match or wildcard
1187 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1188 # Change the configuration.
1191 -- --id=@t0 create Flow_Table name=main \
1192 -- --id=@t1 create Flow_Table flow-limit=1024 \
1193 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1194 | ${PERL} $srcdir/uuidfilt.pl],
1198 # Check that the configuration was updated.
1199 mv expout orig-expout
1200 sed -e 's/classifier/main/
1201 21s/1000000/1024/' orig-expout > expout
1202 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1206 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)])
1208 # Check the default configuration.
1209 (printf "OFPST_TABLE reply (OF1.2) (xid=0x2):"
1212 while test $x -lt 254; do
1214 table $x (\"$name\"):
1215 active=0, lookup=0, matched=0
1216 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1219 instructions (table miss and others):
1220 instructions: apply_actions,clear_actions,write_actions,write_metadata,goto_table
1221 Write-Actions and Apply-Actions features:
1222 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
1223 supported on Set-Field: metadata in_port_oxm eth_src eth_dst vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ip_dscp nw_ecn arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst
1225 metadata: exact match or wildcard
1226 in_port_oxm: exact match or wildcard
1227 eth_src: exact match or wildcard
1228 eth_dst: exact match or wildcard
1229 eth_type: exact match or wildcard
1230 vlan_vid: exact match or wildcard
1231 vlan_pcp: exact match or wildcard
1232 mpls_label: exact match or wildcard
1233 mpls_tc: exact match or wildcard
1234 ip_src: exact match or wildcard
1235 ip_dst: exact match or wildcard
1236 ipv6_src: exact match or wildcard
1237 ipv6_dst: exact match or wildcard
1238 ipv6_label: exact match or wildcard
1239 nw_proto: exact match or wildcard
1240 ip_dscp: exact match or wildcard
1241 nw_ecn: exact match or wildcard
1242 arp_op: exact match or wildcard
1243 arp_spa: exact match or wildcard
1244 arp_tpa: exact match or wildcard
1245 arp_sha: exact match or wildcard
1246 arp_tha: exact match or wildcard
1247 tcp_src: exact match or wildcard
1248 tcp_dst: exact match or wildcard
1249 udp_src: exact match or wildcard
1250 udp_dst: exact match or wildcard
1251 sctp_src: exact match or wildcard
1252 sctp_dst: exact match or wildcard
1253 icmp_type: exact match or wildcard
1254 icmp_code: exact match or wildcard
1255 icmpv6_type: exact match or wildcard
1256 icmpv6_code: exact match or wildcard
1257 nd_target: exact match or wildcard
1258 nd_sll: exact match or wildcard
1259 nd_tll: exact match or wildcard"
1263 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1264 # Change the configuration.
1267 -- --id=@t0 create Flow_Table name=main \
1268 -- --id=@t1 create Flow_Table flow-limit=1024 \
1269 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1270 | ${PERL} $srcdir/uuidfilt.pl],
1274 # Check that the configuration was updated.
1275 mv expout orig-expout
1276 sed 's/classifier/main/
1277 53s/1000000/1024/' < orig-expout > expout
1278 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1282 AT_SETUP([ofproto - table features (OpenFlow 1.3)])
1286 while test $x -lt 254; do
1288 if test $x = 253; then
1293 echo " table $x (\"$name\"):
1294 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1296 instructions (table miss and others):
1298 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata,goto_table
1299 Write-Actions and Apply-Actions features:
1300 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
1301 supported on Set-Field: tun_id tun_src tun_dst metadata in_port in_port_oxm pkt_mark reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 xreg0 xreg1 xreg2 xreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst
1303 dp_hash: arbitrary mask
1304 recirc_id: exact match or wildcard
1305 tun_id: arbitrary mask
1306 tun_src: arbitrary mask
1307 tun_dst: arbitrary mask
1308 metadata: arbitrary mask
1309 in_port: exact match or wildcard
1310 in_port_oxm: exact match or wildcard
1311 actset_output: exact match or wildcard
1312 pkt_mark: arbitrary mask
1313 reg0: arbitrary mask
1314 reg1: arbitrary mask
1315 reg2: arbitrary mask
1316 reg3: arbitrary mask
1317 reg4: arbitrary mask
1318 reg5: arbitrary mask
1319 reg6: arbitrary mask
1320 reg7: arbitrary mask
1321 xreg0: arbitrary mask
1322 xreg1: arbitrary mask
1323 xreg2: arbitrary mask
1324 xreg3: arbitrary mask
1325 eth_src: arbitrary mask
1326 eth_dst: arbitrary mask
1327 eth_type: exact match or wildcard
1328 vlan_tci: arbitrary mask
1329 vlan_vid: arbitrary mask
1330 vlan_pcp: exact match or wildcard
1331 mpls_label: exact match or wildcard
1332 mpls_tc: exact match or wildcard
1333 mpls_bos: exact match or wildcard
1334 ip_src: arbitrary mask
1335 ip_dst: arbitrary mask
1336 ipv6_src: arbitrary mask
1337 ipv6_dst: arbitrary mask
1338 ipv6_label: arbitrary mask
1339 nw_proto: exact match or wildcard
1340 nw_tos: exact match or wildcard
1341 ip_dscp: exact match or wildcard
1342 nw_ecn: exact match or wildcard
1343 nw_ttl: exact match or wildcard
1344 ip_frag: arbitrary mask
1345 arp_op: exact match or wildcard
1346 arp_spa: arbitrary mask
1347 arp_tpa: arbitrary mask
1348 arp_sha: arbitrary mask
1349 arp_tha: arbitrary mask
1350 tcp_src: arbitrary mask
1351 tcp_dst: arbitrary mask
1352 tcp_flags: arbitrary mask
1353 udp_src: arbitrary mask
1354 udp_dst: arbitrary mask
1355 sctp_src: arbitrary mask
1356 sctp_dst: arbitrary mask
1357 icmp_type: exact match or wildcard
1358 icmp_code: exact match or wildcard
1359 icmpv6_type: exact match or wildcard
1360 icmpv6_code: exact match or wildcard
1361 nd_target: arbitrary mask
1362 nd_sll: arbitrary mask
1363 nd_tll: arbitrary mask"
1367 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0 | sed '/^$/d
1368 /^OFPST_TABLE_FEATURES/d'], [0], [expout])
1369 # Change the configuration.
1372 -- --id=@t0 create Flow_Table name=main \
1373 -- --id=@t1 create Flow_Table flow-limit=1024 \
1374 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1375 | ${PERL} $srcdir/uuidfilt.pl],
1379 # Check that the configuration was updated.
1380 mv expout orig-expout
1381 sed 's/classifier/main/
1382 74s/1000000/1024/' < orig-expout > expout
1383 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0 | sed '/^$/d
1384 /^OFPST_TABLE_FEATURES/d'], [0], [expout])
1388 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)])
1390 # Configure a maximum of 4 flows.
1393 -- --id=@t0 create Flow_Table flow-limit=4 \
1394 -- set bridge br0 flow_tables:0=@t0 \
1395 | ${PERL} $srcdir/uuidfilt.pl],
1399 for in_port in 1 2 3 4; do
1400 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
1402 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1403 in_port=1 actions=drop
1404 in_port=2 actions=drop
1405 in_port=3 actions=drop
1406 in_port=4 actions=drop
1409 # Adding another flow will be refused.
1410 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1411 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1412 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1414 # Also a mod-flow that would add a flow will be refused.
1415 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
1416 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1417 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1419 # Replacing or modifying an existing flow is allowed.
1420 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1421 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1422 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1423 in_port=1 actions=drop
1424 in_port=2 actions=drop
1425 in_port=3 actions=output:1
1426 in_port=4 actions=NORMAL
1432 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)])
1434 # Configure a maximum of 4 flows.
1437 -- --id=@t0 create Flow_Table flow-limit=4 \
1438 -- set bridge br0 flow_tables:0=@t0 \
1439 | ${PERL} $srcdir/uuidfilt.pl],
1443 for in_port in 1 2 3 4; do
1444 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
1446 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1447 in_port=1 actions=drop
1448 in_port=2 actions=drop
1449 in_port=3 actions=drop
1450 in_port=4 actions=drop
1451 OFPST_FLOW reply (OF1.2):
1453 # Adding another flow will be refused.
1454 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1455 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1456 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1458 # Replacing or modifying an existing flow is allowed.
1459 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1460 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1461 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1462 in_port=1 actions=drop
1463 in_port=2 actions=drop
1464 in_port=3 actions=output:1
1465 in_port=4 actions=NORMAL
1466 OFPST_FLOW reply (OF1.2):
1471 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
1473 # Configure a maximum of 4 flows.
1476 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1477 -- set bridge br0 flow_tables:0=@t0 \
1478 | ${PERL} $srcdir/uuidfilt.pl],
1482 for in_port in 4 3 2 1; do
1483 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1485 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1486 idle_timeout=10, in_port=1 actions=drop
1487 idle_timeout=20, in_port=2 actions=drop
1488 idle_timeout=30, in_port=3 actions=drop
1489 idle_timeout=40, in_port=4 actions=drop
1492 # Adding another flow will cause the one that expires soonest to be evicted.
1493 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1494 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1495 idle_timeout=20, in_port=2 actions=drop
1496 idle_timeout=30, in_port=3 actions=drop
1497 idle_timeout=40, in_port=4 actions=drop
1498 in_port=5 actions=drop
1501 # A mod-flow that adds a flow also causes eviction, but replacing or
1502 # modifying an existing flow doesn't.
1503 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
1504 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1505 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1506 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1507 idle_timeout=30, in_port=3 actions=output:1
1508 in_port=4 actions=NORMAL
1509 in_port=5 actions=drop
1510 in_port=6 actions=drop
1513 # Flows with no timeouts at all cannot be evicted.
1514 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
1515 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1516 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1517 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1519 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1520 in_port=4 actions=NORMAL
1521 in_port=5 actions=drop
1522 in_port=6 actions=drop
1523 in_port=7 actions=NORMAL
1529 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
1531 # Configure a maximum of 4 flows.
1534 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1535 -- set bridge br0 flow_tables:0=@t0 \
1536 | ${PERL} $srcdir/uuidfilt.pl],
1540 for in_port in 4 3 2 1; do
1541 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1543 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1544 idle_timeout=10, in_port=1 actions=drop
1545 idle_timeout=20, in_port=2 actions=drop
1546 idle_timeout=30, in_port=3 actions=drop
1547 idle_timeout=40, in_port=4 actions=drop
1548 OFPST_FLOW reply (OF1.2):
1550 # Adding another flow will cause the one that expires soonest to be evicted.
1551 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
1552 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1553 idle_timeout=20, in_port=2 actions=drop
1554 idle_timeout=30, in_port=3 actions=drop
1555 idle_timeout=40, in_port=4 actions=drop
1556 in_port=5 actions=drop
1557 OFPST_FLOW reply (OF1.2):
1559 # In OpenFlow 1.2 a mod-flow does not ever add a flow and thus
1560 # has no effect on eviction
1561 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
1562 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1563 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1564 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1565 idle_timeout=20, in_port=2 actions=drop
1566 idle_timeout=30, in_port=3 actions=output:1
1567 in_port=4 actions=NORMAL
1568 in_port=5 actions=drop
1569 OFPST_FLOW reply (OF1.2):
1571 # Flows with no timeouts at all cannot be evicted.
1572 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
1573 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
1574 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1575 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1576 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1578 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1579 in_port=4 actions=NORMAL
1580 in_port=5 actions=drop
1581 in_port=6 actions=drop
1582 in_port=7 actions=NORMAL
1583 OFPST_FLOW reply (OF1.2):
1588 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
1590 # Configure a maximum of 4 flows.
1593 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1594 overflow-policy=evict \
1595 groups='"NXM_OF_IN_PORT[[]]"' \
1596 -- set bridge br0 flow_tables:0=@t0 \
1597 | ${PERL} $srcdir/uuidfilt.pl],
1601 ovs-ofctl add-flows br0 - <<EOF
1602 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1603 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1604 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1605 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1607 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1608 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1609 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1610 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1611 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1614 # Adding another flow will cause the one that expires soonest within
1615 # the largest group (those with in_port=1) to be evicted. In this
1616 # case this is not the same as the one that expires soonest overall
1617 # (which is what makes the test interesting):
1618 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1619 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1620 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1621 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1622 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1623 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1626 # Enlarge the flow limit, change the eviction policy back to strictly
1627 # based on expiration, and and add some flows.
1628 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1629 ovs-ofctl add-flows br0 - <<EOF
1630 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1631 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1632 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1634 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1635 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1636 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1637 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1638 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1639 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1640 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1641 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1644 # Adding another flow will cause the one that expires soonest overall
1646 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
1647 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1648 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1649 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1650 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1651 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1652 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1653 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1654 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1657 # Reducing the flow limit also causes the flows that expire soonest
1658 # overall to be evicted.
1659 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1660 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1661 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1662 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1663 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1664 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1670 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
1672 # Configure a maximum of 4 flows.
1675 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1676 overflow-policy=evict \
1677 groups='"NXM_OF_IN_PORT[[]]"' \
1678 -- set bridge br0 flow_tables:0=@t0 \
1679 | ${PERL} $srcdir/uuidfilt.pl],
1683 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1684 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1685 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1686 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1687 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1689 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1690 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1691 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1692 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1693 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1694 OFPST_FLOW reply (OF1.2):
1696 # Adding another flow will cause the one that expires soonest within
1697 # the largest group (those with in_port=1) to be evicted. In this
1698 # case this is not the same as the one that expires soonest overall
1699 # (which is what makes the test interesting):
1700 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1701 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1702 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1703 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1704 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1705 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1706 OFPST_FLOW reply (OF1.2):
1708 # Enlarge the flow limit, change the eviction policy back to strictly
1709 # based on expiration, and and add some flows.
1710 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1711 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1712 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1713 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1714 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1716 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1717 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1718 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1719 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1720 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1721 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1722 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1723 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1724 OFPST_FLOW reply (OF1.2):
1726 # Adding another flow will cause the one that expires soonest overall
1728 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'])
1729 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1730 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1731 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1732 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1733 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1734 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1735 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1736 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1737 OFPST_FLOW reply (OF1.2):
1739 # Reducing the flow limit also causes the flows that expire soonest
1740 # overall to be evicted.
1741 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1742 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1743 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1744 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1745 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1746 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1747 OFPST_FLOW reply (OF1.2):
1752 AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout])
1754 # Configure a maximum of 4 flows.
1757 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1758 -- set bridge br0 flow_tables:0=@t0 \
1759 | ${PERL} $srcdir/uuidfilt.pl],
1762 ovs-appctl time/stop
1764 for in_port in 4 3 2 1; do
1765 ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
1767 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1768 hard_timeout=13, in_port=1 actions=drop
1769 hard_timeout=16, in_port=2 actions=drop
1770 hard_timeout=19, in_port=3 actions=drop
1771 hard_timeout=22, in_port=4 actions=drop
1774 # Sleep and modify the one that expires soonest
1775 ovs-appctl time/warp 5000
1776 AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop])
1777 # At this point the table would looks like:
1778 # in_port seconds to expire
1783 ovs-appctl time/warp 2000
1784 # Adding another flow will cause the one that expires soonest to be evicted.
1785 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1786 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1787 hard_timeout=13, in_port=1 actions=drop
1788 hard_timeout=19, in_port=3 actions=drop
1789 hard_timeout=22, in_port=4 actions=drop
1790 in_port=5 actions=drop
1796 AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout])
1797 OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1])
1798 # Configure a maximum of 4 flows.
1801 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1802 -- set bridge br0 flow_tables:0=@t0 \
1803 | ${PERL} $srcdir/uuidfilt.pl],
1807 for in_port in 4 3 2 1; do
1808 ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
1810 ovs-appctl time/stop
1811 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1812 idle_timeout=13, in_port=1 actions=drop
1813 idle_timeout=16, in_port=2 actions=drop
1814 idle_timeout=19, in_port=3 actions=drop
1815 idle_timeout=22, in_port=4 actions=drop
1818 # Sleep and receive on the flow that expires soonest
1819 ovs-appctl time/warp 5000
1820 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)'])
1821 # At this point the table would looks like:
1822 # in_port seconds to expire
1827 ovs-appctl time/warp 2000
1828 # Adding another flow will cause the one that expires soonest to be evicted.
1829 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1830 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1831 idle_timeout=19, in_port=3 actions=drop
1832 idle_timeout=22, in_port=4 actions=drop
1833 in_port=5 actions=drop
1834 n_packets=1, n_bytes=60, idle_timeout=13, in_port=1 actions=drop
1840 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
1842 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
1844 printf '\n\n--- check_async %d ---\n\n\n' $1
1847 ovs-appctl -t ovs-ofctl ofctl/barrier
1848 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1851 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1852 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
1853 if test X"$1" = X"OFPR_ACTION"; then shift;
1854 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
1855 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"
1858 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1859 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1860 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1861 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
1862 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"
1865 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1866 ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1867 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1868 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
1869 udp,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"
1872 # OFPT_PORT_STATUS, OFPPR_ADD
1873 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
1874 if test X"$1" = X"OFPPR_ADD"; then shift;
1875 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
1878 speed: 0 Mbps now, 0 Mbps max"
1881 # OFPT_PORT_STATUS, OFPPR_DELETE
1882 ovs-vsctl del-port br0 test
1883 if test X"$1" = X"OFPPR_DELETE"; then shift;
1884 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
1887 speed: 0 Mbps now, 0 Mbps max"
1890 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1891 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
1892 ovs-ofctl --strict del-flows br0 ''
1893 if test X"$1" = X"OFPRR_DELETE"; then shift;
1894 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
1896 AT_FAIL_IF([test X"$1" != X])
1898 ovs-appctl -t ovs-ofctl ofctl/barrier
1899 echo >>expout "OFPT_BARRIER_REPLY:"
1903 s/ (xid=0x[0-9a-fA-F]*)//
1905 s/00:0.$/00:0x/' < monitor.log]],
1909 # It's a service connection so initially there should be no async messages.
1912 # Set miss_send_len to 128, turning on packet-ins for our service connection.
1913 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
1914 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1916 # Set miss_send_len to 128 and enable invalid_ttl.
1917 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
1918 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1920 # Become slave, which should disable everything except port status.
1921 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
1922 check_async 4 OFPPR_ADD OFPPR_DELETE
1924 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
1925 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
1926 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1928 # Set controller ID 123.
1929 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
1930 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1932 # Restore controller ID 0.
1933 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
1936 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
1937 check_async 7 OFPR_ACTION OFPPR_ADD
1939 ovs-appctl -t ovs-ofctl exit
1943 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
1945 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
1947 printf '\n\n--- check_async %d ---\n\n\n' $1
1951 ovs-appctl -t ovs-ofctl ofctl/barrier
1952 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1955 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1956 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
1957 if test X"$1" = X"OFPR_ACTION"; then shift;
1958 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
1959 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"
1962 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1963 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1964 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1965 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
1966 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"
1969 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1970 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1971 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1972 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
1973 udp,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"
1976 # OFPT_PORT_STATUS, OFPPR_ADD
1977 ovs-vsctl add-port br0 test -- set Interface test type=dummy
1978 if test X"$1" = X"OFPPR_ADD"; then shift;
1979 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1982 speed: 0 Mbps now, 0 Mbps max"
1985 # OFPT_PORT_STATUS, OFPPR_DELETE
1986 ovs-vsctl del-port br0 test
1987 if test X"$1" = X"OFPPR_DELETE"; then shift;
1988 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1991 speed: 0 Mbps now, 0 Mbps max"
1994 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1995 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
1996 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
1997 if test X"$1" = X"OFPRR_DELETE"; then shift;
1998 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
2000 AT_FAIL_IF([test X"$1" != X])
2002 ovs-appctl -t ovs-ofctl ofctl/barrier
2003 echo >>expout "OFPT_BARRIER_REPLY (OF1.2):"
2007 s/ (xid=0x[0-9a-fA-F]*)//
2009 s/00:0.$/00:0x/' < monitor.log]],
2013 # It's a service connection so initially there should be no async messages.
2016 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2017 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2018 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2020 # Set miss_send_len to 128 and enable invalid_ttl.
2021 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
2022 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2024 # Become slave (OF 1.2), which should disable everything except port status.
2025 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
2026 check_async 4 OFPPR_ADD OFPPR_DELETE
2028 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
2029 ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
2030 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2032 # Set controller ID 123.
2033 ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
2034 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2036 # Restore controller ID 0.
2037 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
2039 # Become master (OF 1.2).
2040 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
2041 check_async 7 OFPR_ACTION OFPPR_ADD
2043 ovs-appctl -t ovs-ofctl exit
2047 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
2049 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
2051 printf '\n\n--- check_async %d ---\n\n\n' $1
2055 ovs-appctl -t ovs-ofctl ofctl/barrier
2056 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2059 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2060 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
2061 if test X"$1" = X"OFPR_ACTION"; then shift;
2062 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2063 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"
2066 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2067 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2068 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2069 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2070 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"
2073 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2074 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2075 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2076 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2077 udp,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"
2080 # OFPT_PORT_STATUS, OFPPR_ADD
2081 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2082 if test X"$1" = X"OFPPR_ADD"; then shift;
2083 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2086 speed: 0 Mbps now, 0 Mbps max"
2089 # OFPT_PORT_STATUS, OFPPR_DELETE
2090 ovs-vsctl del-port br0 test
2091 if test X"$1" = X"OFPPR_DELETE"; then shift;
2092 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2095 speed: 0 Mbps now, 0 Mbps max"
2098 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2099 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
2100 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
2101 if test X"$1" = X"OFPRR_DELETE"; then shift;
2102 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
2105 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
2106 ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10
2107 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234
2108 ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234
2109 if test X"$1" = X"OFPRR_DELETE"; then shift;
2110 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=gropu_delete table_id=0"
2113 AT_FAIL_IF([test X"$1" != X])
2115 ovs-appctl -t ovs-ofctl ofctl/barrier
2116 echo >>expout "OFPT_BARRIER_REPLY (OF1.3):"
2120 s/ (xid=0x[0-9a-fA-F]*)//
2122 s/00:0.$/00:0x/' < monitor.log]],
2126 # It's a service connection so initially there should be no async messages.
2129 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2130 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
2131 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2133 # Become slave (OF 1.3), which should disable everything except port status.
2134 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
2135 check_async 3 OFPPR_ADD OFPPR_DELETE
2137 # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
2138 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005
2139 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2141 # Set controller ID 123.
2142 ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
2143 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2145 # Restore controller ID 0.
2146 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
2148 # Become master (OF 1.3).
2149 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
2150 check_async 6 OFPR_ACTION OFPPR_ADD
2152 ovs-appctl -t ovs-ofctl exit
2156 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.5)])
2158 AT_CHECK([ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile])
2160 printf '\n\n--- check_async %d ---\n\n\n' $1
2164 ovs-appctl -t ovs-ofctl ofctl/barrier
2165 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2168 # Other tests are not working with OF 1.5, and message
2169 # format may change, so leave them out.
2171 # OFPT_PORT_STATUS, OFPPR_ADD
2172 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2173 if test X"$1" = X"OFPPR_ADD"; then shift;
2174 echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2177 speed: 0 Mbps now, 0 Mbps max"
2180 # OFPT_PORT_STATUS, OFPPR_MODIFY
2181 ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test up
2182 if test X"$1" = X"OFPPR_MODIFY"; then shift;
2183 echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2186 speed: 0 Mbps now, 0 Mbps max
2187 OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x
2190 speed: 0 Mbps now, 0 Mbps max"
2193 # OFPT_PORT_STATUS, OFPPR_DELETE
2194 ovs-vsctl del-port br0 test
2195 if test X"$1" = X"OFPPR_DELETE"; then shift;
2196 echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2199 speed: 0 Mbps now, 0 Mbps max"
2202 AT_FAIL_IF([test X"$1" != X])
2204 ovs-appctl -t ovs-ofctl ofctl/barrier
2205 echo >>expout "OFPT_BARRIER_REPLY (OF1.5):"
2209 s/ (xid=0x[0-9a-fA-F]*)//
2211 s/00:0.$/00:0x/' < monitor.log]],
2215 # It's a service connection so initially there should be no async messages.
2218 # If we don't set this, async messages are not received.
2219 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2220 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
2221 check_async 2 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
2223 # Set-async has changed in OF 1.4 and is not yet implemented.
2225 ovs-appctl -t ovs-ofctl exit
2229 dnl This test checks that the role request/response messaging works
2230 dnl and that generation_id is handled properly.
2231 AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
2233 ON_EXIT([kill `cat c1.pid c2.pid`])
2235 # Start two ovs-ofctl controller processes.
2236 AT_CAPTURE_FILE([monitor1.log])
2237 AT_CAPTURE_FILE([expout1])
2238 AT_CAPTURE_FILE([experr1])
2239 AT_CAPTURE_FILE([monitor2.log])
2240 AT_CAPTURE_FILE([expout2])
2241 AT_CAPTURE_FILE([experr2])
2243 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
2244 ovs-appctl -t `pwd`/c$i ofctl/barrier
2245 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2249 # find out current role
2250 ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000
2251 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange"
2252 echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
2255 # controller 1: Become slave (generation_id is initially undefined, so
2256 # 2^63+2 should not be stale)
2257 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
2258 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
2259 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
2261 # controller 2: Become master.
2262 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
2263 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
2264 echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
2266 # controller 1: Try to become the master using a stale generation ID
2267 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
2268 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
2269 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
2270 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
2272 # controller 1: Become master using a valid generation ID
2273 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
2274 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
2275 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
2278 ovs-appctl -t `pwd`/c$i ofctl/barrier
2279 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):"
2285 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2287 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2292 dnl This test checks that the role request/response messaging works,
2293 dnl that generation_id is handled properly, and that role status update
2294 dnl messages are sent when a controller's role gets changed from master
2296 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
2298 ON_EXIT([kill `cat c1.pid c2.pid`])
2300 # Start two ovs-ofctl controller processes.
2301 AT_CAPTURE_FILE([monitor1.log])
2302 AT_CAPTURE_FILE([expout1])
2303 AT_CAPTURE_FILE([experr1])
2304 AT_CAPTURE_FILE([monitor2.log])
2305 AT_CAPTURE_FILE([expout2])
2306 AT_CAPTURE_FILE([experr2])
2308 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
2309 ovs-appctl -t `pwd`/c$i ofctl/barrier
2310 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2314 # find out current role
2315 ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000
2316 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange"
2317 echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
2320 # controller 1: Become slave (generation_id is initially undefined, so
2321 # 2^63+2 should not be stale)
2322 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
2323 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
2324 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
2326 # controller 2: Become master.
2327 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
2328 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
2329 echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
2331 # controller 1: Try to become the master using a stale generation ID
2332 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
2333 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2334 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
2335 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2337 # controller 1: Become master using a valid generation ID
2338 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
2339 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
2340 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
2341 echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
2344 ovs-appctl -t `pwd`/c$i ofctl/barrier
2345 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):"
2351 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2353 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2358 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2359 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
2360 dnl controllers despite the spec) as meaning a packet that was generated
2361 dnl by the controller.
2362 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
2364 ADD_OF_PORTS([br0], [1])
2366 # Start a monitor listening for packet-ins.
2367 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
2368 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2369 ovs-appctl -t ovs-ofctl ofctl/barrier
2370 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2371 AT_CAPTURE_FILE([monitor.log])
2373 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2374 AT_CHECK([ovs-ofctl packet-out br0 none controller,1 '0001020304050010203040501234'])
2375 AT_CHECK([ovs-ofctl packet-out br0 controller controller,1 '0001020304050010203040505678'])
2377 # Stop the monitor and check its output.
2378 ovs-appctl -t ovs-ofctl ofctl/barrier
2379 ovs-appctl -t ovs-ofctl exit
2381 ovs-ofctl dump-ports br0
2383 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2384 OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2385 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
2386 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2387 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
2394 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2395 dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
2396 dnl controllers despite the spec) as meaning a packet that was generated
2397 dnl by the controller.
2398 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
2401 # Start a monitor listening for packet-ins.
2402 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2403 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2404 ovs-appctl -t ovs-ofctl ofctl/barrier
2405 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2406 AT_CAPTURE_FILE([monitor.log])
2408 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2409 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
2410 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
2412 # Stop the monitor and check its output.
2413 ovs-appctl -t ovs-ofctl ofctl/barrier
2414 ovs-appctl -t ovs-ofctl exit
2416 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2417 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2418 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
2419 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2420 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
2421 OFPT_BARRIER_REPLY (OF1.2):
2427 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2428 dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some
2429 dnl controllers despite the spec) as meaning a packet that was generated
2430 dnl by the controller.
2431 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)])
2434 # Start a monitor listening for packet-ins.
2435 AT_CHECK([ovs-ofctl -O OpenFlow11 monitor br0 --detach --no-chdir --pidfile])
2436 ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080
2437 ovs-appctl -t ovs-ofctl ofctl/barrier
2438 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2439 AT_CAPTURE_FILE([monitor.log])
2441 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2442 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 none controller '0001020304050010203040501234'])
2443 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 4294967293 controller '0001020304050010203040505678'])
2445 # Stop the monitor and check its output.
2446 ovs-appctl -t ovs-ofctl ofctl/barrier
2447 ovs-appctl -t ovs-ofctl exit
2449 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2450 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2451 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
2452 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2453 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
2454 OFPT_BARRIER_REPLY (OF1.1):
2460 dnl This test checks that metadata is encoded in packet_in structures,
2461 dnl supported by NXAST.
2462 AT_SETUP([ofproto - packet-out with metadata (NXM)])
2465 # Start a monitor listening for packet-ins.
2466 AT_CHECK([ovs-ofctl -P nxm monitor br0 --detach --no-chdir --pidfile])
2467 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2468 ovs-appctl -t ovs-ofctl ofctl/barrier
2469 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2470 AT_CAPTURE_FILE([monitor.log])
2472 # Send a packet-out with a load action to set some metadata, and forward to controller
2473 AT_CHECK([ovs-ofctl packet-out br0 controller 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), load(0xaa->NXM_NX_PKT_MARK[[]]), controller' '0001020304050010203040501234'])
2475 # Stop the monitor and check its output.
2476 ovs-appctl -t ovs-ofctl ofctl/barrier
2477 ovs-appctl -t ovs-ofctl exit
2479 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2480 NXT_PACKET_IN: total_len=14 in_port=CONTROLLER metadata=0xfafafafa5a5a5a5a pkt_mark=0xaa (via action) data_len=14 (unbuffered)
2481 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
2488 dnl This test checks that metadata is encoded in packet_in structures,
2489 dnl supported by NXAST.
2490 AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
2493 # Start a monitor listening for packet-ins.
2494 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2495 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2496 ovs-appctl -t ovs-ofctl ofctl/barrier
2497 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2498 AT_CAPTURE_FILE([monitor.log])
2500 # Send a packet-out with a set-field action to set some metadata, and forward to controller
2501 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234'])
2503 # Stop the monitor and check its output.
2504 ovs-appctl -t ovs-ofctl ofctl/barrier
2505 ovs-appctl -t ovs-ofctl exit
2507 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2508 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY metadata=0xfafafafa5a5a5a5a (via action) data_len=14 (unbuffered)
2509 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
2510 OFPT_BARRIER_REPLY (OF1.2):
2516 dnl This test checks that metadata is encoded in packet_in structures,
2517 dnl supported by NXAST.
2518 AT_SETUP([ofproto - packet-out with metadata and dual set_field (OpenFlow 1.3)])
2521 # Start a monitor listening for packet-ins.
2522 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
2523 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
2524 ovs-appctl -t ovs-ofctl ofctl/barrier
2525 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2526 AT_CAPTURE_FILE([monitor.log])
2528 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
2529 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, set_field:0x6b->metadata, controller' '0001020304050010203040501234'])
2531 # Stop the monitor and check its output.
2532 ovs-appctl -t ovs-ofctl ofctl/barrier
2533 ovs-appctl -t ovs-ofctl exit
2535 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2536 OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY metadata=0x6b (via action) data_len=14 (unbuffered)
2537 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
2538 OFPT_BARRIER_REPLY (OF1.3):
2544 dnl This test checks that tunnel metadata is encoded in packet_in structures.
2545 AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
2548 # Start a monitor listening for packet-ins.
2549 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2550 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2551 ovs-appctl -t ovs-ofctl ofctl/barrier
2552 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2553 AT_CAPTURE_FILE([monitor.log])
2555 # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
2556 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'])
2558 # Stop the monitor and check its output.
2559 ovs-appctl -t ovs-ofctl ofctl/barrier
2560 ovs-appctl -t ovs-ofctl exit
2562 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2563 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)
2564 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
2565 OFPT_BARRIER_REPLY (OF1.2):
2571 m4_divert_push([PREPARE_TESTS])
2572 # Sorts groups of lines that start with a space, without moving them
2573 # past the nearest line that does not start with a space.
2583 print $_ foreach sort(@buffer);
2588 print $_ foreach sort(@buffer);
2591 m4_divert_pop([PREPARE_TESTS])
2593 AT_SETUP([ofproto - flow monitoring])
2594 AT_KEYWORDS([monitor])
2597 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
2599 # Start a monitor watching the flow table and check the initial reply.
2600 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
2601 AT_CAPTURE_FILE([monitor.log])
2602 ovs-appctl -t ovs-ofctl ofctl/barrier
2603 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2604 [NXST_FLOW_MONITOR reply:
2605 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
2609 # Add, delete, and modify some flows and check the updates.
2610 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2611 ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
2612 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
2613 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
2614 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
2615 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
2616 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
2617 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
2618 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
2619 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
2620 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
2621 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
2622 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
2623 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
2624 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
2625 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
2626 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
2627 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
2628 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
2629 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
2630 ovs-ofctl add-flow br0 in_port=0,actions=output:23
2631 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
2632 ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
2633 ovs-ofctl del-flows br0 dl_vlan=123
2634 ovs-ofctl del-flows br0
2635 ovs-appctl -t ovs-ofctl ofctl/barrier
2636 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
2637 [NXST_FLOW_MONITOR reply (xid=0x0):
2638 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
2639 NXST_FLOW_MONITOR reply (xid=0x0):
2640 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
2641 NXST_FLOW_MONITOR reply (xid=0x0):
2642 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
2643 NXST_FLOW_MONITOR reply (xid=0x0):
2644 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
2645 NXST_FLOW_MONITOR reply (xid=0x0):
2646 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
2647 NXST_FLOW_MONITOR reply (xid=0x0):
2648 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
2649 NXST_FLOW_MONITOR reply (xid=0x0):
2650 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
2651 NXST_FLOW_MONITOR reply (xid=0x0):
2652 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2653 NXST_FLOW_MONITOR reply (xid=0x0):
2654 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
2655 NXST_FLOW_MONITOR reply (xid=0x0):
2656 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
2657 NXST_FLOW_MONITOR reply (xid=0x0):
2658 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
2659 NXST_FLOW_MONITOR reply (xid=0x0):
2660 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
2661 NXST_FLOW_MONITOR reply (xid=0x0):
2662 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
2663 NXST_FLOW_MONITOR reply (xid=0x0):
2664 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
2665 NXST_FLOW_MONITOR reply (xid=0x0):
2666 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
2667 NXST_FLOW_MONITOR reply (xid=0x0):
2668 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2669 NXST_FLOW_MONITOR reply (xid=0x0):
2670 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
2671 NXST_FLOW_MONITOR reply (xid=0x0):
2672 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
2673 NXST_FLOW_MONITOR reply (xid=0x0):
2674 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
2675 NXST_FLOW_MONITOR reply (xid=0x0):
2676 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
2677 NXST_FLOW_MONITOR reply (xid=0x0):
2678 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
2679 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2680 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2681 NXST_FLOW_MONITOR reply (xid=0x0):
2682 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
2683 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2684 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2685 NXST_FLOW_MONITOR reply (xid=0x0):
2686 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
2687 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2688 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2689 NXST_FLOW_MONITOR reply (xid=0x0):
2690 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
2691 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
2692 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
2693 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2694 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
2695 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
2696 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
2697 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
2698 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
2699 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
2700 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2704 # Check that our own changes are reported as full updates.
2705 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2706 ovs-ofctl add-flow br0 in_port=1,actions=output:2
2707 ovs-ofctl add-flow br0 in_port=2,actions=output:1
2708 ovs-appctl -t ovs-ofctl ofctl/barrier
2709 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
2710 ovs-appctl -t ovs-ofctl ofctl/barrier
2711 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
2713 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
2714 [NXST_FLOW_MONITOR reply (xid=0x0):
2715 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
2716 NXST_FLOW_MONITOR reply (xid=0x0):
2717 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
2719 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
2720 NXST_FLOW_MONITOR reply (xid=0x0):
2721 event=DELETED reason=delete table=0 cookie=0 in_port=1 actions=output:2
2722 event=DELETED reason=delete table=0 cookie=0 in_port=2 actions=output:1
2726 ovs-appctl -t ovs-ofctl exit
2730 AT_SETUP([ofproto - flow monitoring with !own])
2731 AT_KEYWORDS([monitor])
2734 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
2736 # Start a monitor watching the flow table and check the initial reply.
2737 ovs-ofctl monitor br0 watch:\!own --detach --no-chdir --pidfile >monitor.log 2>&1
2738 AT_CAPTURE_FILE([monitor.log])
2739 ovs-appctl -t ovs-ofctl ofctl/barrier
2740 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2741 [NXST_FLOW_MONITOR reply:
2742 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
2746 # Check that our own changes are reported as abbreviations.
2747 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2748 ovs-ofctl add-flow br0 in_port=1,actions=output:2
2749 ovs-ofctl add-flow br0 in_port=2,actions=output:1
2750 ovs-appctl -t ovs-ofctl ofctl/barrier
2751 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
2752 ovs-appctl -t ovs-ofctl ofctl/barrier
2753 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
2755 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2756 [NXST_FLOW_MONITOR reply (xid=0x0):
2757 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
2758 NXST_FLOW_MONITOR reply (xid=0x0):
2759 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
2761 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
2762 NXST_FLOW_MONITOR reply (xid=0x0):
2763 event=ABBREV xid=0x12345678
2767 ovs-appctl -t ovs-ofctl exit
2771 AT_SETUP([ofproto - flow monitoring with out_port])
2772 AT_KEYWORDS([monitor])
2775 ovs-ofctl add-flow br0 in_port=0,dl_vlan=121,actions=output:1
2776 ovs-ofctl add-flow br0 in_port=0,dl_vlan=122,actions=output:1
2777 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:2
2779 # Start a monitor watching the flow table and check the initial reply.
2780 ovs-ofctl monitor br0 watch:out_port=2 --detach --no-chdir --pidfile >monitor.log 2>&1
2781 AT_CAPTURE_FILE([monitor.log])
2782 ovs-appctl -t ovs-ofctl ofctl/barrier
2783 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2784 [NXST_FLOW_MONITOR reply:
2785 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
2789 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2791 # Add, modify flows and check the updates.
2792 ovs-ofctl mod-flows br0 dl_vlan=121,actions=drop
2793 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1,output:2
2794 ovs-appctl -t ovs-ofctl ofctl/barrier
2796 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:1,output:2
2797 ovs-appctl -t ovs-ofctl ofctl/barrier
2799 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1
2800 ovs-appctl -t ovs-ofctl ofctl/barrier
2801 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:2
2802 ovs-appctl -t ovs-ofctl ofctl/barrier
2804 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2805 [NXST_FLOW_MONITOR reply (xid=0x0):
2806 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1,output:2
2808 NXST_FLOW_MONITOR reply (xid=0x0):
2809 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1,output:2
2811 NXST_FLOW_MONITOR reply (xid=0x0):
2812 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1
2814 NXST_FLOW_MONITOR reply (xid=0x0):
2815 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
2819 ovs-appctl -t ovs-ofctl exit
2823 AT_SETUP([ofproto - flow monitoring pause and resume])
2824 AT_KEYWORDS([monitor])
2826 # The maximum socket receive buffer size is important for this test, which
2827 # tests behavior when the receive buffer overflows.
2828 if test -e /proc/sys/net/core/rmem_max; then
2830 rmem_max=`cat /proc/sys/net/core/rmem_max`
2831 elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
2834 # Don't know how to get maximum socket receive buffer on this OS
2837 # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
2838 # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
2839 queue_size=`expr $rmem_max + 128 \* 1024`
2840 echo rmem_max=$rmem_max queue_size=$queue_size
2842 # If there's too much queuing skip the test to avoid timing out.
2843 AT_SKIP_IF([test $rmem_max -gt 1048576])
2845 # Each flow update message takes up at least 48 bytes of space in queues
2846 # and in practice more than that.
2847 n_msgs=`expr $queue_size / 48`
2852 # Start a monitor watching the flow table, then make it block.
2853 ON_EXIT([kill `cat ovs-ofctl.pid`])
2854 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
2855 AT_CAPTURE_FILE([monitor.log])
2856 ovs-appctl -t ovs-ofctl ofctl/block
2858 # Add $n_msgs flows.
2859 (echo "in_port=2,actions=output:2"
2861 for ($i = 0; $i < '$n_msgs'; $i++) {
2862 print "cookie=1,reg1=$i,actions=drop\n";
2865 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2866 # Check that multipart flow dumps work properly:
2867 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
2868 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
2869 AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
2870 AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
2872 ovs-appctl -t ovs-ofctl ofctl/unblock
2874 # Wait for the connection resumed.
2875 # A barrier doesn't work for this purpose.
2876 # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html
2877 # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html
2878 OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log])
2880 ovs-appctl -t ovs-ofctl exit
2882 # Check that the flow monitor reported the same number of flows
2883 # added and deleted, but fewer than we actually added and deleted.
2884 adds=`grep -c 'ADDED.*reg1=' monitor.log`
2885 deletes=`grep -c 'DELETED.*reg1=' monitor.log`
2886 echo adds=$adds deletes=$deletes
2887 AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
2888 AT_CHECK([test $adds = $deletes])
2890 # Check that the flow monitor reported everything in the expected order:
2892 # event=ADDED table=0 cookie=0x1 reg1=0x22
2894 # NXT_FLOW_MONITOR_PAUSED:
2896 # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2898 # event=ADDED table=0 cookie=0x3 in_port=1
2899 # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
2900 # NXT_FLOW_MONITOR_RESUMED:
2902 # except that, between the PAUSED and RESUMED, the order of the ADDED
2903 # and MODIFIED lines lines depends on hash order, that is, it varies
2904 # as we change the hash function or change architecture. Therefore,
2905 # we use a couple of tests below to accept both orders.
2906 AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
2909 /NXT_FLOW_MONITOR_PAUSED:/p
2910 /NXT_FLOW_MONITOR_RESUMED:/p
2911 ' > monitor.log.subset])
2912 AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
2913 event=ADDED table=0 cookie=0x1 reg1=0x22
2914 NXT_FLOW_MONITOR_PAUSED:
2915 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2916 event=ADDED table=0 cookie=0x3 in_port=1
2917 NXT_FLOW_MONITOR_RESUMED:
2919 AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
2920 NXT_FLOW_MONITOR_PAUSED:
2921 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2922 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
2923 NXT_FLOW_MONITOR_RESUMED:
2929 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
2930 AT_KEYWORDS([monitor])
2933 # Start a monitor, use the required protocol version
2934 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2935 AT_CAPTURE_FILE([monitor.log])
2937 # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a)
2938 ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a
2939 ovs-appctl -t ovs-ofctl ofctl/barrier
2941 # Check default setting
2942 read -r -d '' expected <<'EOF'
2945 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
2946 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
2947 OFPT_GET_ASYNC_REPLY (OF1.3):
2949 PACKET_IN: no_match action
2950 PORT_STATUS: add delete modify
2951 FLOW_REMOVED: idle hard delete
2955 PORT_STATUS: add delete modify
2957 OFPT_BARRIER_REPLY (OF1.3):
2963 AT_SETUP([ofproto - ofport_request])
2965 ADD_OF_PORTS([br0], [1], [2], [3])
2967 set_and_check_specific_ofports () {
2968 ovs-vsctl set Interface p1 ofport_request="$1" -- \
2969 set Interface p2 ofport_request="$2" -- \
2970 set Interface p3 ofport_request="$3"
2971 ofports=`ovs-vsctl get Interface p1 ofport -- \
2972 get Interface p2 ofport -- \
2973 get Interface p3 ofport`
2974 AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
2977 for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
2978 for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
2979 echo -----------------------------------------------------------
2980 echo "Check changing port numbers from $pre to $post"
2981 set_and_check_specific_ofports $pre
2982 set_and_check_specific_ofports $post
2986 ovs-vsctl del-port p3
2988 set_and_check_poorly_specified_ofports () {
2989 ovs-vsctl set Interface p1 ofport_request="$1" -- \
2990 set Interface p2 ofport_request="$2"
2991 p1=`ovs-vsctl get Interface p1 ofport`
2992 p2=`ovs-vsctl get Interface p2 ofport`
2995 AT_CHECK([test "$p1" != "$p2"])
2996 if test "$1" = "$2" && test "$1" != '[[]]'; then
2997 # One port number must be the requested one.
2998 AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
2999 # The other port number must be different (already tested above).
3001 AT_CHECK([test "$1" = '[[]]' || test "$p1" == "$1"])
3002 AT_CHECK([test "$2" = '[[]]' || test "$p2" == "$2"])
3005 for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
3007 for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
3009 echo -----------------------------------------------------------
3010 echo "Check changing port numbers from $pre to $post"
3011 set_and_check_poorly_specified_ofports $pre
3012 set_and_check_poorly_specified_ofports $post
3019 AT_SETUP([ofproto - bundles, open (OpenFlow 1.4)])
3020 AT_KEYWORDS([monitor])
3023 # Start a monitor, use the required protocol version
3024 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3025 AT_CAPTURE_FILE([monitor.log])
3027 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
3028 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
3029 ovs-appctl -t ovs-ofctl ofctl/barrier
3030 ovs-appctl -t ovs-ofctl exit
3032 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
3033 send: OFPT_BUNDLE_CONTROL (OF1.4):
3034 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3035 OFPT_BUNDLE_CONTROL (OF1.4):
3036 bundle_id=0x1 type=OPEN_REPLY flags=0
3037 OFPT_BARRIER_REPLY (OF1.4):
3043 AT_SETUP([ofproto - bundles, double open (OpenFlow 1.4)])
3044 AT_KEYWORDS([monitor])
3047 # Start a monitor, use the required protocol version
3048 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3049 AT_CAPTURE_FILE([monitor.log])
3051 # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
3052 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
3053 ovs-appctl -t ovs-ofctl ofctl/barrier
3054 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
3055 ovs-appctl -t ovs-ofctl ofctl/barrier
3056 ovs-appctl -t ovs-ofctl exit
3058 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3059 send: OFPT_BUNDLE_CONTROL (OF1.4):
3060 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3061 OFPT_BUNDLE_CONTROL (OF1.4):
3062 bundle_id=0x1 type=OPEN_REPLY flags=0
3063 OFPT_BARRIER_REPLY (OF1.4):
3064 send: OFPT_BUNDLE_CONTROL (OF1.4):
3065 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3066 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3067 OFPT_BUNDLE_CONTROL (OF1.4):
3068 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3069 OFPT_BARRIER_REPLY (OF1.4):
3075 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)])
3076 AT_KEYWORDS([monitor])
3079 # Start a monitor, use the required protocol version
3080 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3081 AT_CAPTURE_FILE([monitor.log])
3083 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
3084 ovs-appctl -t ovs-ofctl ofctl/barrier
3085 ovs-appctl -t ovs-ofctl exit
3087 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3088 send: OFPT_BUNDLE_CONTROL (OF1.4):
3089 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3090 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3091 OFPT_BUNDLE_CONTROL (OF1.4):
3092 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3093 OFPT_BARRIER_REPLY (OF1.4):
3099 AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)])
3100 AT_KEYWORDS([monitor])
3103 # Start a monitor, use the required protocol version
3104 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3105 AT_CAPTURE_FILE([monitor.log])
3107 # Open, Close, Close
3108 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
3109 ovs-appctl -t ovs-ofctl ofctl/barrier
3110 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
3111 ovs-appctl -t ovs-ofctl ofctl/barrier
3112 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
3113 ovs-appctl -t ovs-ofctl ofctl/barrier
3114 ovs-appctl -t ovs-ofctl exit
3116 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3117 send: OFPT_BUNDLE_CONTROL (OF1.4):
3118 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3119 OFPT_BUNDLE_CONTROL (OF1.4):
3120 bundle_id=0x1 type=OPEN_REPLY flags=0
3121 OFPT_BARRIER_REPLY (OF1.4):
3122 send: OFPT_BUNDLE_CONTROL (OF1.4):
3123 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3124 OFPT_BUNDLE_CONTROL (OF1.4):
3125 bundle_id=0x1 type=CLOSE_REPLY flags=0
3126 OFPT_BARRIER_REPLY (OF1.4):
3127 send: OFPT_BUNDLE_CONTROL (OF1.4):
3128 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3129 OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED
3130 OFPT_BUNDLE_CONTROL (OF1.4):
3131 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3132 OFPT_BARRIER_REPLY (OF1.4):
3138 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)])
3139 AT_KEYWORDS([monitor])
3142 # Start a monitor, use the required protocol version
3143 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3144 AT_CAPTURE_FILE([monitor.log])
3146 # Open, Close, Close
3147 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
3148 ovs-appctl -t ovs-ofctl ofctl/barrier
3149 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3150 ovs-appctl -t ovs-ofctl ofctl/barrier
3151 ovs-appctl -t ovs-ofctl exit
3153 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3154 send: OFPT_BUNDLE_CONTROL (OF1.4):
3155 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3156 OFPT_BUNDLE_CONTROL (OF1.4):
3157 bundle_id=0x1 type=OPEN_REPLY flags=0
3158 OFPT_BARRIER_REPLY (OF1.4):
3159 send: OFPT_BUNDLE_CONTROL (OF1.4):
3160 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3161 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
3162 OFPT_BUNDLE_CONTROL (OF1.4):
3163 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3164 OFPT_BARRIER_REPLY (OF1.4):
3170 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)])
3171 AT_KEYWORDS([monitor])
3174 # Start a monitor, use the required protocol version
3175 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3176 AT_CAPTURE_FILE([monitor.log])
3178 # Open, Close, Close
3179 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01"
3180 ovs-appctl -t ovs-ofctl ofctl/barrier
3181 ovs-appctl -t ovs-ofctl exit
3183 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3184 send: OFPT_BUNDLE_CONTROL (OF1.4):
3185 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
3186 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3187 OFPT_BUNDLE_CONTROL (OF1.4):
3188 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
3189 OFPT_BARRIER_REPLY (OF1.4):
3195 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)])
3196 AT_KEYWORDS([monitor])
3199 # Start a monitor, use the required protocol version
3200 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3201 AT_CAPTURE_FILE([monitor.log])
3203 # Open, Close, Close
3204 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
3205 ovs-appctl -t ovs-ofctl ofctl/barrier
3206 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02"
3207 ovs-appctl -t ovs-ofctl ofctl/barrier
3208 ovs-appctl -t ovs-ofctl exit
3210 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3211 send: OFPT_BUNDLE_CONTROL (OF1.4):
3212 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3213 OFPT_BUNDLE_CONTROL (OF1.4):
3214 bundle_id=0x1 type=OPEN_REPLY flags=0
3215 OFPT_BARRIER_REPLY (OF1.4):
3216 send: OFPT_BUNDLE_CONTROL (OF1.4):
3217 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
3218 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
3219 OFPT_BUNDLE_CONTROL (OF1.4):
3220 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
3221 OFPT_BARRIER_REPLY (OF1.4):
3227 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)])
3228 AT_KEYWORDS([monitor])
3231 # Start a monitor, use the required protocol version
3232 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3233 AT_CAPTURE_FILE([monitor.log])
3235 # Open, Close, Close
3236 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 01"
3237 ovs-appctl -t ovs-ofctl ofctl/barrier
3238 ovs-appctl -t ovs-ofctl exit
3240 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3241 send: OFPT_BUNDLE_CONTROL (OF1.4):
3242 bundle_id=0x1 type=DISCARD_REQUEST flags=atomic
3243 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3244 OFPT_BUNDLE_CONTROL (OF1.4):
3245 bundle_id=0x1 type=DISCARD_REQUEST flags=atomic
3246 OFPT_BARRIER_REPLY (OF1.4):