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):
318 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=0xfffffff0],
319 [1], [], [ovs-ofctl: invalid group id 4294967280
324 dnl This is really bare-bones.
325 dnl It at least checks request and reply serialization and deserialization.
326 dnl Actions definition listed in both supported formats (w/ actions=)
327 AT_SETUP([ofproto - add indirect group])
329 dnl indirect group must have exactly one bucket
330 AT_DATA([stderr], [dnl
331 OFPT_ERROR (OF1.1) (xid=0x2): OFPGMFC_INVALID_GROUP
332 OFPT_GROUP_MOD (OF1.1) (xid=0x2): ***decode error: OFPGMFC_INVALID_GROUP***
334 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1234,type=indirect'], [1], , [stderr])
335 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1235,type=indirect,bucket=output:10'])
336 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1236,type=indirect,bucket=output:10,bucket=output:11'], [1], , [stderr])
340 dnl This is really bare-bones.
341 dnl It at least checks request and reply serialization and deserialization.
342 dnl Actions definition listed in both supported formats (w/ actions=)
343 AT_SETUP([ofproto - del group (OpenFlow 1.5)])
345 AT_DATA([groups.txt], [dnl
346 group_id=1233,type=select,selection_method=hash,bucket=output:10,bucket=output:11
347 group_id=1234,type=select,selection_method=hash,bucket=output:10,bucket=output:11
348 group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
350 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
351 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
352 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
353 OFPST_GROUP_DESC reply (OF1.5):
354 group_id=1234,type=select,selection_method=hash,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
361 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
363 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
364 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
365 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
366 OFPST_GROUP_DESC reply (OF1.5):
367 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
368 group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
370 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0], [0])
371 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
372 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
373 OFPST_GROUP_DESC reply (OF1.5):
378 dnl This is really bare-bones.
379 dnl It at least checks request and reply serialization and deserialization.
380 AT_SETUP([ofproto - del group deletes flows])
382 AT_DATA([groups.txt], [dnl
383 group_id=1234,type=all,bucket=output:10
384 group_id=1235,type=all,bucket=output:10
386 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
387 AT_DATA([flows.txt], [dnl
388 tcp actions=group:1234
389 udp actions=group:1235
391 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt])
392 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
394 tcp actions=group:1234
395 udp actions=group:1235
396 OFPST_FLOW reply (OF1.1):
398 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
399 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
401 udp actions=group:1235
402 OFPST_FLOW reply (OF1.1):
404 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
405 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
407 udp actions=group:1235
408 OFPST_FLOW reply (OF1.1):
410 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0])
411 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
413 OFPST_FLOW reply (OF1.1):
418 dnl This is really bare-bones.
419 dnl It at least checks request and reply serialization and deserialization.
420 dnl Actions definition listed in both supported formats (w/ actions=)
421 AT_SETUP([ofproto - insert buckets])
423 AT_DATA([groups.txt], [dnl
424 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
426 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
427 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
428 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
429 OFPST_GROUP_DESC reply (OF1.5):
430 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
432 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1])
433 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
434 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
435 OFPST_GROUP_DESC reply (OF1.5):
436 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
438 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15])
439 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
440 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
441 OFPST_GROUP_DESC reply (OF1.5):
442 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
444 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15])
445 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
446 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
447 OFPST_GROUP_DESC reply (OF1.5):
448 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
450 AT_DATA([buckets.txt], [dnl
451 group_id=1234,command_bucket_id=11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13
453 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 - < buckets.txt])
454 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
455 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
456 OFPST_GROUP_DESC reply (OF1.5):
457 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
459 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15,bucket=bucket_id:20,actions=output:20,bucket=bucket_id:21,actions=output:21])
460 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
461 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
462 OFPST_GROUP_DESC reply (OF1.5):
463 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:20,actions=output:20,bucket=bucket_id:21,actions=output:21
467 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=0xffffff01,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [],
468 [ovs-ofctl: invalid command bucket id 4294967041
470 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [],
471 [ovs-ofctl: insert-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
476 dnl This is really bare-bones.
477 dnl It at least checks request and reply serialization and deserialization.
478 dnl Actions definition listed in both supported formats (w/ actions=)
479 AT_SETUP([ofproto - remove buckets])
481 AT_DATA([groups.txt], [dnl
482 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:16,actions=output:16
484 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
485 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
486 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
487 OFPST_GROUP_DESC reply (OF1.5):
488 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:16,actions=output:16
490 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
491 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
492 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
493 OFPST_GROUP_DESC reply (OF1.5):
494 group_id=1234,type=all,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:16,actions=output:16
496 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
497 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
498 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
499 OFPST_GROUP_DESC reply (OF1.5):
500 group_id=1234,type=all,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
502 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=13])
503 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
504 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
505 OFPST_GROUP_DESC reply (OF1.5):
506 group_id=1234,type=all,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
508 AT_DATA([buckets.txt], [dnl
511 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 - < buckets.txt])
512 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
513 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
514 OFPST_GROUP_DESC reply (OF1.5):
515 group_id=1234,type=all
517 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
518 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
519 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=all])
520 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=1], [1], [], [stderr])
521 AT_CHECK([cat stderr | ofctl_strip], [0], [dnl
522 OFPT_ERROR (OF1.5): OFPGMFC_UNKNOWN_BUCKET
523 OFPT_GROUP_MOD (OF1.5):
524 REMOVE_BUCKET command_bucket_id:1,group_id=1234
527 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [],
528 [ovs-ofctl: remove-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
533 dnl This is really bare-bones.
534 dnl It at least checks request and reply serialization and deserialization.
535 AT_SETUP([ofproto - flow mod checks group availability])
537 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
538 AT_DATA([flows.txt], [dnl
539 tcp actions=group:1234
540 udp actions=group:1235
542 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
543 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'], [1], [], [stderr])
545 # The output should look like this:
547 # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................|
548 # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................|
549 # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................|
550 # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............|
552 # This 'sed' command captures the error message but drops details.
553 AT_CHECK([sed '/truncated/d
554 /^000000.0/d' stderr | STRIP_XIDS], [0],
555 [OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP
556 OFPT_FLOW_MOD (OF1.1):
561 dnl This is really bare-bones.
562 dnl It at least checks request and reply serialization and deserialization.
563 AT_SETUP([ofproto - group description])
565 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10], [0], [stdout])
566 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
567 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
568 OFPST_GROUP_DESC reply (OF1.1):
569 group_id=1234,type=all,bucket=actions=output:10
574 dnl This is really bare-bones.
575 dnl It at least checks request and reply serialization and deserialization.
576 AT_SETUP([ofproto - group description])
578 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
579 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
580 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
581 OFPST_GROUP_DESC reply (OF1.1):
582 group_id=1234,type=all,bucket=actions=output:10
587 dnl This is really bare-bones.
588 dnl It at least checks request and reply serialization and deserialization.
589 AT_SETUP([ofproto - group features])
591 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout])
592 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
593 OFPST_GROUP_FEATURES reply (OF1.2):
598 max_groups=0xffffff00
599 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
601 max_groups=0xffffff00
602 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
604 max_groups=0xffffff00
605 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
607 max_groups=0xffffff00
608 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
613 dnl This is really bare-bones.
614 dnl It at least checks request and reply serialization and deserialization.
615 AT_SETUP([ofproto - group stats (OpenFlow 1.1)])
617 AT_DATA([groups.txt], [dnl
618 group_id=1234,type=all,bucket=output:10
619 group_id=1235,type=all,bucket=output:10
621 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
622 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
623 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
624 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
625 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
626 OFPST_GROUP reply (OF1.1):
628 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0], [0], [stdout])
629 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
630 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
631 group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
632 OFPST_GROUP reply (OF1.1):
637 dnl This is really bare-bones.
638 dnl It at least checks request and reply serialization and deserialization.
639 AT_SETUP([ofproto - group stats (OpenFlow 1.3)])
641 AT_DATA([groups.txt], [dnl
642 group_id=1234,type=all,bucket=output:10
643 group_id=1235,type=all,bucket=output:10
645 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
646 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-flow br0 'tcp actions=group:1234'])
647 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
648 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
649 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
650 OFPST_GROUP reply (OF1.3):
652 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0], [0], [stdout])
653 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
654 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
655 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
656 OFPST_GROUP reply (OF1.3):
661 dnl This is really bare-bones.
662 dnl It at least checks request and reply serialization and deserialization.
663 AT_SETUP([ofproto - group stats (OpenFlow 1.5)])
665 AT_DATA([groups.txt], [dnl
666 group_id=1234,type=all,bucket=output:10
667 group_id=1235,type=all,bucket=output:10
669 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
670 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-flow br0 'tcp actions=group:1234'])
671 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
672 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
673 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
674 OFPST_GROUP reply (OF1.5):
676 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0], [0], [stdout])
677 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
678 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
679 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
680 OFPST_GROUP reply (OF1.5):
685 dnl This found a use-after-free error in bridge destruction in the
686 dnl presence of groups.
687 AT_SETUP([ofproto - group add then bridge delete (OpenFlow 1.3)])
689 AT_DATA([groups.txt], [dnl
690 group_id=1234,type=all,bucket=output:10
691 group_id=1235,type=all,bucket=output:10
693 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
694 AT_CHECK([ovs-vsctl del-br br0])
698 AT_SETUP([ofproto - mod-port (OpenFlow 1.0)])
700 for command_config_state in \
702 'noflood NO_FLOOD 0' \
703 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
704 'flood PORT_DOWN LINK_DOWN' \
705 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
706 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
707 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
708 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
709 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
713 set $command_config_state
714 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
715 AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
716 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
717 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
718 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
719 n_tables:254, n_buffers:256
720 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
721 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
722 LOCAL(br0): addr:aa:55:aa:55:00:00
725 speed: 0 Mbps now, 0 Mbps max
726 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
732 AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
734 for command_config_state in \
736 'down PORT_DOWN LINK_DOWN' \
737 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
738 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
739 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
740 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
741 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
745 set $command_config_state
746 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
747 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
748 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout])
749 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
750 OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210
751 n_tables:254, n_buffers:256
752 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
753 LOCAL(br0): addr:aa:55:aa:55:00:00
756 speed: 0 Mbps now, 0 Mbps max
757 OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0
763 AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
765 for command_config_state in \
767 'down PORT_DOWN LINK_DOWN' \
768 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
769 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
770 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
771 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
772 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
776 set $command_config_state
777 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
778 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command])
779 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn show br0], [0], [stdout])
780 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
781 OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210
782 n_tables:254, n_buffers:256
783 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
784 OFPST_PORT_DESC reply (OF1.4):
785 LOCAL(br0): addr:aa:55:aa:55:00:00
788 speed: 0 Mbps now, 0 Mbps max
789 OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0
795 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
797 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
799 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -])
800 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
801 AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3])
802 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
803 in_port=1 actions=output:2
804 in_port=2 actions=output:1
805 table=1, in_port=4 actions=output:3
808 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
809 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
811 AT_CHECK([ovs-ofctl del-flows br0])
812 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
817 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
819 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
821 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -])
822 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2])
823 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3])
824 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
825 in_port=1 actions=output:2
826 in_port=2 actions=output:1
827 table=1, in_port=4 actions=output:3
830 AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
831 OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
833 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
834 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
839 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)])
841 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
843 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -])
844 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2])
845 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3])
846 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
847 in_port=1 actions=output:2
848 in_port=2 actions=output:1
849 table=1, in_port=4 actions=output:3
850 OFPST_FLOW reply (OF1.1):
852 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
853 OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2
855 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
856 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
857 table=1, in_port=4 actions=output:3
862 AT_SETUP([ofproto - flow_mod negative test (OpenFlow 1.1)])
864 [set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13])
865 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2])
867 # The error message here actually comes from ovs-ofctl, not from ovs-vswitchd,
868 # but at least it's the same code in ofpacts_check() that issues the error.
869 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1],
871 [ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID)
876 AT_SETUP([ofproto - set-field flow_mod commands (NXM)])
878 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop])
879 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])
880 AT_CHECK([ovs-ofctl add-flow br0 icmp6,icmp_type=136,table=1,in_port=3,actions=set_field:fe80:8675:3097:890a:a6ba:dbff:f00d:59fa-\>nd_target,set_field:cc:dd:ee:ff:00:11-\>nd_tll])
881 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
882 table=1, icmp6,in_port=3,icmp_type=136 actions=load:0xa6badbfff00d59fa->NXM_NX_ND_TARGET[[0..63]],load:0xfe8086753097890a->NXM_NX_ND_TARGET[[64..127]],load:0xccddeeff0011->NXM_NX_ND_TLL[[]]
883 table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]]
889 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)])
891 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
893 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -])
894 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2])
895 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3])
896 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
897 in_port=1 actions=output:2
898 in_port=2 actions=output:1
899 table=1, in_port=4 actions=output:3
900 OFPST_FLOW reply (OF1.2):
902 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
903 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
908 AT_SETUP([ofproto - set-field flow_mod commands (OF1.2)])
910 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 ipv6,table=1,in_port=3,actions=drop])
911 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 ipv6,table=1,in_port=3,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa-\>ipv6_src])
912 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 icmp6,icmp_type=136,table=1,in_port=3,actions=set_field:fe80:8675:3097:890a:a6ba:dbff:f00d:59fa-\>nd_target,set_field:cc:dd:ee:ff:00:11-\>nd_tll])
913 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
914 table=1, icmp6,in_port=3,icmp_type=136 actions=set_field:fe80:8675:3097:890a:a6ba:dbff:f00d:59fa->nd_target,set_field:cc:dd:ee:ff:00:11->nd_tll
915 table=1, ipv6,in_port=3 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
916 OFPST_FLOW reply (OF1.2):
921 AT_SETUP([ofproto - dump flows with cookie])
923 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
924 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
925 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
926 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
927 cookie=0x1, in_port=1 actions=output:1
928 cookie=0x2, in_port=2 actions=output:1
929 cookie=0x3, in_port=3 actions=output:1
932 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
933 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
935 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl
936 cookie=0x3, in_port=3 actions=output:1
939 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | STRIP_XIDS], [0], [dnl
940 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
945 AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)])
947 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1])
948 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
949 cookie=0x1, in_port=1 actions=output:1
953 AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1])
954 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
955 cookie=0x2, in_port=1 actions=output:1
961 AT_SETUP([ofproto - mod flow with cookie change (NXM)])
963 AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1])
964 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
965 cookie=0x1, in_port=1 actions=output:1
969 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1])
970 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
971 cookie=0x2, in_port=1 actions=output:1
977 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)])
979 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
980 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
981 cookie=0x1, in_port=1 actions=output:1
982 OFPST_FLOW reply (OF1.1):
984 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1])
985 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
986 cookie=0x1, in_port=1 actions=output:1
987 OFPST_FLOW reply (OF1.1):
992 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
993 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)])
995 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
996 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
997 cookie=0x1, in_port=1 actions=output:1
998 OFPST_FLOW reply (OF1.2):
1001 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1])
1002 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1003 cookie=0x1, in_port=1 actions=output:1
1004 OFPST_FLOW reply (OF1.2):
1009 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)])
1011 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1012 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
1013 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
1014 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1015 cookie=0x1, in_port=1 actions=output:1
1016 cookie=0x1, in_port=2 actions=output:1
1017 cookie=0x2, in_port=3 actions=output:1
1021 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4])
1022 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1023 cookie=0x1, in_port=1 actions=output:4
1024 cookie=0x1, in_port=2 actions=output:4
1025 cookie=0x2, in_port=3 actions=output:1
1031 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)])
1033 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1034 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1])
1035 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1])
1036 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1037 cookie=0x1, in_port=1 actions=output:1
1038 cookie=0x1, in_port=2 actions=output:1
1039 cookie=0x2, in_port=3 actions=output:1
1040 OFPST_FLOW reply (OF1.1):
1043 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4])
1044 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1045 cookie=0x1, in_port=1 actions=output:4
1046 cookie=0x1, in_port=2 actions=output:4
1047 cookie=0x2, in_port=3 actions=output:1
1048 OFPST_FLOW reply (OF1.1):
1053 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)])
1055 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1056 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1])
1057 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1])
1058 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1059 cookie=0x1, in_port=1 actions=output:1
1060 cookie=0x1, in_port=2 actions=output:1
1061 cookie=0x2, in_port=3 actions=output:1
1062 OFPST_FLOW reply (OF1.2):
1065 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4])
1066 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1067 cookie=0x1, in_port=1 actions=output:4
1068 cookie=0x1, in_port=2 actions=output:4
1069 cookie=0x2, in_port=3 actions=output:1
1070 OFPST_FLOW reply (OF1.2):
1075 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
1076 AT_SETUP([ofproto - mod flows based on cookie mask with cookie change])
1078 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1079 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
1080 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
1081 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1082 cookie=0x1, in_port=1 actions=output:1
1083 cookie=0x1, in_port=2 actions=output:1
1084 cookie=0x2, in_port=3 actions=output:1
1088 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4])
1089 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1090 cookie=0x2, in_port=3 actions=output:1
1091 cookie=0x4, in_port=1 actions=output:4
1092 cookie=0x4, in_port=2 actions=output:4
1098 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM])
1100 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1])
1101 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1102 in_port=1 actions=output:1
1108 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1])
1110 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1])
1111 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1112 in_port=1 actions=output:1
1113 OFPST_FLOW reply (OF1.1):
1118 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2])
1120 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1])
1121 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1122 OFPST_FLOW reply (OF1.2):
1127 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM])
1129 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1])
1130 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1136 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1])
1138 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1139 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1140 OFPST_FLOW reply (OF1.1):
1145 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2])
1147 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1148 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1149 OFPST_FLOW reply (OF1.2):
1154 AT_SETUP([ofproto - del flows with cookies])
1156 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1157 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1158 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1159 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1160 cookie=0x1, in_port=1 actions=output:1
1161 cookie=0x2, in_port=2 actions=output:1
1162 cookie=0x3, in_port=3 actions=output:1
1166 AT_CHECK([ovs-ofctl del-flows br0])
1167 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1173 AT_SETUP([ofproto - del flows based on cookie])
1175 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1176 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1177 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1178 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1179 cookie=0x1, in_port=1 actions=output:1
1180 cookie=0x2, in_port=2 actions=output:1
1181 cookie=0x3, in_port=3 actions=output:1
1185 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1])
1186 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1187 cookie=0x1, in_port=1 actions=output:1
1188 cookie=0x2, in_port=2 actions=output:1
1194 AT_SETUP([ofproto - del flows based on cookie mask])
1196 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1197 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1198 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1199 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1200 cookie=0x1, in_port=1 actions=output:1
1201 cookie=0x2, in_port=2 actions=output:1
1202 cookie=0x3, in_port=3 actions=output:1
1205 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
1206 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1207 cookie=0x2, in_port=2 actions=output:1
1213 AT_SETUP([ofproto - del flows based on table id (NXM)])
1215 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1216 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1217 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1218 cookie=0x1, in_port=1 actions=output:1
1219 cookie=0x2, table=1, in_port=2 actions=output:1
1222 AT_CHECK([ovs-ofctl del-flows br0 table=0])
1223 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1224 cookie=0x2, table=1, in_port=2 actions=output:1
1227 AT_CHECK([ovs-ofctl del-flows br0 table=1])
1228 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1231 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1232 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1233 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1234 cookie=0x1, in_port=1 actions=output:1
1235 cookie=0x2, table=1, in_port=2 actions=output:1
1238 AT_CHECK([ovs-ofctl del-flows br0])
1239 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1245 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)])
1247 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1248 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1249 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1250 cookie=0x1, in_port=1 actions=output:1
1251 cookie=0x2, table=1, in_port=2 actions=output:1
1252 OFPST_FLOW reply (OF1.1):
1254 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0])
1255 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1256 cookie=0x2, table=1, in_port=2 actions=output:1
1257 OFPST_FLOW reply (OF1.1):
1259 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1])
1260 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1261 OFPST_FLOW reply (OF1.1):
1263 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1264 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1265 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1266 cookie=0x1, in_port=1 actions=output:1
1267 cookie=0x2, table=1, in_port=2 actions=output:1
1268 OFPST_FLOW reply (OF1.1):
1270 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
1271 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
1272 OFPST_FLOW reply (OF1.1):
1273 cookie=0x2, table=1, in_port=2 actions=output:1
1278 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)])
1280 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1281 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1282 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1283 cookie=0x1, in_port=1 actions=output:1
1284 cookie=0x2, table=1, in_port=2 actions=output:1
1285 OFPST_FLOW reply (OF1.2):
1287 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0])
1288 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1289 cookie=0x2, table=1, in_port=2 actions=output:1
1290 OFPST_FLOW reply (OF1.2):
1292 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1])
1293 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1294 OFPST_FLOW reply (OF1.2):
1296 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1297 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1298 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1299 cookie=0x1, in_port=1 actions=output:1
1300 cookie=0x2, table=1, in_port=2 actions=output:1
1301 OFPST_FLOW reply (OF1.2):
1303 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
1304 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1305 OFPST_FLOW reply (OF1.2):
1310 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)])
1312 # Check the default configuration.
1314 printf 'OFPST_TABLE reply (xid=0x2):
1316 active=0, lookup=0, matched=0
1319 in_port: exact match or wildcard
1320 eth_src: exact match or wildcard
1321 eth_dst: exact match or wildcard
1322 eth_type: exact match or wildcard
1323 vlan_vid: exact match or wildcard
1324 vlan_pcp: exact match or wildcard
1325 ip_src: exact match or wildcard
1326 ip_dst: exact match or wildcard
1327 nw_proto: exact match or wildcard
1328 nw_tos: exact match or wildcard
1329 tcp_src: exact match or wildcard
1330 tcp_dst: exact match or wildcard
1335 for i in `seq $1 $2`; do
1336 printf ' table %d ("table%d"): ditto\n' $i $i
1339 (head_table classifier; ditto 1 253) > expout
1340 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1341 # Change the configuration.
1344 -- --id=@t0 create Flow_Table name=main \
1345 -- --id=@t1 create Flow_Table flow-limit=1024 \
1346 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1347 | ${PERL} $srcdir/uuidfilt.pl],
1351 # Check that the configuration was updated.
1352 (head_table main; echo ' table 1 ("table1"):
1353 active=0, lookup=0, matched=0
1358 active=0, lookup=0, matched=0
1361 '; ditto 3 253) > expout
1362 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1366 dnl In-band and fail-open add "hidden rules" to table 0. These rules shouldn't
1367 dnl be visible to OpenFlow. This test checks that "dump-flows" and
1368 dnl "dump-tables" don't make them visible.
1369 AT_SETUP([ofproto - hidden rules not in table stats])
1370 # Use an IP address for a controller that won't actually exist: we
1371 # want to create in-band rules but we do not want to actually connect
1372 # to a controller (because that could mess about with our test). The
1373 # Class E range 240.0.0.0 - 255.255.255.255 seems like a good choice.
1374 OVS_VSWITCHD_START([set-controller br0 tcp:240.0.0.1:6653])
1375 for i in 1 2 3 4 5; do ovs-appctl time/warp 1000; done
1377 # Check that no hidden flows are visible in OpenFlow.
1378 AT_CHECK([ovs-ofctl dump-flows br0], [0], [NXST_FLOW reply (xid=0x4):
1381 # Check that some hidden flows related to 240.0.0.1 are actually in table 0.
1383 # We discard flows that mention table_id because we only want table 0 flows,
1384 # which in OVS is implied by the absence of a table_id.
1385 AT_CHECK([ovs-appctl bridge/dump-flows br0], [0], [stdout])
1386 AT_CHECK([test `grep '240\.0\.0\.1' stdout | grep -v table_id= | wc -l` -gt 0])
1388 # Check that dump-tables doesn't count the hidden flows.
1390 printf 'OFPST_TABLE reply (xid=0x2):
1392 active=0, lookup=0, matched=0
1395 in_port: exact match or wildcard
1396 eth_src: exact match or wildcard
1397 eth_dst: exact match or wildcard
1398 eth_type: exact match or wildcard
1399 vlan_vid: exact match or wildcard
1400 vlan_pcp: exact match or wildcard
1401 ip_src: exact match or wildcard
1402 ip_dst: exact match or wildcard
1403 nw_proto: exact match or wildcard
1404 nw_tos: exact match or wildcard
1405 tcp_src: exact match or wildcard
1406 tcp_dst: exact match or wildcard
1411 for i in `seq $1 $2`; do
1412 printf ' table %d ("table%d"): ditto\n' $i $i
1415 (head_table classifier; ditto 1 253) > expout
1416 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1417 OVS_VSWITCHD_STOP(["/240\.0\.0\.1/d"])
1420 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)])
1422 # Check the default configuration.
1424 printf 'OFPST_TABLE reply (OF1.2) (xid=0x2):
1426 active=0, lookup=0, matched=0
1427 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1430 instructions (table miss and others):
1431 instructions: apply_actions,clear_actions,write_actions,write_metadata,goto_table
1432 Write-Actions and Apply-Actions features:
1433 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
1434 supported on Set-Field: metadata in_port_oxm eth_src eth_dst vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ipv6_label ip_dscp nw_ecn arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst nd_target nd_sll nd_tll
1436 metadata: exact match or wildcard
1437 in_port_oxm: exact match or wildcard
1438 eth_src: exact match or wildcard
1439 eth_dst: exact match or wildcard
1440 eth_type: exact match or wildcard
1441 vlan_vid: exact match or wildcard
1442 vlan_pcp: exact match or wildcard
1443 mpls_label: exact match or wildcard
1444 mpls_tc: exact match or wildcard
1445 ip_src: exact match or wildcard
1446 ip_dst: exact match or wildcard
1447 ipv6_src: exact match or wildcard
1448 ipv6_dst: exact match or wildcard
1449 ipv6_label: exact match or wildcard
1450 nw_proto: exact match or wildcard
1451 ip_dscp: exact match or wildcard
1452 nw_ecn: exact match or wildcard
1453 arp_op: exact match or wildcard
1454 arp_spa: exact match or wildcard
1455 arp_tpa: exact match or wildcard
1456 arp_sha: exact match or wildcard
1457 arp_tha: exact match or wildcard
1458 tcp_src: exact match or wildcard
1459 tcp_dst: exact match or wildcard
1460 udp_src: exact match or wildcard
1461 udp_dst: exact match or wildcard
1462 sctp_src: exact match or wildcard
1463 sctp_dst: exact match or wildcard
1464 icmp_type: exact match or wildcard
1465 icmp_code: exact match or wildcard
1466 icmpv6_type: exact match or wildcard
1467 icmpv6_code: exact match or wildcard
1468 nd_target: exact match or wildcard
1469 nd_sll: exact match or wildcard
1470 nd_tll: exact match or wildcard
1475 for i in `seq $1 $2`; do
1476 printf ' table %d ("table%d"): ditto\n' $i $i
1480 printf ' table 253 ("table253"):
1481 active=0, lookup=0, matched=0
1482 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1485 instructions (table miss and others):
1486 instructions: apply_actions,clear_actions,write_actions,write_metadata
1491 (head_table classifier; ditto 1 252; tail_table) > expout
1492 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1493 # Change the configuration.
1496 -- --id=@t0 create Flow_Table name=main \
1497 -- --id=@t1 create Flow_Table flow-limit=1024 \
1498 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1499 | ${PERL} $srcdir/uuidfilt.pl],
1503 # Check that the configuration was updated.
1504 (head_table main; echo ' table 1 ("table1"):
1505 active=0, lookup=0, matched=0
1506 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1513 active=0, lookup=0, matched=0
1514 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1519 '; ditto 3 252; tail_table) > expout
1520 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1524 AT_SETUP([ofproto - table features (OpenFlow 1.3)])
1527 printf ' table 0 ("%s"):
1528 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1530 instructions (table miss and others):
1532 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata,goto_table
1533 Write-Actions and Apply-Actions features:
1534 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
1535 supported on Set-Field: tun_id tun_src tun_dst tun_flags tun_gbp_id tun_gbp_flags tun_metadata0 dnl
1536 tun_metadata1 tun_metadata2 tun_metadata3 tun_metadata4 tun_metadata5 tun_metadata6 tun_metadata7 tun_metadata8 tun_metadata9 tun_metadata10 tun_metadata11 tun_metadata12 tun_metadata13 tun_metadata14 tun_metadata15 tun_metadata16 tun_metadata17 tun_metadata18 tun_metadata19 tun_metadata20 tun_metadata21 tun_metadata22 tun_metadata23 tun_metadata24 tun_metadata25 tun_metadata26 tun_metadata27 tun_metadata28 tun_metadata29 tun_metadata30 tun_metadata31 tun_metadata32 tun_metadata33 tun_metadata34 tun_metadata35 tun_metadata36 tun_metadata37 tun_metadata38 tun_metadata39 tun_metadata40 tun_metadata41 tun_metadata42 tun_metadata43 tun_metadata44 tun_metadata45 tun_metadata46 tun_metadata47 tun_metadata48 tun_metadata49 tun_metadata50 tun_metadata51 tun_metadata52 tun_metadata53 tun_metadata54 tun_metadata55 tun_metadata56 tun_metadata57 tun_metadata58 tun_metadata59 tun_metadata60 tun_metadata61 tun_metadata62 tun_metadata63 dnl
1537 metadata in_port in_port_oxm pkt_mark ct_mark ct_label 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 ipv6_label nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst nd_target nd_sll nd_tll
1539 dp_hash: arbitrary mask
1540 recirc_id: exact match or wildcard
1541 conj_id: exact match or wildcard
1542 tun_id: arbitrary mask
1543 tun_src: arbitrary mask
1544 tun_dst: arbitrary mask
1545 tun_flags: arbitrary mask
1546 tun_gbp_id: arbitrary mask
1547 tun_gbp_flags: arbitrary mask
1548 tun_metadata0: arbitrary mask
1549 tun_metadata1: arbitrary mask
1550 tun_metadata2: arbitrary mask
1551 tun_metadata3: arbitrary mask
1552 tun_metadata4: arbitrary mask
1553 tun_metadata5: arbitrary mask
1554 tun_metadata6: arbitrary mask
1555 tun_metadata7: arbitrary mask
1556 tun_metadata8: arbitrary mask
1557 tun_metadata9: arbitrary mask
1558 tun_metadata10: arbitrary mask
1559 tun_metadata11: arbitrary mask
1560 tun_metadata12: arbitrary mask
1561 tun_metadata13: arbitrary mask
1562 tun_metadata14: arbitrary mask
1563 tun_metadata15: arbitrary mask
1564 tun_metadata16: arbitrary mask
1565 tun_metadata17: arbitrary mask
1566 tun_metadata18: arbitrary mask
1567 tun_metadata19: arbitrary mask
1568 tun_metadata20: arbitrary mask
1569 tun_metadata21: arbitrary mask
1570 tun_metadata22: arbitrary mask
1571 tun_metadata23: arbitrary mask
1572 tun_metadata24: arbitrary mask
1573 tun_metadata25: arbitrary mask
1574 tun_metadata26: arbitrary mask
1575 tun_metadata27: arbitrary mask
1576 tun_metadata28: arbitrary mask
1577 tun_metadata29: arbitrary mask
1578 tun_metadata30: arbitrary mask
1579 tun_metadata31: arbitrary mask
1580 tun_metadata32: arbitrary mask
1581 tun_metadata33: arbitrary mask
1582 tun_metadata34: arbitrary mask
1583 tun_metadata35: arbitrary mask
1584 tun_metadata36: arbitrary mask
1585 tun_metadata37: arbitrary mask
1586 tun_metadata38: arbitrary mask
1587 tun_metadata39: arbitrary mask
1588 tun_metadata40: arbitrary mask
1589 tun_metadata41: arbitrary mask
1590 tun_metadata42: arbitrary mask
1591 tun_metadata43: arbitrary mask
1592 tun_metadata44: arbitrary mask
1593 tun_metadata45: arbitrary mask
1594 tun_metadata46: arbitrary mask
1595 tun_metadata47: arbitrary mask
1596 tun_metadata48: arbitrary mask
1597 tun_metadata49: arbitrary mask
1598 tun_metadata50: arbitrary mask
1599 tun_metadata51: arbitrary mask
1600 tun_metadata52: arbitrary mask
1601 tun_metadata53: arbitrary mask
1602 tun_metadata54: arbitrary mask
1603 tun_metadata55: arbitrary mask
1604 tun_metadata56: arbitrary mask
1605 tun_metadata57: arbitrary mask
1606 tun_metadata58: arbitrary mask
1607 tun_metadata59: arbitrary mask
1608 tun_metadata60: arbitrary mask
1609 tun_metadata61: arbitrary mask
1610 tun_metadata62: arbitrary mask
1611 tun_metadata63: arbitrary mask
1612 metadata: arbitrary mask
1613 in_port: exact match or wildcard
1614 in_port_oxm: exact match or wildcard
1615 actset_output: exact match or wildcard
1616 pkt_mark: arbitrary mask
1617 ct_state: arbitrary mask
1618 ct_zone: exact match or wildcard
1619 ct_mark: arbitrary mask
1620 ct_label: arbitrary mask
1621 reg0: arbitrary mask
1622 reg1: arbitrary mask
1623 reg2: arbitrary mask
1624 reg3: arbitrary mask
1625 reg4: arbitrary mask
1626 reg5: arbitrary mask
1627 reg6: arbitrary mask
1628 reg7: arbitrary mask
1629 xreg0: arbitrary mask
1630 xreg1: arbitrary mask
1631 xreg2: arbitrary mask
1632 xreg3: arbitrary mask
1633 eth_src: arbitrary mask
1634 eth_dst: arbitrary mask
1635 eth_type: exact match or wildcard
1636 vlan_tci: arbitrary mask
1637 vlan_vid: arbitrary mask
1638 vlan_pcp: exact match or wildcard
1639 mpls_label: exact match or wildcard
1640 mpls_tc: exact match or wildcard
1641 mpls_bos: exact match or wildcard
1642 ip_src: arbitrary mask
1643 ip_dst: arbitrary mask
1644 ipv6_src: arbitrary mask
1645 ipv6_dst: arbitrary mask
1646 ipv6_label: arbitrary mask
1647 nw_proto: exact match or wildcard
1648 nw_tos: exact match or wildcard
1649 ip_dscp: exact match or wildcard
1650 nw_ecn: exact match or wildcard
1651 nw_ttl: exact match or wildcard
1652 ip_frag: arbitrary mask
1653 arp_op: exact match or wildcard
1654 arp_spa: arbitrary mask
1655 arp_tpa: arbitrary mask
1656 arp_sha: arbitrary mask
1657 arp_tha: arbitrary mask
1658 tcp_src: arbitrary mask
1659 tcp_dst: arbitrary mask
1660 tcp_flags: arbitrary mask
1661 udp_src: arbitrary mask
1662 udp_dst: arbitrary mask
1663 sctp_src: arbitrary mask
1664 sctp_dst: arbitrary mask
1665 icmp_type: exact match or wildcard
1666 icmp_code: exact match or wildcard
1667 icmpv6_type: exact match or wildcard
1668 icmpv6_code: exact match or wildcard
1669 nd_target: arbitrary mask
1670 nd_sll: arbitrary mask
1671 nd_tll: arbitrary mask
1676 printf ' table %d ("%s"):
1677 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1679 instructions (table miss and others):
1685 ' $1 $2 $3 `expr $1 + 1`
1688 echo ' table 252 ("table252"):
1689 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1691 instructions (table miss and others):
1697 table 253 ("table253"):
1698 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1700 instructions (table miss and others):
1701 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata
1706 (head_table classifier
1707 for i in `seq 1 251`; do
1708 ditto $i table$i 1000000
1710 tail_tables) > expout
1711 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
1712 # Change the configuration.
1715 -- --id=@t0 create Flow_Table name=main \
1716 -- --id=@t1 create Flow_Table flow-limit=1024 \
1717 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1718 | ${PERL} $srcdir/uuidfilt.pl],
1722 # Check that the configuration was updated.
1725 for i in `seq 2 251`; do
1726 ditto $i table$i 1000000
1728 tail_tables) > expout
1729 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
1733 AT_SETUP([ofproto - table description (OpenFlow 1.4)])
1736 while test $x -lt 254; do
1739 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME"
1742 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
1743 /^OFPST_TABLE_DESC/d'], [0], [expout])
1745 # Change the configuration.
1746 AT_CHECK([ovs-ofctl -O Openflow14 mod-table br0 0 evict])
1747 # Check that the configuration was updated.
1748 mv expout orig-expout
1749 sed -e '2s/eviction=off/eviction=on/' <orig-expout > expout
1750 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
1751 /^OFPST_TABLE_DESC/d'], [0], [expout])
1755 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)])
1757 # Configure a maximum of 4 flows.
1760 -- --id=@t0 create Flow_Table flow-limit=4 \
1761 -- set bridge br0 flow_tables:0=@t0 \
1762 | ${PERL} $srcdir/uuidfilt.pl],
1766 for in_port in 1 2 3 4; do
1767 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
1769 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1770 in_port=1 actions=drop
1771 in_port=2 actions=drop
1772 in_port=3 actions=drop
1773 in_port=4 actions=drop
1776 # Adding another flow will be refused.
1777 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1778 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1779 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1781 # Also a mod-flow that would add a flow will be refused.
1782 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
1783 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1784 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1786 # Replacing or modifying an existing flow is allowed.
1787 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1788 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1789 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1790 in_port=1 actions=drop
1791 in_port=2 actions=drop
1792 in_port=3 actions=output:1
1793 in_port=4 actions=NORMAL
1799 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)])
1801 # Configure a maximum of 4 flows.
1804 -- --id=@t0 create Flow_Table flow-limit=4 \
1805 -- set bridge br0 flow_tables:0=@t0 \
1806 | ${PERL} $srcdir/uuidfilt.pl],
1810 for in_port in 1 2 3 4; do
1811 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
1813 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1814 in_port=1 actions=drop
1815 in_port=2 actions=drop
1816 in_port=3 actions=drop
1817 in_port=4 actions=drop
1818 OFPST_FLOW reply (OF1.2):
1820 # Adding another flow will be refused.
1821 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1822 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1823 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1825 # Replacing or modifying an existing flow is allowed.
1826 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1827 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1828 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1829 in_port=1 actions=drop
1830 in_port=2 actions=drop
1831 in_port=3 actions=output:1
1832 in_port=4 actions=NORMAL
1833 OFPST_FLOW reply (OF1.2):
1838 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
1840 # Configure a maximum of 4 flows.
1843 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1844 -- set bridge br0 flow_tables:0=@t0 \
1845 | ${PERL} $srcdir/uuidfilt.pl],
1849 for in_port in 4 3 2 1; do
1850 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1852 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1853 idle_timeout=10, in_port=1 actions=drop
1854 idle_timeout=20, in_port=2 actions=drop
1855 idle_timeout=30, in_port=3 actions=drop
1856 idle_timeout=40, in_port=4 actions=drop
1859 # Adding another flow will cause the one that expires soonest to be evicted.
1860 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1861 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1862 idle_timeout=20, in_port=2 actions=drop
1863 idle_timeout=30, in_port=3 actions=drop
1864 idle_timeout=40, in_port=4 actions=drop
1865 in_port=5 actions=drop
1868 # A mod-flow that adds a flow also causes eviction, but replacing or
1869 # modifying an existing flow doesn't.
1870 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
1871 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1872 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1873 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1874 idle_timeout=30, in_port=3 actions=output:1
1875 in_port=4 actions=NORMAL
1876 in_port=5 actions=drop
1877 in_port=6 actions=drop
1880 # Flows with no timeouts at all cannot be evicted.
1881 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
1882 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1883 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1884 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1886 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1887 in_port=4 actions=NORMAL
1888 in_port=5 actions=drop
1889 in_port=6 actions=drop
1890 in_port=7 actions=NORMAL
1896 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
1898 # Configure a maximum of 4 flows.
1901 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1902 -- set bridge br0 flow_tables:0=@t0 \
1903 | ${PERL} $srcdir/uuidfilt.pl],
1907 for in_port in 4 3 2 1; do
1908 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1910 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1911 idle_timeout=10, in_port=1 actions=drop
1912 idle_timeout=20, in_port=2 actions=drop
1913 idle_timeout=30, in_port=3 actions=drop
1914 idle_timeout=40, in_port=4 actions=drop
1915 OFPST_FLOW reply (OF1.2):
1917 # Adding another flow will cause the one that expires soonest to be evicted.
1918 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
1919 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1920 idle_timeout=20, in_port=2 actions=drop
1921 idle_timeout=30, in_port=3 actions=drop
1922 idle_timeout=40, in_port=4 actions=drop
1923 in_port=5 actions=drop
1924 OFPST_FLOW reply (OF1.2):
1926 # In OpenFlow 1.2 a mod-flow does not ever add a flow and thus
1927 # has no effect on eviction
1928 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
1929 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1930 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1931 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1932 idle_timeout=20, in_port=2 actions=drop
1933 idle_timeout=30, in_port=3 actions=output:1
1934 in_port=4 actions=NORMAL
1935 in_port=5 actions=drop
1936 OFPST_FLOW reply (OF1.2):
1938 # Flows with no timeouts at all cannot be evicted.
1939 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
1940 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
1941 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1942 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1943 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1945 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1946 in_port=4 actions=NORMAL
1947 in_port=5 actions=drop
1948 in_port=6 actions=drop
1949 in_port=7 actions=NORMAL
1950 OFPST_FLOW reply (OF1.2):
1955 AT_SETUP([ofproto - eviction using importance upon table overflow (OpenFlow 1.4)])
1957 # Configure a maximum of 4 flows.
1960 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1961 -- set bridge br0 flow_tables:0=@t0 \
1962 | ${PERL} $srcdir/uuidfilt.pl],
1965 # Use mod-table to turn on eviction just to demonstrate that it works.
1966 AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 evict])
1968 for in_port in 4 3 2 1; do
1969 ovs-ofctl -O Openflow14 add-flow br0 importance=$((in_port + 30)),priority=$((in_port + 5)),hard_timeout=$((in_port + 500)),actions=drop
1971 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1972 hard_timeout=501, importance=31, priority=6 actions=drop
1973 hard_timeout=502, importance=32, priority=7 actions=drop
1974 hard_timeout=503, importance=33, priority=8 actions=drop
1975 hard_timeout=504, importance=34, priority=9 actions=drop
1976 OFPST_FLOW reply (OF1.4):
1978 # Adding another flow will cause the one with lowest importance to be evicted.
1979 AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=505,importance=35,priority=10,in_port=2,actions=drop])
1980 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1981 hard_timeout=502, importance=32, priority=7 actions=drop
1982 hard_timeout=503, importance=33, priority=8 actions=drop
1983 hard_timeout=504, importance=34, priority=9 actions=drop
1984 hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop
1985 OFPST_FLOW reply (OF1.4):
1987 # Disable the Eviction configuration.
1988 AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 noevict])
1989 # Adding another flow will cause the system to give error for FULL TABLE.
1990 AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=506,importance=36,priority=11,actions=drop],[1], [], [stderr])
1991 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1992 [OFPT_ERROR (OF1.4): OFPFMFC_TABLE_FULL
1994 #Dump flows. It should show only the old values
1995 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1996 hard_timeout=502, importance=32, priority=7 actions=drop
1997 hard_timeout=503, importance=33, priority=8 actions=drop
1998 hard_timeout=504, importance=34, priority=9 actions=drop
1999 hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop
2000 OFPST_FLOW reply (OF1.4):
2002 # mod-flow that would modify a flow will be done successfully.
2003 AT_CHECK([ovs-ofctl -O Openflow14 mod-flows br0 in_port=2,actions=NORMAL])
2004 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2005 hard_timeout=502, importance=32, priority=7 actions=drop
2006 hard_timeout=503, importance=33, priority=8 actions=drop
2007 hard_timeout=504, importance=34, priority=9 actions=drop
2008 hard_timeout=505, importance=35, priority=10,in_port=2 actions=NORMAL
2009 OFPST_FLOW reply (OF1.4):
2011 # Also a mod-flow that would add a flow will be refused.
2012 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
2013 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
2014 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2019 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
2021 # Configure a maximum of 4 flows.
2024 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
2025 overflow-policy=evict \
2026 groups='"NXM_OF_IN_PORT[[]]"' \
2027 -- set bridge br0 flow_tables:0=@t0 \
2028 | ${PERL} $srcdir/uuidfilt.pl],
2032 ovs-ofctl add-flows br0 - <<EOF
2033 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
2034 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
2035 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
2036 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
2038 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2039 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2040 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
2041 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2042 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2045 # Adding another flow will cause the one that expires soonest within
2046 # the largest group (those with in_port=1) to be evicted. In this
2047 # case this is not the same as the one that expires soonest overall
2048 # (which is what makes the test interesting):
2049 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
2050 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2051 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2052 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2053 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2054 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2057 # Enlarge the flow limit, change the eviction policy back to strictly
2058 # based on expiration, and and add some flows.
2059 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
2060 ovs-ofctl add-flows br0 - <<EOF
2061 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
2062 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
2063 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
2065 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2066 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2067 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2068 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2069 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2070 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2071 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2072 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2075 # Adding another flow will cause the one that expires soonest overall
2077 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
2078 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2079 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2080 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2081 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2082 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2083 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2084 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2085 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2088 # Reducing the flow limit also causes the flows that expire soonest
2089 # overall to be evicted.
2090 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
2091 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2092 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2093 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2094 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2095 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2101 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
2103 # Configure a maximum of 4 flows.
2106 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
2107 overflow-policy=evict \
2108 groups='"NXM_OF_IN_PORT[[]]"' \
2109 -- set bridge br0 flow_tables:0=@t0 \
2110 | ${PERL} $srcdir/uuidfilt.pl],
2114 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
2115 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
2116 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
2117 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
2118 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
2120 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2121 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2122 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
2123 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2124 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2125 OFPST_FLOW reply (OF1.2):
2127 # Adding another flow will cause the one that expires soonest within
2128 # the largest group (those with in_port=1) to be evicted. In this
2129 # case this is not the same as the one that expires soonest overall
2130 # (which is what makes the test interesting):
2131 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
2132 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2133 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2134 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2135 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2136 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2137 OFPST_FLOW reply (OF1.2):
2139 # Enlarge the flow limit, change the eviction policy back to strictly
2140 # based on expiration, and and add some flows.
2141 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
2142 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
2143 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
2144 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
2145 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
2147 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2148 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2149 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2150 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2151 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2152 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2153 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2154 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2155 OFPST_FLOW reply (OF1.2):
2157 # Adding another flow will cause the one that expires soonest overall
2159 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'])
2160 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2161 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2162 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2163 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2164 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2165 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2166 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2167 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2168 OFPST_FLOW reply (OF1.2):
2170 # Reducing the flow limit also causes the flows that expire soonest
2171 # overall to be evicted.
2172 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
2173 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2174 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2175 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2176 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2177 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2178 OFPST_FLOW reply (OF1.2):
2183 AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout])
2185 # Configure a maximum of 4 flows.
2188 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2189 -- set bridge br0 flow_tables:0=@t0 \
2190 | ${PERL} $srcdir/uuidfilt.pl],
2193 ovs-appctl time/stop
2195 for in_port in 4 3 2 1; do
2196 ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
2198 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2199 hard_timeout=13, in_port=1 actions=drop
2200 hard_timeout=16, in_port=2 actions=drop
2201 hard_timeout=19, in_port=3 actions=drop
2202 hard_timeout=22, in_port=4 actions=drop
2205 # Sleep and modify the one that expires soonest
2206 ovs-appctl time/warp 5000
2207 AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop])
2208 # At this point the table would looks like:
2209 # in_port seconds to expire
2214 ovs-appctl time/warp 2000
2215 # Adding another flow will cause the one that expires soonest to be evicted.
2216 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
2217 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2218 hard_timeout=13, in_port=1 actions=drop
2219 hard_timeout=19, in_port=3 actions=drop
2220 hard_timeout=22, in_port=4 actions=drop
2221 in_port=5 actions=drop
2227 AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout])
2228 OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1])
2229 # Configure a maximum of 4 flows.
2232 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2233 -- set bridge br0 flow_tables:0=@t0 \
2234 | ${PERL} $srcdir/uuidfilt.pl],
2238 for in_port in 4 3 2 1; do
2239 ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
2241 ovs-appctl time/stop
2242 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2243 idle_timeout=13, in_port=1 actions=drop
2244 idle_timeout=16, in_port=2 actions=drop
2245 idle_timeout=19, in_port=3 actions=drop
2246 idle_timeout=22, in_port=4 actions=drop
2249 # Sleep and receive on the flow that expires soonest
2250 ovs-appctl time/warp 5000
2251 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)'])
2252 # At this point the table would looks like:
2253 # in_port seconds to expire
2258 ovs-appctl time/warp 2000
2259 # Adding another flow will cause the one that expires soonest to be evicted.
2260 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
2261 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2262 idle_timeout=19, in_port=3 actions=drop
2263 idle_timeout=22, in_port=4 actions=drop
2264 in_port=5 actions=drop
2265 n_packets=1, n_bytes=60, idle_timeout=13, in_port=1 actions=drop
2271 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
2273 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
2275 printf '\n\n--- check_async %d ---\n\n\n' $1
2278 ovs-appctl -t ovs-ofctl ofctl/barrier
2279 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2282 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2283 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
2284 if test X"$1" = X"OFPR_ACTION"; then shift;
2285 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2286 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2289 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2290 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2291 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2292 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
2293 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2296 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2297 ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2298 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2299 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
2300 udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
2303 # OFPT_PORT_STATUS, OFPPR_ADD
2304 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
2305 if test X"$1" = X"OFPPR_ADD"; then shift;
2306 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
2309 speed: 0 Mbps now, 0 Mbps max"
2312 # OFPT_PORT_STATUS, OFPPR_DELETE
2313 ovs-vsctl del-port br0 test
2314 if test X"$1" = X"OFPPR_DELETE"; then shift;
2315 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
2318 speed: 0 Mbps now, 0 Mbps max"
2321 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2322 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
2323 ovs-ofctl --strict del-flows br0 ''
2324 if test X"$1" = X"OFPRR_DELETE"; then shift;
2325 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
2327 AT_FAIL_IF([test X"$1" != X])
2329 ovs-appctl -t ovs-ofctl ofctl/barrier
2330 echo >>expout "OFPT_BARRIER_REPLY:"
2334 s/ (xid=0x[0-9a-fA-F]*)//
2336 s/00:0.$/00:0x/' < monitor.log]],
2340 # It's a service connection so initially there should be no async messages.
2343 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2344 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2345 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2347 # Set miss_send_len to 128 and enable invalid_ttl.
2348 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
2349 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2351 # Become slave, which should disable everything except port status.
2352 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
2353 check_async 4 OFPPR_ADD OFPPR_DELETE
2355 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
2356 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
2357 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2359 # Set controller ID 123.
2360 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
2361 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2363 # Restore controller ID 0.
2364 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
2367 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
2368 check_async 7 OFPR_ACTION OFPPR_ADD
2370 ovs-appctl -t ovs-ofctl exit
2374 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
2376 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2378 printf '\n\n--- check_async %d ---\n\n\n' $1
2382 ovs-appctl -t ovs-ofctl ofctl/barrier
2383 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2386 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2387 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
2388 if test X"$1" = X"OFPR_ACTION"; then shift;
2389 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2390 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2393 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2394 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2395 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2396 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2397 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2400 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2401 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2402 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2403 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2404 udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
2407 # OFPT_PORT_STATUS, OFPPR_ADD
2408 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2409 if test X"$1" = X"OFPPR_ADD"; then shift;
2410 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2413 speed: 0 Mbps now, 0 Mbps max"
2416 # OFPT_PORT_STATUS, OFPPR_DELETE
2417 ovs-vsctl del-port br0 test
2418 if test X"$1" = X"OFPPR_DELETE"; then shift;
2419 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2422 speed: 0 Mbps now, 0 Mbps max"
2425 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2426 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
2427 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
2428 if test X"$1" = X"OFPRR_DELETE"; then shift;
2429 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
2431 AT_FAIL_IF([test X"$1" != X])
2433 ovs-appctl -t ovs-ofctl ofctl/barrier
2434 echo >>expout "OFPT_BARRIER_REPLY (OF1.2):"
2438 s/ (xid=0x[0-9a-fA-F]*)//
2440 s/00:0.$/00:0x/' < monitor.log]],
2444 # It's a service connection so initially there should be no async messages.
2447 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2448 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2449 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2451 # Set miss_send_len to 128 and enable invalid_ttl.
2452 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
2453 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2455 # Become slave (OF 1.2), which should disable everything except port status.
2456 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
2457 check_async 4 OFPPR_ADD OFPPR_DELETE
2459 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
2460 ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
2461 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2463 # Set controller ID 123.
2464 ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
2465 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2467 # Restore controller ID 0.
2468 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
2470 # Become master (OF 1.2).
2471 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
2472 check_async 7 OFPR_ACTION OFPPR_ADD
2474 ovs-appctl -t ovs-ofctl exit
2478 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
2480 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
2482 printf '\n\n--- check_async %d ---\n\n\n' $1
2486 ovs-appctl -t ovs-ofctl ofctl/barrier
2487 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2490 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2491 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
2492 if test X"$1" = X"OFPR_ACTION"; then shift;
2493 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2494 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2497 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2498 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2499 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2500 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2501 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2504 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2505 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2506 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2507 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2508 udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
2511 # OFPT_PORT_STATUS, OFPPR_ADD
2512 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2513 if test X"$1" = X"OFPPR_ADD"; then shift;
2514 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2517 speed: 0 Mbps now, 0 Mbps max"
2520 # OFPT_PORT_STATUS, OFPPR_DELETE
2521 ovs-vsctl del-port br0 test
2522 if test X"$1" = X"OFPPR_DELETE"; then shift;
2523 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2526 speed: 0 Mbps now, 0 Mbps max"
2529 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2530 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
2531 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
2532 if test X"$1" = X"OFPRR_DELETE"; then shift;
2533 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
2536 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
2537 ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10
2538 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234
2539 ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234
2540 if test X"$1" = X"OFPRR_DELETE"; then shift;
2541 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=gropu_delete table_id=0"
2544 AT_FAIL_IF([test X"$1" != X])
2546 ovs-appctl -t ovs-ofctl ofctl/barrier
2547 echo >>expout "OFPT_BARRIER_REPLY (OF1.3):"
2551 s/ (xid=0x[0-9a-fA-F]*)//
2553 s/00:0.$/00:0x/' < monitor.log]],
2557 # It's a service connection so initially there should be no async messages.
2560 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2561 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
2562 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2564 # Become slave (OF 1.3), which should disable everything except port status.
2565 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
2566 check_async 3 OFPPR_ADD OFPPR_DELETE
2568 # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
2569 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005
2570 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2572 # Set controller ID 123.
2573 ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
2574 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2576 # Restore controller ID 0.
2577 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
2579 # Become master (OF 1.3).
2580 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
2581 check_async 6 OFPR_ACTION OFPPR_ADD
2583 ovs-appctl -t ovs-ofctl exit
2587 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.4)])
2589 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile])
2591 printf '\n\n--- check_async %d ---\n\n\n' $1
2595 ovs-appctl -t ovs-ofctl ofctl/barrier
2596 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2599 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2600 ovs-ofctl -O OpenFlow14 -v packet-out br0 none controller '0001020304050010203040501234'
2601 if test X"$1" = X"OFPR_ACTION"; then shift;
2602 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2603 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2606 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2607 ovs-ofctl -O OpenFlow14 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2608 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2609 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2610 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2613 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2614 ovs-ofctl -O OpenFlow14 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2615 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2616 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2617 udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
2620 # OFPT_PORT_STATUS, OFPPR_ADD
2621 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2622 if test X"$1" = X"OFPPR_ADD"; then shift;
2623 echo >>expout "OFPT_PORT_STATUS (OF1.4): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2626 speed: 0 Mbps now, 0 Mbps max"
2629 # OFPT_PORT_STATUS, OFPPR_MODIFY
2630 ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 test up
2631 if test X"$1" = X"OFPPR_MODIFY"; then shift;
2632 echo >>expout "OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2635 speed: 0 Mbps now, 0 Mbps max
2636 OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2639 speed: 0 Mbps now, 0 Mbps max"
2642 # OFPT_PORT_STATUS, OFPPR_DELETE
2643 ovs-vsctl del-port br0 test
2644 if test X"$1" = X"OFPPR_DELETE"; then shift;
2645 echo >>expout "OFPT_PORT_STATUS (OF1.4): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2648 speed: 0 Mbps now, 0 Mbps max"
2651 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2652 ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=drop
2653 ovs-ofctl -O OpenFlow14 --strict del-flows br0 ''
2654 if test X"$1" = X"OFPRR_DELETE"; then shift;
2655 echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=delete table_id=0"
2658 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
2659 ovs-ofctl -O OpenFlow14 add-group br0 group_id=1234,type=all,bucket=output:10
2660 ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=group:1234
2661 ovs-ofctl -O OpenFlow14 --strict del-groups br0 group_id=1234
2662 if test X"$1" = X"OFPRR_GROUP_DELETE"; then shift;
2663 echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=group_delete table_id=0"
2666 AT_FAIL_IF([test X"$1" != X])
2668 ovs-appctl -t ovs-ofctl ofctl/barrier
2669 echo >>expout "OFPT_BARRIER_REPLY (OF1.4):"
2673 s/ (xid=0x[0-9a-fA-F]*)//
2675 s/00:0.$/00:0x/' < monitor.log]],
2679 # It's a service connection so initially there should be no async messages.
2682 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2683 ovs-appctl -t ovs-ofctl ofctl/send 0509000c0123456700000080
2684 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
2686 # Become slave (OF 1.4), which should disable everything except port status.
2687 ovs-appctl -t ovs-ofctl ofctl/send 051800180000000200000003000000000000000000000001
2688 check_async 3 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
2690 # Use OF 1.4 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
2691 ovs-appctl -t ovs-ofctl ofctl/send 051c0038000000020000000800000005000100080000000200020008000000020003000800000005000400080000001c0005000800000005
2692 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
2694 # Set controller ID 123.
2695 ovs-appctl -t ovs-ofctl ofctl/send 05040018000000030000232000000014000000000000007b
2696 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
2698 # Restore controller ID 0.
2699 ovs-appctl -t ovs-ofctl ofctl/send 050400180000000300002320000000140000000000000000
2701 # Become master (OF 1.4).
2702 ovs-appctl -t ovs-ofctl ofctl/send 051800180000000400000002000000000000000000000002
2703 check_async 6 OFPR_ACTION OFPPR_ADD OFPPR_MODIFY OFPRR_DELETE
2705 ovs-appctl -t ovs-ofctl exit
2709 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.5)])
2711 AT_CHECK([ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile])
2713 printf '\n\n--- check_async %d ---\n\n\n' $1
2717 ovs-appctl -t ovs-ofctl ofctl/barrier
2718 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2721 # Other tests are not working with OF 1.5, and message
2722 # format may change, so leave them out.
2724 # OFPT_PORT_STATUS, OFPPR_ADD
2725 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2726 if test X"$1" = X"OFPPR_ADD"; then shift;
2727 echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2730 speed: 0 Mbps now, 0 Mbps max"
2733 # OFPT_PORT_STATUS, OFPPR_MODIFY
2734 ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test up
2735 if test X"$1" = X"OFPPR_MODIFY"; then shift;
2736 echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2739 speed: 0 Mbps now, 0 Mbps max
2740 OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x
2743 speed: 0 Mbps now, 0 Mbps max"
2746 # OFPT_PORT_STATUS, OFPPR_DELETE
2747 ovs-vsctl del-port br0 test
2748 if test X"$1" = X"OFPPR_DELETE"; then shift;
2749 echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2752 speed: 0 Mbps now, 0 Mbps max"
2755 AT_FAIL_IF([test X"$1" != X])
2757 ovs-appctl -t ovs-ofctl ofctl/barrier
2758 echo >>expout "OFPT_BARRIER_REPLY (OF1.5):"
2762 s/ (xid=0x[0-9a-fA-F]*)//
2764 s/00:0.$/00:0x/' < monitor.log]],
2768 # It's a service connection so initially there should be no async messages.
2771 # If we don't set this, async messages are not received.
2772 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2773 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
2774 check_async 2 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
2776 # Set-async has changed in OF 1.4 and is not yet implemented.
2778 ovs-appctl -t ovs-ofctl exit
2782 dnl This test checks that the role request/response messaging works
2783 dnl and that generation_id is handled properly.
2784 AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
2786 on_exit 'kill `cat c1.pid c2.pid`'
2788 # Start two ovs-ofctl controller processes.
2789 AT_CAPTURE_FILE([monitor1.log])
2790 AT_CAPTURE_FILE([expout1])
2791 AT_CAPTURE_FILE([experr1])
2792 AT_CAPTURE_FILE([monitor2.log])
2793 AT_CAPTURE_FILE([expout2])
2794 AT_CAPTURE_FILE([experr2])
2796 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
2797 ovs-appctl -t `pwd`/c$i ofctl/barrier
2798 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2802 # find out current role
2803 ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000
2804 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange"
2805 echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
2808 # controller 1: Become slave (generation_id is initially undefined, so
2809 # 2^63+2 should not be stale)
2810 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
2811 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
2812 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
2814 # controller 2: Become master.
2815 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
2816 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
2817 echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
2819 # controller 1: Try to become the master using a stale generation ID
2820 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
2821 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
2822 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
2823 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
2825 # controller 1: Become master using a valid generation ID
2826 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
2827 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
2828 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
2831 ovs-appctl -t `pwd`/c$i ofctl/barrier
2832 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):"
2838 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2840 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2845 dnl This test checks that the role request/response messaging works,
2846 dnl that generation_id is handled properly, and that role status update
2847 dnl messages are sent when a controller's role gets changed from master
2849 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
2851 on_exit 'kill `cat c1.pid c2.pid`'
2853 # Start two ovs-ofctl controller processes.
2854 AT_CAPTURE_FILE([monitor1.log])
2855 AT_CAPTURE_FILE([expout1])
2856 AT_CAPTURE_FILE([experr1])
2857 AT_CAPTURE_FILE([monitor2.log])
2858 AT_CAPTURE_FILE([expout2])
2859 AT_CAPTURE_FILE([experr2])
2861 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
2862 ovs-appctl -t `pwd`/c$i ofctl/barrier
2863 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2867 # find out current role
2868 ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000
2869 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange"
2870 echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
2873 # controller 1: Become slave (generation_id is initially undefined, so
2874 # 2^63+2 should not be stale)
2875 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
2876 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
2877 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
2879 # controller 2: Become master.
2880 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
2881 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
2882 echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
2884 # controller 1: Try to become the master using a stale generation ID
2885 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
2886 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2887 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
2888 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2890 # controller 1: Become master using a valid generation ID
2891 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
2892 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
2893 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
2894 echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
2897 ovs-appctl -t `pwd`/c$i ofctl/barrier
2898 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):"
2904 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2906 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2911 dnl This test checks the Group and meter notifications when a group mod
2912 dnl command is sent from one controller and the reply is received by
2913 dnl other controllers.
2914 AT_SETUP([ofproto - requestforward (OpenFlow 1.4)])
2916 on_exit 'kill `cat c1.pid c2.pid c3.pid`'
2918 # Start two ovs-ofctl controller processes.
2919 AT_CAPTURE_FILE([monitor1.log])
2920 AT_CAPTURE_FILE([expout1])
2921 AT_CAPTURE_FILE([monitor2.log])
2922 AT_CAPTURE_FILE([expout2])
2923 AT_CAPTURE_FILE([monitor3.log])
2924 AT_CAPTURE_FILE([expout3])
2926 ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile=`pwd`/c1.pid --unixctl=`pwd`/c1
2927 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c2.pid --unixctl=`pwd`/c2
2928 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c3.pid --unixctl=`pwd`/c3
2932 ovs-appctl -t `pwd`/c$i ofctl/barrier
2933 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2937 printf '\n\n--- check_async %d ---\n\n\n' $1
2942 ovs-appctl -t `pwd`/c2 ofctl/send 050f0010000000020000000000000001
2943 if test X"$1" = X"OFPGC_ADD"; then shift;
2944 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
2945 ADD group_id=1,type=all"
2946 echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
2947 ADD group_id=1,type=all"
2948 echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
2949 ADD group_id=1,type=all"
2953 ovs-appctl -t `pwd`/c2 ofctl/send 050f0010000000020001010000000001
2954 if test X"$1" = X"OFPGC_MODIFY"; then shift;
2955 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
2956 MOD group_id=1,type=select"
2957 echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
2958 MOD group_id=1,type=select"
2959 echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
2960 MOD group_id=1,type=select"
2963 ovs-appctl -t `pwd`/c1 ofctl/barrier
2964 echo >>expout1 "OFPT_BARRIER_REPLY (OF1.5):"
2965 ovs-appctl -t `pwd`/c2 ofctl/barrier
2966 echo >>expout2 "OFPT_BARRIER_REPLY (OF1.4):"
2967 ovs-appctl -t `pwd`/c3 ofctl/barrier
2968 echo >>expout3 "OFPT_BARRIER_REPLY (OF1.4):"
2975 s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
2980 # controller 1: Become slave
2981 ovs-appctl -t `pwd`/c1 ofctl/send 061800180000000300000003000000008000000000000002
2983 # controller 2: Become master
2984 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
2986 # controller 1: Become slave
2987 ovs-appctl -t `pwd`/c3 ofctl/send 051800180000000300000003000000008000000000000004
2989 # controller 1: Enabled requestforward using set Asynchronous message
2990 ovs-appctl -t `pwd`/c1 ofctl/send 061c00280000000200000008000000050002000800000002000400080000001a000a000800000003
2992 # controller 2: Enabled requestforward using set Asynchronous message
2993 ovs-appctl -t `pwd`/c2 ofctl/send 051c002800000002000100080000000200030008000000050005000800000005000b000800000003
2995 # controller 1: Enabled requestforward using set Asynchronous message
2996 ovs-appctl -t `pwd`/c3 ofctl/send 051c00280000000200000008000000050002000800000002000400080000001a000a000800000003
2997 check_async 1 OFPGC_ADD OFPGC_MODIFY
3002 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
3003 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
3004 dnl controllers despite the spec) as meaning a packet that was generated
3005 dnl by the controller.
3006 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
3008 ADD_OF_PORTS([br0], [1])
3010 # Start a monitor listening for packet-ins.
3011 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
3012 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
3013 ovs-appctl -t ovs-ofctl ofctl/barrier
3014 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3015 AT_CAPTURE_FILE([monitor.log])
3017 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
3018 AT_CHECK([ovs-ofctl packet-out br0 none controller,1 '0001020304050010203040501234'])
3019 AT_CHECK([ovs-ofctl packet-out br0 controller controller,1 '0001020304050010203040505678'])
3021 # Stop the monitor and check its output.
3022 ovs-appctl -t ovs-ofctl ofctl/barrier
3023 ovs-appctl -t ovs-ofctl exit
3025 ovs-ofctl dump-ports br0
3027 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3028 OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3029 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3030 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3031 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
3038 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
3039 dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
3040 dnl controllers despite the spec) as meaning a packet that was generated
3041 dnl by the controller.
3042 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
3045 # Start a monitor listening for packet-ins.
3046 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
3047 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
3048 ovs-appctl -t ovs-ofctl ofctl/barrier
3049 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3050 AT_CAPTURE_FILE([monitor.log])
3052 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
3053 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
3054 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
3056 # Stop the monitor and check its output.
3057 ovs-appctl -t ovs-ofctl ofctl/barrier
3058 ovs-appctl -t ovs-ofctl exit
3060 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3061 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3062 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3063 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3064 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
3065 OFPT_BARRIER_REPLY (OF1.2):
3071 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
3072 dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some
3073 dnl controllers despite the spec) as meaning a packet that was generated
3074 dnl by the controller.
3075 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)])
3078 # Start a monitor listening for packet-ins.
3079 AT_CHECK([ovs-ofctl -O OpenFlow11 monitor br0 --detach --no-chdir --pidfile])
3080 ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080
3081 ovs-appctl -t ovs-ofctl ofctl/barrier
3082 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3083 AT_CAPTURE_FILE([monitor.log])
3085 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
3086 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 none controller '0001020304050010203040501234'])
3087 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 4294967293 controller '0001020304050010203040505678'])
3089 # Stop the monitor and check its output.
3090 ovs-appctl -t ovs-ofctl ofctl/barrier
3091 ovs-appctl -t ovs-ofctl exit
3093 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3094 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3095 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3096 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3097 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
3098 OFPT_BARRIER_REPLY (OF1.1):
3104 dnl This test checks that metadata is encoded in packet_in structures,
3105 dnl supported by NXAST.
3106 AT_SETUP([ofproto - packet-out with metadata (NXM)])
3109 # Start a monitor listening for packet-ins.
3110 AT_CHECK([ovs-ofctl -P nxm monitor br0 --detach --no-chdir --pidfile])
3111 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
3112 ovs-appctl -t ovs-ofctl ofctl/barrier
3113 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3114 AT_CAPTURE_FILE([monitor.log])
3116 # Send a packet-out with a load action to set some metadata, and forward to controller
3117 AT_CHECK([ovs-ofctl packet-out br0 controller 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), load(0xaa->NXM_NX_PKT_MARK[[]]), controller' '0001020304050010203040501234'])
3119 # Stop the monitor and check its output.
3120 ovs-appctl -t ovs-ofctl ofctl/barrier
3121 ovs-appctl -t ovs-ofctl exit
3123 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3124 NXT_PACKET_IN: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3125 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3132 dnl This test checks that metadata is encoded in packet_in structures,
3133 dnl supported by NXAST.
3134 AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
3137 # Start a monitor listening for packet-ins.
3138 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
3139 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
3140 ovs-appctl -t ovs-ofctl ofctl/barrier
3141 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3142 AT_CAPTURE_FILE([monitor.log])
3144 # Send a packet-out with a set-field action to set some metadata, and forward to controller
3145 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234'])
3147 # Stop the monitor and check its output.
3148 ovs-appctl -t ovs-ofctl ofctl/barrier
3149 ovs-appctl -t ovs-ofctl exit
3151 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3152 OFPT_PACKET_IN (OF1.2): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=ANY (via action) data_len=14 (unbuffered)
3153 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3154 OFPT_BARRIER_REPLY (OF1.2):
3160 dnl This test checks that metadata is encoded in packet_in structures,
3161 dnl supported by NXAST.
3162 AT_SETUP([ofproto - packet-out with metadata and dual set_field (OpenFlow 1.3)])
3165 # Start a monitor listening for packet-ins.
3166 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
3167 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
3168 ovs-appctl -t ovs-ofctl ofctl/barrier
3169 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3170 AT_CAPTURE_FILE([monitor.log])
3172 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
3173 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, set_field:0x6b->metadata, controller' '0001020304050010203040501234'])
3175 # Stop the monitor and check its output.
3176 ovs-appctl -t ovs-ofctl ofctl/barrier
3177 ovs-appctl -t ovs-ofctl exit
3179 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3180 OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0x6b,in_port=ANY (via action) data_len=14 (unbuffered)
3181 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3182 OFPT_BARRIER_REPLY (OF1.3):
3188 dnl This test checks that tunnel metadata is encoded in packet_in structures.
3189 AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
3192 # Start a monitor listening for packet-ins.
3193 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
3194 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
3195 ovs-appctl -t ovs-ofctl ofctl/barrier
3196 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3197 AT_CAPTURE_FILE([monitor.log])
3199 # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
3200 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'])
3202 # Stop the monitor and check its output.
3203 ovs-appctl -t ovs-ofctl ofctl/barrier
3204 ovs-appctl -t ovs-ofctl exit
3206 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3207 OFPT_PACKET_IN (OF1.2): total_len=14 tun_id=0x1020304,tun_src=127.0.0.1,tun_dst=192.168.0.1,in_port=ANY (via action) data_len=14 (unbuffered)
3208 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3209 OFPT_BARRIER_REPLY (OF1.2):
3215 m4_divert_push([PREPARE_TESTS])
3216 # Sorts groups of lines that start with a space, without moving them
3217 # past the nearest line that does not start with a space.
3227 print $_ foreach sort(@buffer);
3232 print $_ foreach sort(@buffer);
3235 m4_divert_pop([PREPARE_TESTS])
3237 AT_SETUP([ofproto - flow monitoring])
3238 AT_KEYWORDS([monitor])
3241 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
3243 # Start a monitor watching the flow table and check the initial reply.
3244 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
3245 AT_CAPTURE_FILE([monitor.log])
3246 ovs-appctl -t ovs-ofctl ofctl/barrier
3247 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3248 [NXST_FLOW_MONITOR reply:
3249 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
3253 # Add, delete, and modify some flows and check the updates.
3254 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3255 ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
3256 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
3257 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
3258 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
3259 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
3260 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
3261 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
3262 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
3263 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
3264 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
3265 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
3266 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
3267 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
3268 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
3269 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
3270 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
3271 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
3272 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
3273 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
3274 ovs-ofctl add-flow br0 in_port=0,actions=output:23
3275 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
3276 ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
3277 ovs-ofctl del-flows br0 dl_vlan=123
3278 ovs-ofctl del-flows br0
3279 ovs-appctl -t ovs-ofctl ofctl/barrier
3280 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
3281 [NXST_FLOW_MONITOR reply (xid=0x0):
3282 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
3283 NXST_FLOW_MONITOR reply (xid=0x0):
3284 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
3285 NXST_FLOW_MONITOR reply (xid=0x0):
3286 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
3287 NXST_FLOW_MONITOR reply (xid=0x0):
3288 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
3289 NXST_FLOW_MONITOR reply (xid=0x0):
3290 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
3291 NXST_FLOW_MONITOR reply (xid=0x0):
3292 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
3293 NXST_FLOW_MONITOR reply (xid=0x0):
3294 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
3295 NXST_FLOW_MONITOR reply (xid=0x0):
3296 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
3297 NXST_FLOW_MONITOR reply (xid=0x0):
3298 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
3299 NXST_FLOW_MONITOR reply (xid=0x0):
3300 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
3301 NXST_FLOW_MONITOR reply (xid=0x0):
3302 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
3303 NXST_FLOW_MONITOR reply (xid=0x0):
3304 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
3305 NXST_FLOW_MONITOR reply (xid=0x0):
3306 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
3307 NXST_FLOW_MONITOR reply (xid=0x0):
3308 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
3309 NXST_FLOW_MONITOR reply (xid=0x0):
3310 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
3311 NXST_FLOW_MONITOR reply (xid=0x0):
3312 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
3313 NXST_FLOW_MONITOR reply (xid=0x0):
3314 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
3315 NXST_FLOW_MONITOR reply (xid=0x0):
3316 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
3317 NXST_FLOW_MONITOR reply (xid=0x0):
3318 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
3319 NXST_FLOW_MONITOR reply (xid=0x0):
3320 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
3321 NXST_FLOW_MONITOR reply (xid=0x0):
3322 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
3323 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
3324 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
3325 NXST_FLOW_MONITOR reply (xid=0x0):
3326 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
3327 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
3328 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
3329 NXST_FLOW_MONITOR reply (xid=0x0):
3330 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
3331 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
3332 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
3333 NXST_FLOW_MONITOR reply (xid=0x0):
3334 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
3335 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
3336 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
3337 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
3338 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
3339 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
3340 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
3341 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
3342 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
3343 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
3344 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
3348 # Check that our own changes are reported as full updates.
3349 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3350 ovs-ofctl add-flow br0 in_port=1,actions=output:2
3351 ovs-ofctl add-flow br0 in_port=2,actions=output:1
3352 ovs-appctl -t ovs-ofctl ofctl/barrier
3353 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
3354 ovs-appctl -t ovs-ofctl ofctl/barrier
3355 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
3357 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
3358 [NXST_FLOW_MONITOR reply (xid=0x0):
3359 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
3360 NXST_FLOW_MONITOR reply (xid=0x0):
3361 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
3363 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
3364 NXST_FLOW_MONITOR reply (xid=0x0):
3365 event=DELETED reason=delete table=0 cookie=0 in_port=1 actions=output:2
3366 event=DELETED reason=delete table=0 cookie=0 in_port=2 actions=output:1
3370 ovs-appctl -t ovs-ofctl exit
3374 AT_SETUP([ofproto - flow monitoring with !own])
3375 AT_KEYWORDS([monitor])
3378 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
3380 # Start a monitor watching the flow table and check the initial reply.
3381 ovs-ofctl monitor br0 watch:\!own --detach --no-chdir --pidfile >monitor.log 2>&1
3382 AT_CAPTURE_FILE([monitor.log])
3383 ovs-appctl -t ovs-ofctl ofctl/barrier
3384 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3385 [NXST_FLOW_MONITOR reply:
3386 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
3390 # Check that our own changes are reported as abbreviations.
3391 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3392 ovs-ofctl add-flow br0 in_port=1,actions=output:2
3393 ovs-ofctl add-flow br0 in_port=2,actions=output:1
3394 ovs-appctl -t ovs-ofctl ofctl/barrier
3395 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
3396 ovs-appctl -t ovs-ofctl ofctl/barrier
3397 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
3399 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3400 [NXST_FLOW_MONITOR reply (xid=0x0):
3401 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
3402 NXST_FLOW_MONITOR reply (xid=0x0):
3403 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
3405 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
3406 NXST_FLOW_MONITOR reply (xid=0x0):
3407 event=ABBREV xid=0x12345678
3411 ovs-appctl -t ovs-ofctl exit
3415 AT_SETUP([ofproto - flow monitoring with out_port])
3416 AT_KEYWORDS([monitor])
3419 ovs-ofctl add-flow br0 in_port=0,dl_vlan=121,actions=output:1
3420 ovs-ofctl add-flow br0 in_port=0,dl_vlan=122,actions=output:1
3421 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:2
3423 # Start a monitor watching the flow table and check the initial reply.
3424 ovs-ofctl monitor br0 watch:out_port=2 --detach --no-chdir --pidfile >monitor.log 2>&1
3425 AT_CAPTURE_FILE([monitor.log])
3426 ovs-appctl -t ovs-ofctl ofctl/barrier
3427 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3428 [NXST_FLOW_MONITOR reply:
3429 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
3433 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3435 # Add, modify flows and check the updates.
3436 ovs-ofctl mod-flows br0 dl_vlan=121,actions=drop
3437 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1,output:2
3438 ovs-appctl -t ovs-ofctl ofctl/barrier
3440 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:1,output:2
3441 ovs-appctl -t ovs-ofctl ofctl/barrier
3443 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1
3444 ovs-appctl -t ovs-ofctl ofctl/barrier
3445 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:2
3446 ovs-appctl -t ovs-ofctl ofctl/barrier
3448 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3449 [NXST_FLOW_MONITOR reply (xid=0x0):
3450 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1,output:2
3452 NXST_FLOW_MONITOR reply (xid=0x0):
3453 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1,output:2
3455 NXST_FLOW_MONITOR reply (xid=0x0):
3456 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1
3458 NXST_FLOW_MONITOR reply (xid=0x0):
3459 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
3463 ovs-appctl -t ovs-ofctl exit
3467 AT_SETUP([ofproto - flow monitoring pause and resume])
3468 AT_KEYWORDS([monitor])
3470 # The maximum socket receive buffer size is important for this test, which
3471 # tests behavior when the receive buffer overflows.
3472 if test -e /proc/sys/net/core/rmem_max; then
3474 rmem_max=`cat /proc/sys/net/core/rmem_max`
3475 elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
3478 # Don't know how to get maximum socket receive buffer on this OS
3481 # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
3482 # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
3483 queue_size=`expr $rmem_max + 128 \* 1024`
3484 echo rmem_max=$rmem_max queue_size=$queue_size
3486 # If there's too much queuing skip the test to avoid timing out.
3487 AT_SKIP_IF([test $rmem_max -gt 1048576])
3489 # Each flow update message takes up at least 48 bytes of space in queues
3490 # and in practice more than that.
3491 n_msgs=`expr $queue_size / 48`
3496 # Start a monitor watching the flow table, then make it block.
3497 on_exit 'kill `cat ovs-ofctl.pid`'
3498 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
3499 AT_CAPTURE_FILE([monitor.log])
3500 ovs-appctl -t ovs-ofctl ofctl/block
3502 # Add $n_msgs flows.
3503 (echo "in_port=2,actions=output:2"
3505 for ($i = 0; $i < '$n_msgs'; $i++) {
3506 print "cookie=1,reg1=$i,actions=drop\n";
3509 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3510 # Check that multipart flow dumps work properly:
3511 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
3512 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
3513 AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
3514 AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
3516 ovs-appctl -t ovs-ofctl ofctl/unblock
3518 # Wait for the connection resumed.
3519 # A barrier doesn't work for this purpose.
3520 # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html
3521 # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html
3522 OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log])
3524 ovs-appctl -t ovs-ofctl exit
3526 # Check that the flow monitor reported the same number of flows
3527 # added and deleted, but fewer than we actually added and deleted.
3528 adds=`grep -c 'ADDED.*reg1=' monitor.log`
3529 deletes=`grep -c 'DELETED.*reg1=' monitor.log`
3530 echo adds=$adds deletes=$deletes
3531 AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
3532 AT_CHECK([test $adds = $deletes])
3534 # Check that the flow monitor reported everything in the expected order:
3536 # event=ADDED table=0 cookie=0x1 reg1=0x22
3538 # NXT_FLOW_MONITOR_PAUSED:
3540 # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3542 # event=ADDED table=0 cookie=0x3 in_port=1
3543 # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
3544 # NXT_FLOW_MONITOR_RESUMED:
3546 # except that, between the PAUSED and RESUMED, the order of the ADDED
3547 # and MODIFIED lines lines depends on hash order, that is, it varies
3548 # as we change the hash function or change architecture. Therefore,
3549 # we use a couple of tests below to accept both orders.
3550 AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
3553 /NXT_FLOW_MONITOR_PAUSED:/p
3554 /NXT_FLOW_MONITOR_RESUMED:/p
3555 ' > monitor.log.subset])
3556 AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
3557 event=ADDED table=0 cookie=0x1 reg1=0x22
3558 NXT_FLOW_MONITOR_PAUSED:
3559 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3560 event=ADDED table=0 cookie=0x3 in_port=1
3561 NXT_FLOW_MONITOR_RESUMED:
3563 AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
3564 NXT_FLOW_MONITOR_PAUSED:
3565 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3566 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
3567 NXT_FLOW_MONITOR_RESUMED:
3573 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
3574 AT_KEYWORDS([monitor])
3577 # Start a monitor, use the required protocol version
3578 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3579 AT_CAPTURE_FILE([monitor.log])
3581 # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a)
3582 ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a
3583 ovs-appctl -t ovs-ofctl ofctl/barrier
3585 # Check default setting
3586 read -r -d '' expected <<'EOF'
3589 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
3590 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
3591 OFPT_GET_ASYNC_REPLY (OF1.3):
3593 PACKET_IN: no_match action
3594 PORT_STATUS: add delete modify
3595 FLOW_REMOVED: idle hard delete
3599 PORT_STATUS: add delete modify
3601 OFPT_BARRIER_REPLY (OF1.3):
3607 AT_SETUP([ofproto - ofport_request])
3609 ADD_OF_PORTS([br0], [1], [2], [3])
3611 set_and_check_specific_ofports () {
3612 ovs-vsctl set Interface p1 ofport_request="$1" -- \
3613 set Interface p2 ofport_request="$2" -- \
3614 set Interface p3 ofport_request="$3"
3615 ofports=`ovs-vsctl get Interface p1 ofport -- \
3616 get Interface p2 ofport -- \
3617 get Interface p3 ofport`
3618 AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
3621 for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
3622 for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
3623 echo -----------------------------------------------------------
3624 echo "Check changing port numbers from $pre to $post"
3625 set_and_check_specific_ofports $pre
3626 set_and_check_specific_ofports $post
3630 ovs-vsctl del-port p3
3632 set_and_check_poorly_specified_ofports () {
3633 ovs-vsctl set Interface p1 ofport_request="$1" -- \
3634 set Interface p2 ofport_request="$2"
3635 p1=`ovs-vsctl get Interface p1 ofport`
3636 p2=`ovs-vsctl get Interface p2 ofport`
3639 AT_CHECK([test "$p1" != "$p2"])
3640 if test "$1" = "$2" && test "$1" != '[[]]'; then
3641 # One port number must be the requested one.
3642 AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
3643 # The other port number must be different (already tested above).
3645 AT_CHECK([test "$1" = '[[]]' || test "$p1" == "$1"])
3646 AT_CHECK([test "$2" = '[[]]' || test "$p2" == "$2"])
3649 for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
3651 for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
3653 echo -----------------------------------------------------------
3654 echo "Check changing port numbers from $pre to $post"
3655 set_and_check_poorly_specified_ofports $pre
3656 set_and_check_poorly_specified_ofports $post
3663 AT_SETUP([ofproto - bundles, open (OpenFlow 1.4)])
3664 AT_KEYWORDS([monitor])
3667 # Start a monitor, use the required protocol version
3668 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3669 AT_CAPTURE_FILE([monitor.log])
3671 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
3672 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3673 ovs-appctl -t ovs-ofctl ofctl/barrier
3674 ovs-appctl -t ovs-ofctl exit
3676 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
3677 send: OFPT_BUNDLE_CONTROL (OF1.4):
3678 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3679 OFPT_BUNDLE_CONTROL (OF1.4):
3680 bundle_id=0x1 type=OPEN_REPLY flags=0
3681 OFPT_BARRIER_REPLY (OF1.4):
3687 AT_SETUP([ofproto - bundles, double open (OpenFlow 1.4)])
3688 AT_KEYWORDS([monitor])
3691 # Start a monitor, use the required protocol version
3692 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3693 AT_CAPTURE_FILE([monitor.log])
3695 # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
3696 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3697 ovs-appctl -t ovs-ofctl ofctl/barrier
3698 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3699 ovs-appctl -t ovs-ofctl ofctl/barrier
3700 ovs-appctl -t ovs-ofctl exit
3702 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3703 send: OFPT_BUNDLE_CONTROL (OF1.4):
3704 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3705 OFPT_BUNDLE_CONTROL (OF1.4):
3706 bundle_id=0x1 type=OPEN_REPLY flags=0
3707 OFPT_BARRIER_REPLY (OF1.4):
3708 send: OFPT_BUNDLE_CONTROL (OF1.4):
3709 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3710 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3711 OFPT_BUNDLE_CONTROL (OF1.4):
3712 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3713 OFPT_BARRIER_REPLY (OF1.4):
3719 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)])
3720 AT_KEYWORDS([monitor])
3723 # Start a monitor, use the required protocol version
3724 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3725 AT_CAPTURE_FILE([monitor.log])
3727 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3728 ovs-appctl -t ovs-ofctl ofctl/barrier
3729 ovs-appctl -t ovs-ofctl exit
3731 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3732 send: OFPT_BUNDLE_CONTROL (OF1.4):
3733 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3734 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3735 OFPT_BUNDLE_CONTROL (OF1.4):
3736 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3737 OFPT_BARRIER_REPLY (OF1.4):
3743 AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)])
3744 AT_KEYWORDS([monitor])
3747 # Start a monitor, use the required protocol version
3748 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3749 AT_CAPTURE_FILE([monitor.log])
3751 # Open, Close, Close
3752 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3753 ovs-appctl -t ovs-ofctl ofctl/barrier
3754 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3755 ovs-appctl -t ovs-ofctl ofctl/barrier
3756 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3757 ovs-appctl -t ovs-ofctl ofctl/barrier
3758 ovs-appctl -t ovs-ofctl exit
3760 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3761 send: OFPT_BUNDLE_CONTROL (OF1.4):
3762 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3763 OFPT_BUNDLE_CONTROL (OF1.4):
3764 bundle_id=0x1 type=OPEN_REPLY flags=0
3765 OFPT_BARRIER_REPLY (OF1.4):
3766 send: OFPT_BUNDLE_CONTROL (OF1.4):
3767 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3768 OFPT_BUNDLE_CONTROL (OF1.4):
3769 bundle_id=0x1 type=CLOSE_REPLY flags=0
3770 OFPT_BARRIER_REPLY (OF1.4):
3771 send: OFPT_BUNDLE_CONTROL (OF1.4):
3772 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3773 OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED
3774 OFPT_BUNDLE_CONTROL (OF1.4):
3775 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3776 OFPT_BARRIER_REPLY (OF1.4):
3782 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)])
3783 AT_KEYWORDS([monitor])
3786 # Start a monitor, use the required protocol version
3787 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3788 AT_CAPTURE_FILE([monitor.log])
3790 # Open, Close, Close
3791 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3792 ovs-appctl -t ovs-ofctl ofctl/barrier
3793 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
3794 ovs-appctl -t ovs-ofctl ofctl/barrier
3795 ovs-appctl -t ovs-ofctl exit
3797 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3798 send: OFPT_BUNDLE_CONTROL (OF1.4):
3799 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3800 OFPT_BUNDLE_CONTROL (OF1.4):
3801 bundle_id=0x1 type=OPEN_REPLY flags=0
3802 OFPT_BARRIER_REPLY (OF1.4):
3803 send: OFPT_BUNDLE_CONTROL (OF1.4):
3804 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3805 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
3806 OFPT_BUNDLE_CONTROL (OF1.4):
3807 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3808 OFPT_BARRIER_REPLY (OF1.4):
3814 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)])
3815 AT_KEYWORDS([monitor])
3818 # Start a monitor, use the required protocol version
3819 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3820 AT_CAPTURE_FILE([monitor.log])
3822 # Open, Close, Close
3823 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02"
3824 ovs-appctl -t ovs-ofctl ofctl/barrier
3825 ovs-appctl -t ovs-ofctl exit
3827 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3828 send: OFPT_BUNDLE_CONTROL (OF1.4):
3829 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
3830 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3831 OFPT_BUNDLE_CONTROL (OF1.4):
3832 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
3833 OFPT_BARRIER_REPLY (OF1.4):
3839 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)])
3840 AT_KEYWORDS([monitor])
3843 # Start a monitor, use the required protocol version
3844 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3845 AT_CAPTURE_FILE([monitor.log])
3847 # Open, Close, Close
3848 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3849 ovs-appctl -t ovs-ofctl ofctl/barrier
3850 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01"
3851 ovs-appctl -t ovs-ofctl ofctl/barrier
3852 ovs-appctl -t ovs-ofctl exit
3854 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3855 send: OFPT_BUNDLE_CONTROL (OF1.4):
3856 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3857 OFPT_BUNDLE_CONTROL (OF1.4):
3858 bundle_id=0x1 type=OPEN_REPLY flags=0
3859 OFPT_BARRIER_REPLY (OF1.4):
3860 send: OFPT_BUNDLE_CONTROL (OF1.4):
3861 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
3862 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
3863 OFPT_BUNDLE_CONTROL (OF1.4):
3864 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
3865 OFPT_BARRIER_REPLY (OF1.4):
3871 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)])
3872 AT_KEYWORDS([monitor])
3875 # Start a monitor, use the required protocol version
3876 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3877 AT_CAPTURE_FILE([monitor.log])
3879 # Open, Close, Close
3880 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 02"
3881 ovs-appctl -t ovs-ofctl ofctl/barrier
3882 ovs-appctl -t ovs-ofctl exit
3884 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3885 send: OFPT_BUNDLE_CONTROL (OF1.4):
3886 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
3887 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3888 OFPT_BUNDLE_CONTROL (OF1.4):
3889 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
3890 OFPT_BARRIER_REPLY (OF1.4):
3897 AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.4)])
3898 AT_KEYWORDS([monitor])
3901 AT_CHECK([ovs-appctl vlog/set vconn:dbg])
3903 AT_CHECK([ovs-ofctl del-flows br0])
3905 AT_DATA([flows.txt], [dnl
3906 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
3907 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
3908 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
3909 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
3911 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
3912 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
3913 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
3914 delete in_port=2 dl_src=00:88:99:aa:bb:cc
3917 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
3919 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3920 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
3921 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
3925 AT_DATA([flows.txt], [dnl
3927 modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7
3930 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
3932 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3933 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3934 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
3938 # Adding an existing flow acts as a modify, and delete_strict also works.
3939 AT_DATA([flows.txt], [dnl
3940 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8
3941 delete_strict in_port=2 dl_src=00:66:77:88:99:aa
3942 add in_port=2 dl_src=00:66:77:88:99:aa actions=drop
3945 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
3947 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3948 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
3949 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3953 dnl Check logs for OpenFlow trace
3955 OVS_WAIT_UNTIL([cat ovs-vswitchd.log | vconn_windows_sub | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3])
3956 AT_CHECK([print_vconn_debug | vconn_windows_sub | ofctl_strip], [0], [dnl
3957 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3958 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3959 vconn|DBG|unix: received: OFPT_HELLO:
3960 version bitmap: 0x01
3961 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
3962 vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop
3963 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
3964 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
3965 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3966 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3967 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
3968 version bitmap: 0x01, 0x05
3969 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05)
3970 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3971 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
3972 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3973 bundle_id=0 type=OPEN_REPLY flags=0
3974 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3975 bundle_id=0 flags=atomic ordered
3976 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1
3977 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3978 bundle_id=0 flags=atomic ordered
3979 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2
3980 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3981 bundle_id=0 flags=atomic ordered
3982 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3
3983 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3984 bundle_id=0 flags=atomic ordered
3985 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:4
3986 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3987 bundle_id=0 flags=atomic ordered
3988 OFPT_FLOW_MOD (OF1.4): DEL table:255 actions=drop
3989 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3990 bundle_id=0 flags=atomic ordered
3991 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:5
3992 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3993 bundle_id=0 flags=atomic ordered
3994 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:6
3995 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3996 bundle_id=0 flags=atomic ordered
3997 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7
3998 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3999 bundle_id=0 flags=atomic ordered
4000 OFPT_FLOW_MOD (OF1.4): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
4001 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4002 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
4003 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4004 bundle_id=0 type=COMMIT_REPLY flags=0
4005 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4006 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4007 vconn|DBG|unix: received: OFPT_HELLO:
4008 version bitmap: 0x01
4009 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
4010 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
4011 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
4012 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
4013 vconn|DBG|unix: received: NXST_FLOW request:
4014 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
4015 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
4016 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
4017 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4018 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4019 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
4020 version bitmap: 0x01, 0x05
4021 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05)
4022 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4023 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
4024 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4025 bundle_id=0 type=OPEN_REPLY flags=0
4026 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4027 bundle_id=0 flags=atomic ordered
4028 OFPT_FLOW_MOD (OF1.4): MOD actions=drop
4029 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4030 bundle_id=0 flags=atomic ordered
4031 OFPT_FLOW_MOD (OF1.4): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
4032 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4033 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
4034 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4035 bundle_id=0 type=COMMIT_REPLY flags=0
4036 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4037 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4038 vconn|DBG|unix: received: OFPT_HELLO:
4039 version bitmap: 0x01
4040 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
4041 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
4042 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
4043 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
4044 vconn|DBG|unix: received: NXST_FLOW request:
4045 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
4046 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4047 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
4048 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4049 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4050 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
4051 version bitmap: 0x01, 0x05
4052 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05)
4053 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4054 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
4055 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4056 bundle_id=0 type=OPEN_REPLY flags=0
4057 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4058 bundle_id=0 flags=atomic ordered
4059 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8
4060 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4061 bundle_id=0 flags=atomic ordered
4062 OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4063 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4064 bundle_id=0 flags=atomic ordered
4065 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4066 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4067 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
4068 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4069 bundle_id=0 type=COMMIT_REPLY flags=0
4070 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4071 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4072 vconn|DBG|unix: received: OFPT_HELLO:
4073 version bitmap: 0x01
4074 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
4075 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
4076 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
4077 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
4078 vconn|DBG|unix: received: NXST_FLOW request:
4079 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
4080 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
4081 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4088 AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.4)])
4089 AT_KEYWORDS([monitor])
4092 AT_CHECK([ovs-ofctl del-flows br0])
4094 ovs-ofctl add-flows br0 - <<EOF
4095 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=11
4096 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=22
4097 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=33
4099 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
4100 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
4101 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
4102 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
4106 # last line uses illegal table number (OVS internal table)
4107 AT_DATA([flows.txt], [dnl
4108 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
4109 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
4110 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
4111 modify idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
4113 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
4114 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
4115 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
4116 delete in_port=2 dl_src=00:88:99:aa:bb:cc
4117 add table=254 actions=drop
4120 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt 2>&1 | sed '/|WARN|/d
4121 s/unix:.*br0\.mgmt/unix:br0.mgmt/' | sed 's/(.* error)/(error)/'],
4123 OFPT_ERROR (OF1.4) (xid=0xb): OFPBRC_EPERM
4124 OFPT_FLOW_MOD (OF1.4) (xid=0xb): ADD table:254 actions=drop
4125 OFPT_ERROR (OF1.4) (xid=0xd): OFPBFC_MSG_FAILED
4126 OFPT_BUNDLE_CONTROL (OF1.4) (xid=0xd):
4127 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
4128 ovs-ofctl: talking to unix:br0.mgmt (error)
4131 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
4132 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
4133 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
4134 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33