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=1234,type=select,selection_method=hash,bucket=output:10,bucket=output:11
347 group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
349 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
350 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
351 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
352 OFPST_GROUP_DESC reply (OF1.5):
353 group_id=1234,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
355 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
356 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
357 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
358 OFPST_GROUP_DESC reply (OF1.5):
359 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 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
362 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
363 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
364 OFPST_GROUP_DESC reply (OF1.5):
365 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
367 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0], [0])
368 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
369 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
370 OFPST_GROUP_DESC reply (OF1.5):
375 dnl This is really bare-bones.
376 dnl It at least checks request and reply serialization and deserialization.
377 AT_SETUP([ofproto - del group deletes flows])
379 AT_DATA([groups.txt], [dnl
380 group_id=1234,type=all,bucket=output:10
381 group_id=1235,type=all,bucket=output:10
383 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
384 AT_DATA([flows.txt], [dnl
385 tcp actions=group:1234
386 udp actions=group:1235
388 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt])
389 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
391 tcp actions=group:1234
392 udp actions=group:1235
393 OFPST_FLOW reply (OF1.1):
395 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
396 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
398 udp actions=group:1235
399 OFPST_FLOW reply (OF1.1):
401 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
402 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
404 udp actions=group:1235
405 OFPST_FLOW reply (OF1.1):
407 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0])
408 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
410 OFPST_FLOW reply (OF1.1):
415 dnl This is really bare-bones.
416 dnl It at least checks request and reply serialization and deserialization.
417 dnl Actions definition listed in both supported formats (w/ actions=)
418 AT_SETUP([ofproto - insert buckets])
420 AT_DATA([groups.txt], [dnl
421 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
423 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
424 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
425 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
426 OFPST_GROUP_DESC reply (OF1.5):
427 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
429 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])
430 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
431 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
432 OFPST_GROUP_DESC reply (OF1.5):
433 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
435 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])
436 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
437 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
438 OFPST_GROUP_DESC reply (OF1.5):
439 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
441 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15])
442 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
443 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
444 OFPST_GROUP_DESC reply (OF1.5):
445 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
447 AT_DATA([buckets.txt], [dnl
448 group_id=1234,command_bucket_id=11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13
450 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 - < buckets.txt])
451 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
452 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
453 OFPST_GROUP_DESC reply (OF1.5):
454 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
456 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])
457 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
458 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
459 OFPST_GROUP_DESC reply (OF1.5):
460 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
464 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], [],
465 [ovs-ofctl: invalid command bucket id 4294967041
467 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], [],
468 [ovs-ofctl: insert-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
473 dnl This is really bare-bones.
474 dnl It at least checks request and reply serialization and deserialization.
475 dnl Actions definition listed in both supported formats (w/ actions=)
476 AT_SETUP([ofproto - remove buckets])
478 AT_DATA([groups.txt], [dnl
479 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
481 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
482 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
483 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
484 OFPST_GROUP_DESC reply (OF1.5):
485 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
487 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
488 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
489 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
490 OFPST_GROUP_DESC reply (OF1.5):
491 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
493 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
494 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
495 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
496 OFPST_GROUP_DESC reply (OF1.5):
497 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
499 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=13])
500 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
501 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
502 OFPST_GROUP_DESC reply (OF1.5):
503 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
505 AT_DATA([buckets.txt], [dnl
508 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 - < buckets.txt])
509 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
510 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
511 OFPST_GROUP_DESC reply (OF1.5):
512 group_id=1234,type=all
514 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
515 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
516 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=all])
517 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=1], [1], [], [stderr])
518 AT_CHECK([cat stderr | ofctl_strip], [0], [dnl
519 OFPT_ERROR (OF1.5): OFPGMFC_UNKNOWN_BUCKET
520 OFPT_GROUP_MOD (OF1.5):
521 REMOVE_BUCKET command_bucket_id:1,group_id=1234
524 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [],
525 [ovs-ofctl: remove-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
530 dnl This is really bare-bones.
531 dnl It at least checks request and reply serialization and deserialization.
532 AT_SETUP([ofproto - flow mod checks group availability])
534 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
535 AT_DATA([flows.txt], [dnl
536 tcp actions=group:1234
537 udp actions=group:1235
539 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
540 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'], [1], [], [stderr])
542 # The output should look like this:
544 # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................|
545 # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................|
546 # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................|
547 # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............|
549 # This 'sed' command captures the error message but drops details.
550 AT_CHECK([sed '/truncated/d
551 /^000000.0/d' stderr | STRIP_XIDS], [0],
552 [OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP
553 OFPT_FLOW_MOD (OF1.1):
558 dnl This is really bare-bones.
559 dnl It at least checks request and reply serialization and deserialization.
560 AT_SETUP([ofproto - group description])
562 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10], [0], [stdout])
563 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
564 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
565 OFPST_GROUP_DESC reply (OF1.1):
566 group_id=1234,type=all,bucket=actions=output:10
571 dnl This is really bare-bones.
572 dnl It at least checks request and reply serialization and deserialization.
573 AT_SETUP([ofproto - group description])
575 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
576 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
577 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
578 OFPST_GROUP_DESC reply (OF1.1):
579 group_id=1234,type=all,bucket=actions=output:10
584 dnl This is really bare-bones.
585 dnl It at least checks request and reply serialization and deserialization.
586 AT_SETUP([ofproto - group features])
588 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout])
589 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
590 OFPST_GROUP_FEATURES reply (OF1.2):
595 max_groups=0xffffff00
596 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
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
610 dnl This is really bare-bones.
611 dnl It at least checks request and reply serialization and deserialization.
612 AT_SETUP([ofproto - group stats (OpenFlow 1.1)])
614 AT_DATA([groups.txt], [dnl
615 group_id=1234,type=all,bucket=output:10
616 group_id=1235,type=all,bucket=output:10
618 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
619 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
620 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
621 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
622 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
623 OFPST_GROUP reply (OF1.1):
625 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0], [0], [stdout])
626 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
627 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
628 group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
629 OFPST_GROUP reply (OF1.1):
634 dnl This is really bare-bones.
635 dnl It at least checks request and reply serialization and deserialization.
636 AT_SETUP([ofproto - group stats (OpenFlow 1.3)])
638 AT_DATA([groups.txt], [dnl
639 group_id=1234,type=all,bucket=output:10
640 group_id=1235,type=all,bucket=output:10
642 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
643 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-flow br0 'tcp actions=group:1234'])
644 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
645 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
646 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
647 OFPST_GROUP reply (OF1.3):
649 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0], [0], [stdout])
650 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
651 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
652 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
653 OFPST_GROUP reply (OF1.3):
658 dnl This is really bare-bones.
659 dnl It at least checks request and reply serialization and deserialization.
660 AT_SETUP([ofproto - group stats (OpenFlow 1.5)])
662 AT_DATA([groups.txt], [dnl
663 group_id=1234,type=all,bucket=output:10
664 group_id=1235,type=all,bucket=output:10
666 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
667 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-flow br0 'tcp actions=group:1234'])
668 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
669 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
670 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
671 OFPST_GROUP reply (OF1.5):
673 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0], [0], [stdout])
674 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
675 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
676 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
677 OFPST_GROUP reply (OF1.5):
682 dnl This found a use-after-free error in bridge destruction in the
683 dnl presence of groups.
684 AT_SETUP([ofproto - group add then bridge delete (OpenFlow 1.3)])
686 AT_DATA([groups.txt], [dnl
687 group_id=1234,type=all,bucket=output:10
688 group_id=1235,type=all,bucket=output:10
690 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
691 AT_CHECK([ovs-vsctl del-br br0])
695 AT_SETUP([ofproto - mod-port (OpenFlow 1.0)])
697 for command_config_state in \
699 'noflood NO_FLOOD 0' \
700 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
701 'flood PORT_DOWN LINK_DOWN' \
702 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
703 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
704 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
705 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
706 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
710 set $command_config_state
711 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
712 AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
713 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
714 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
715 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
716 n_tables:254, n_buffers:256
717 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
718 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
719 LOCAL(br0): addr:aa:55:aa:55:00:00
722 speed: 0 Mbps now, 0 Mbps max
723 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
729 AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
731 for command_config_state in \
733 'down PORT_DOWN LINK_DOWN' \
734 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
735 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
736 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
737 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
738 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
742 set $command_config_state
743 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
744 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
745 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout])
746 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
747 OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210
748 n_tables:254, n_buffers:256
749 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
750 LOCAL(br0): addr:aa:55:aa:55:00:00
753 speed: 0 Mbps now, 0 Mbps max
754 OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0
760 AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
762 for command_config_state in \
764 'down PORT_DOWN LINK_DOWN' \
765 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
766 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
767 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
768 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
769 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
773 set $command_config_state
774 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
775 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command])
776 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn show br0], [0], [stdout])
777 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
778 OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210
779 n_tables:254, n_buffers:256
780 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
781 OFPST_PORT_DESC reply (OF1.4):
782 LOCAL(br0): addr:aa:55:aa:55:00:00
785 speed: 0 Mbps now, 0 Mbps max
786 OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0
792 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
794 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
796 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -])
797 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
798 AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3])
799 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
800 in_port=1 actions=output:2
801 in_port=2 actions=output:1
802 table=1, in_port=4 actions=output:3
805 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
806 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
808 AT_CHECK([ovs-ofctl del-flows br0])
809 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
814 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
816 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
818 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -])
819 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2])
820 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3])
821 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
822 in_port=1 actions=output:2
823 in_port=2 actions=output:1
824 table=1, in_port=4 actions=output:3
827 AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
828 OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
830 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
831 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
836 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)])
838 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
840 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -])
841 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2])
842 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3])
843 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
844 in_port=1 actions=output:2
845 in_port=2 actions=output:1
846 table=1, in_port=4 actions=output:3
847 OFPST_FLOW reply (OF1.1):
849 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
850 OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2
852 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
853 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
854 table=1, in_port=4 actions=output:3
859 AT_SETUP([ofproto - flow_mod negative test (OpenFlow 1.1)])
861 [set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13])
862 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2])
864 # The error message here actually comes from ovs-ofctl, not from ovs-vswitchd,
865 # but at least it's the same code in ofpacts_check() that issues the error.
866 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1],
868 [ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID)
873 AT_SETUP([ofproto - set-field flow_mod commands (NXM)])
875 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop])
876 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])
877 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])
878 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
879 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[[]]
880 table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]]
886 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)])
888 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
890 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -])
891 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2])
892 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3])
893 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
894 in_port=1 actions=output:2
895 in_port=2 actions=output:1
896 table=1, in_port=4 actions=output:3
897 OFPST_FLOW reply (OF1.2):
899 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
900 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
905 AT_SETUP([ofproto - set-field flow_mod commands (OF1.2)])
907 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 ipv6,table=1,in_port=3,actions=drop])
908 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])
909 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])
910 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
911 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
912 table=1, ipv6,in_port=3 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
913 OFPST_FLOW reply (OF1.2):
918 AT_SETUP([ofproto - dump flows with cookie])
920 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
921 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
922 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
923 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
924 cookie=0x1, in_port=1 actions=output:1
925 cookie=0x2, in_port=2 actions=output:1
926 cookie=0x3, in_port=3 actions=output:1
929 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
930 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
932 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl
933 cookie=0x3, in_port=3 actions=output:1
936 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | STRIP_XIDS], [0], [dnl
937 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
942 AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)])
944 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1])
945 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
946 cookie=0x1, in_port=1 actions=output:1
950 AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1])
951 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
952 cookie=0x2, in_port=1 actions=output:1
958 AT_SETUP([ofproto - mod flow with cookie change (NXM)])
960 AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1])
961 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
962 cookie=0x1, in_port=1 actions=output:1
966 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1])
967 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
968 cookie=0x2, in_port=1 actions=output:1
974 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)])
976 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
977 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
978 cookie=0x1, in_port=1 actions=output:1
979 OFPST_FLOW reply (OF1.1):
981 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1])
982 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
983 cookie=0x1, in_port=1 actions=output:1
984 OFPST_FLOW reply (OF1.1):
989 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
990 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)])
992 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
993 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
994 cookie=0x1, in_port=1 actions=output:1
995 OFPST_FLOW reply (OF1.2):
998 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1])
999 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1000 cookie=0x1, in_port=1 actions=output:1
1001 OFPST_FLOW reply (OF1.2):
1006 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)])
1008 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1009 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
1010 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
1011 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1012 cookie=0x1, in_port=1 actions=output:1
1013 cookie=0x1, in_port=2 actions=output:1
1014 cookie=0x2, in_port=3 actions=output:1
1018 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4])
1019 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1020 cookie=0x1, in_port=1 actions=output:4
1021 cookie=0x1, in_port=2 actions=output:4
1022 cookie=0x2, in_port=3 actions=output:1
1028 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)])
1030 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1031 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1])
1032 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1])
1033 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1034 cookie=0x1, in_port=1 actions=output:1
1035 cookie=0x1, in_port=2 actions=output:1
1036 cookie=0x2, in_port=3 actions=output:1
1037 OFPST_FLOW reply (OF1.1):
1040 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4])
1041 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1042 cookie=0x1, in_port=1 actions=output:4
1043 cookie=0x1, in_port=2 actions=output:4
1044 cookie=0x2, in_port=3 actions=output:1
1045 OFPST_FLOW reply (OF1.1):
1050 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)])
1052 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1053 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1])
1054 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1])
1055 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1056 cookie=0x1, in_port=1 actions=output:1
1057 cookie=0x1, in_port=2 actions=output:1
1058 cookie=0x2, in_port=3 actions=output:1
1059 OFPST_FLOW reply (OF1.2):
1062 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4])
1063 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1064 cookie=0x1, in_port=1 actions=output:4
1065 cookie=0x1, in_port=2 actions=output:4
1066 cookie=0x2, in_port=3 actions=output:1
1067 OFPST_FLOW reply (OF1.2):
1072 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
1073 AT_SETUP([ofproto - mod flows based on cookie mask with cookie change])
1075 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1076 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
1077 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
1078 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1079 cookie=0x1, in_port=1 actions=output:1
1080 cookie=0x1, in_port=2 actions=output:1
1081 cookie=0x2, in_port=3 actions=output:1
1085 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4])
1086 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1087 cookie=0x2, in_port=3 actions=output:1
1088 cookie=0x4, in_port=1 actions=output:4
1089 cookie=0x4, in_port=2 actions=output:4
1095 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM])
1097 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1])
1098 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1099 in_port=1 actions=output:1
1105 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1])
1107 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1])
1108 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1109 in_port=1 actions=output:1
1110 OFPST_FLOW reply (OF1.1):
1115 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2])
1117 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1])
1118 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1119 OFPST_FLOW reply (OF1.2):
1124 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM])
1126 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1])
1127 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1133 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1])
1135 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1136 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1137 OFPST_FLOW reply (OF1.1):
1142 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2])
1144 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1145 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1146 OFPST_FLOW reply (OF1.2):
1151 AT_SETUP([ofproto - del flows with cookies])
1153 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1154 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1155 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1156 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1157 cookie=0x1, in_port=1 actions=output:1
1158 cookie=0x2, in_port=2 actions=output:1
1159 cookie=0x3, in_port=3 actions=output:1
1163 AT_CHECK([ovs-ofctl del-flows br0])
1164 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1170 AT_SETUP([ofproto - del flows based on cookie])
1172 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1173 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1174 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1175 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1176 cookie=0x1, in_port=1 actions=output:1
1177 cookie=0x2, in_port=2 actions=output:1
1178 cookie=0x3, in_port=3 actions=output:1
1182 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1])
1183 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1184 cookie=0x1, in_port=1 actions=output:1
1185 cookie=0x2, in_port=2 actions=output:1
1191 AT_SETUP([ofproto - del flows based on cookie mask])
1193 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1194 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1195 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1196 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1197 cookie=0x1, in_port=1 actions=output:1
1198 cookie=0x2, in_port=2 actions=output:1
1199 cookie=0x3, in_port=3 actions=output:1
1202 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
1203 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1204 cookie=0x2, in_port=2 actions=output:1
1210 AT_SETUP([ofproto - del flows based on table id (NXM)])
1212 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1213 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1214 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1215 cookie=0x1, in_port=1 actions=output:1
1216 cookie=0x2, table=1, in_port=2 actions=output:1
1219 AT_CHECK([ovs-ofctl del-flows br0 table=0])
1220 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1221 cookie=0x2, table=1, in_port=2 actions=output:1
1224 AT_CHECK([ovs-ofctl del-flows br0 table=1])
1225 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1228 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1229 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1230 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1231 cookie=0x1, in_port=1 actions=output:1
1232 cookie=0x2, table=1, in_port=2 actions=output:1
1235 AT_CHECK([ovs-ofctl del-flows br0])
1236 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1242 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)])
1244 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1245 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1246 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1247 cookie=0x1, in_port=1 actions=output:1
1248 cookie=0x2, table=1, in_port=2 actions=output:1
1249 OFPST_FLOW reply (OF1.1):
1251 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0])
1252 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1253 cookie=0x2, table=1, in_port=2 actions=output:1
1254 OFPST_FLOW reply (OF1.1):
1256 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1])
1257 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1258 OFPST_FLOW reply (OF1.1):
1260 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1261 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1262 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1263 cookie=0x1, in_port=1 actions=output:1
1264 cookie=0x2, table=1, in_port=2 actions=output:1
1265 OFPST_FLOW reply (OF1.1):
1267 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
1268 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
1269 OFPST_FLOW reply (OF1.1):
1270 cookie=0x2, table=1, in_port=2 actions=output:1
1275 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)])
1277 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1278 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1279 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1280 cookie=0x1, in_port=1 actions=output:1
1281 cookie=0x2, table=1, in_port=2 actions=output:1
1282 OFPST_FLOW reply (OF1.2):
1284 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0])
1285 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1286 cookie=0x2, table=1, in_port=2 actions=output:1
1287 OFPST_FLOW reply (OF1.2):
1289 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1])
1290 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1291 OFPST_FLOW reply (OF1.2):
1293 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1294 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1295 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1296 cookie=0x1, in_port=1 actions=output:1
1297 cookie=0x2, table=1, in_port=2 actions=output:1
1298 OFPST_FLOW reply (OF1.2):
1300 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
1301 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1302 OFPST_FLOW reply (OF1.2):
1307 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)])
1309 # Check the default configuration.
1311 printf 'OFPST_TABLE reply (xid=0x2):
1313 active=0, lookup=0, matched=0
1316 in_port: exact match or wildcard
1317 eth_src: exact match or wildcard
1318 eth_dst: exact match or wildcard
1319 eth_type: exact match or wildcard
1320 vlan_vid: exact match or wildcard
1321 vlan_pcp: exact match or wildcard
1322 ip_src: exact match or wildcard
1323 ip_dst: exact match or wildcard
1324 nw_proto: exact match or wildcard
1325 nw_tos: exact match or wildcard
1326 tcp_src: exact match or wildcard
1327 tcp_dst: exact match or wildcard
1332 for i in `seq $1 $2`; do
1333 printf ' table %d ("table%d"): ditto\n' $i $i
1336 (head_table classifier; ditto 1 253) > expout
1337 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1338 # Change the configuration.
1341 -- --id=@t0 create Flow_Table name=main \
1342 -- --id=@t1 create Flow_Table flow-limit=1024 \
1343 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1344 | ${PERL} $srcdir/uuidfilt.pl],
1348 # Check that the configuration was updated.
1349 (head_table main; echo ' table 1 ("table1"):
1350 active=0, lookup=0, matched=0
1355 active=0, lookup=0, matched=0
1358 '; ditto 3 253) > expout
1359 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1363 dnl In-band and fail-open add "hidden rules" to table 0. These rules shouldn't
1364 dnl be visible to OpenFlow. This test checks that "dump-flows" and
1365 dnl "dump-tables" don't make them visible.
1366 AT_SETUP([ofproto - hidden rules not in table stats])
1367 # Use an IP address for a controller that won't actually exist: we
1368 # want to create in-band rules but we do not want to actually connect
1369 # to a controller (because that could mess about with our test). The
1370 # Class E range 240.0.0.0 - 255.255.255.255 seems like a good choice.
1371 OVS_VSWITCHD_START([set-controller br0 tcp:240.0.0.1:6653])
1372 for i in 1 2 3 4 5; do ovs-appctl time/warp 1000; done
1374 # Check that no hidden flows are visible in OpenFlow.
1375 AT_CHECK([ovs-ofctl dump-flows br0], [0], [NXST_FLOW reply (xid=0x4):
1378 # Check that some hidden flows related to 240.0.0.1 are actually in table 0.
1380 # We discard flows that mention table_id because we only want table 0 flows,
1381 # which in OVS is implied by the absence of a table_id.
1382 AT_CHECK([ovs-appctl bridge/dump-flows br0], [0], [stdout])
1383 AT_CHECK([test `grep '240\.0\.0\.1' stdout | grep -v table_id= | wc -l` -gt 0])
1385 # Check that dump-tables doesn't count the hidden flows.
1387 printf 'OFPST_TABLE reply (xid=0x2):
1389 active=0, lookup=0, matched=0
1392 in_port: exact match or wildcard
1393 eth_src: exact match or wildcard
1394 eth_dst: exact match or wildcard
1395 eth_type: exact match or wildcard
1396 vlan_vid: exact match or wildcard
1397 vlan_pcp: exact match or wildcard
1398 ip_src: exact match or wildcard
1399 ip_dst: exact match or wildcard
1400 nw_proto: exact match or wildcard
1401 nw_tos: exact match or wildcard
1402 tcp_src: exact match or wildcard
1403 tcp_dst: exact match or wildcard
1408 for i in `seq $1 $2`; do
1409 printf ' table %d ("table%d"): ditto\n' $i $i
1412 (head_table classifier; ditto 1 253) > expout
1413 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1414 OVS_VSWITCHD_STOP(["/cannot find route for controller/d"])
1417 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)])
1419 # Check the default configuration.
1421 printf 'OFPST_TABLE reply (OF1.2) (xid=0x2):
1423 active=0, lookup=0, matched=0
1424 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1427 instructions (table miss and others):
1428 instructions: apply_actions,clear_actions,write_actions,write_metadata,goto_table
1429 Write-Actions and Apply-Actions features:
1430 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
1431 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
1433 metadata: exact match or wildcard
1434 in_port_oxm: exact match or wildcard
1435 eth_src: exact match or wildcard
1436 eth_dst: exact match or wildcard
1437 eth_type: exact match or wildcard
1438 vlan_vid: exact match or wildcard
1439 vlan_pcp: exact match or wildcard
1440 mpls_label: exact match or wildcard
1441 mpls_tc: exact match or wildcard
1442 ip_src: exact match or wildcard
1443 ip_dst: exact match or wildcard
1444 ipv6_src: exact match or wildcard
1445 ipv6_dst: exact match or wildcard
1446 ipv6_label: exact match or wildcard
1447 nw_proto: exact match or wildcard
1448 ip_dscp: exact match or wildcard
1449 nw_ecn: exact match or wildcard
1450 arp_op: exact match or wildcard
1451 arp_spa: exact match or wildcard
1452 arp_tpa: exact match or wildcard
1453 arp_sha: exact match or wildcard
1454 arp_tha: exact match or wildcard
1455 tcp_src: exact match or wildcard
1456 tcp_dst: exact match or wildcard
1457 udp_src: exact match or wildcard
1458 udp_dst: exact match or wildcard
1459 sctp_src: exact match or wildcard
1460 sctp_dst: exact match or wildcard
1461 icmp_type: exact match or wildcard
1462 icmp_code: exact match or wildcard
1463 icmpv6_type: exact match or wildcard
1464 icmpv6_code: exact match or wildcard
1465 nd_target: exact match or wildcard
1466 nd_sll: exact match or wildcard
1467 nd_tll: exact match or wildcard
1472 for i in `seq $1 $2`; do
1473 printf ' table %d ("table%d"): ditto\n' $i $i
1477 printf ' table 253 ("table253"):
1478 active=0, lookup=0, matched=0
1479 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1482 instructions (table miss and others):
1483 instructions: apply_actions,clear_actions,write_actions,write_metadata
1488 (head_table classifier; ditto 1 252; tail_table) > expout
1489 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1490 # Change the configuration.
1493 -- --id=@t0 create Flow_Table name=main \
1494 -- --id=@t1 create Flow_Table flow-limit=1024 \
1495 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1496 | ${PERL} $srcdir/uuidfilt.pl],
1500 # Check that the configuration was updated.
1501 (head_table main; echo ' table 1 ("table1"):
1502 active=0, lookup=0, matched=0
1503 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1510 active=0, lookup=0, matched=0
1511 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1516 '; ditto 3 252; tail_table) > expout
1517 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1521 AT_SETUP([ofproto - table features (OpenFlow 1.3)])
1524 printf ' table 0 ("%s"):
1525 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1527 instructions (table miss and others):
1529 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata,goto_table
1530 Write-Actions and Apply-Actions features:
1531 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
1532 supported on Set-Field: tun_id tun_src tun_dst tun_flags tun_gbp_id tun_gbp_flags tun_metadata0 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 metadata in_port in_port_oxm pkt_mark reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 xreg0 xreg1 xreg2 xreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst 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
1534 dp_hash: arbitrary mask
1535 recirc_id: exact match or wildcard
1536 conj_id: exact match or wildcard
1537 tun_id: arbitrary mask
1538 tun_src: arbitrary mask
1539 tun_dst: arbitrary mask
1540 tun_flags: arbitrary mask
1541 tun_gbp_id: arbitrary mask
1542 tun_gbp_flags: arbitrary mask
1543 tun_metadata0: arbitrary mask
1544 tun_metadata1: arbitrary mask
1545 tun_metadata2: arbitrary mask
1546 tun_metadata3: arbitrary mask
1547 tun_metadata4: arbitrary mask
1548 tun_metadata5: arbitrary mask
1549 tun_metadata6: arbitrary mask
1550 tun_metadata7: arbitrary mask
1551 tun_metadata8: arbitrary mask
1552 tun_metadata9: arbitrary mask
1553 tun_metadata10: arbitrary mask
1554 tun_metadata11: arbitrary mask
1555 tun_metadata12: arbitrary mask
1556 tun_metadata13: arbitrary mask
1557 tun_metadata14: arbitrary mask
1558 tun_metadata15: arbitrary mask
1559 tun_metadata16: arbitrary mask
1560 tun_metadata17: arbitrary mask
1561 tun_metadata18: arbitrary mask
1562 tun_metadata19: arbitrary mask
1563 tun_metadata20: arbitrary mask
1564 tun_metadata21: arbitrary mask
1565 tun_metadata22: arbitrary mask
1566 tun_metadata23: arbitrary mask
1567 tun_metadata24: arbitrary mask
1568 tun_metadata25: arbitrary mask
1569 tun_metadata26: arbitrary mask
1570 tun_metadata27: arbitrary mask
1571 tun_metadata28: arbitrary mask
1572 tun_metadata29: arbitrary mask
1573 tun_metadata30: arbitrary mask
1574 tun_metadata31: arbitrary mask
1575 tun_metadata32: arbitrary mask
1576 tun_metadata33: arbitrary mask
1577 tun_metadata34: arbitrary mask
1578 tun_metadata35: arbitrary mask
1579 tun_metadata36: arbitrary mask
1580 tun_metadata37: arbitrary mask
1581 tun_metadata38: arbitrary mask
1582 tun_metadata39: arbitrary mask
1583 tun_metadata40: arbitrary mask
1584 tun_metadata41: arbitrary mask
1585 tun_metadata42: arbitrary mask
1586 tun_metadata43: arbitrary mask
1587 tun_metadata44: arbitrary mask
1588 tun_metadata45: arbitrary mask
1589 tun_metadata46: arbitrary mask
1590 tun_metadata47: arbitrary mask
1591 tun_metadata48: arbitrary mask
1592 tun_metadata49: arbitrary mask
1593 tun_metadata50: arbitrary mask
1594 tun_metadata51: arbitrary mask
1595 tun_metadata52: arbitrary mask
1596 tun_metadata53: arbitrary mask
1597 tun_metadata54: arbitrary mask
1598 tun_metadata55: arbitrary mask
1599 tun_metadata56: arbitrary mask
1600 tun_metadata57: arbitrary mask
1601 tun_metadata58: arbitrary mask
1602 tun_metadata59: arbitrary mask
1603 tun_metadata60: arbitrary mask
1604 tun_metadata61: arbitrary mask
1605 tun_metadata62: arbitrary mask
1606 tun_metadata63: arbitrary mask
1607 metadata: arbitrary mask
1608 in_port: exact match or wildcard
1609 in_port_oxm: exact match or wildcard
1610 actset_output: exact match or wildcard
1611 pkt_mark: arbitrary mask
1612 reg0: arbitrary mask
1613 reg1: arbitrary mask
1614 reg2: arbitrary mask
1615 reg3: arbitrary mask
1616 reg4: arbitrary mask
1617 reg5: arbitrary mask
1618 reg6: arbitrary mask
1619 reg7: arbitrary mask
1620 xreg0: arbitrary mask
1621 xreg1: arbitrary mask
1622 xreg2: arbitrary mask
1623 xreg3: arbitrary mask
1624 eth_src: arbitrary mask
1625 eth_dst: arbitrary mask
1626 eth_type: exact match or wildcard
1627 vlan_tci: arbitrary mask
1628 vlan_vid: arbitrary mask
1629 vlan_pcp: exact match or wildcard
1630 mpls_label: exact match or wildcard
1631 mpls_tc: exact match or wildcard
1632 mpls_bos: exact match or wildcard
1633 ip_src: arbitrary mask
1634 ip_dst: arbitrary mask
1635 ipv6_src: arbitrary mask
1636 ipv6_dst: arbitrary mask
1637 ipv6_label: arbitrary mask
1638 nw_proto: exact match or wildcard
1639 nw_tos: exact match or wildcard
1640 ip_dscp: exact match or wildcard
1641 nw_ecn: exact match or wildcard
1642 nw_ttl: exact match or wildcard
1643 ip_frag: arbitrary mask
1644 arp_op: exact match or wildcard
1645 arp_spa: arbitrary mask
1646 arp_tpa: arbitrary mask
1647 arp_sha: arbitrary mask
1648 arp_tha: arbitrary mask
1649 tcp_src: arbitrary mask
1650 tcp_dst: arbitrary mask
1651 tcp_flags: arbitrary mask
1652 udp_src: arbitrary mask
1653 udp_dst: arbitrary mask
1654 sctp_src: arbitrary mask
1655 sctp_dst: arbitrary mask
1656 icmp_type: exact match or wildcard
1657 icmp_code: exact match or wildcard
1658 icmpv6_type: exact match or wildcard
1659 icmpv6_code: exact match or wildcard
1660 nd_target: arbitrary mask
1661 nd_sll: arbitrary mask
1662 nd_tll: arbitrary mask
1667 printf ' table %d ("%s"):
1668 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1670 instructions (table miss and others):
1676 ' $1 $2 $3 `expr $1 + 1`
1679 echo ' table 252 ("table252"):
1680 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1682 instructions (table miss and others):
1688 table 253 ("table253"):
1689 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1691 instructions (table miss and others):
1692 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata
1697 (head_table classifier
1698 for i in `seq 1 251`; do
1699 ditto $i table$i 1000000
1701 tail_tables) > expout
1702 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
1703 # Change the configuration.
1706 -- --id=@t0 create Flow_Table name=main \
1707 -- --id=@t1 create Flow_Table flow-limit=1024 \
1708 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1709 | ${PERL} $srcdir/uuidfilt.pl],
1713 # Check that the configuration was updated.
1716 for i in `seq 2 251`; do
1717 ditto $i table$i 1000000
1719 tail_tables) > expout
1720 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
1724 AT_SETUP([ofproto - table description (OpenFlow 1.4)])
1727 while test $x -lt 254; do
1730 eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME"
1733 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
1734 /^OFPST_TABLE_DESC/d'], [0], [expout])
1736 # Change the configuration.
1737 AT_CHECK([ovs-ofctl -O Openflow14 mod-table br0 0 evict])
1738 # Check that the configuration was updated.
1739 mv expout orig-expout
1740 sed -e '2s/eviction=off/eviction=on/' <orig-expout > expout
1741 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d
1742 /^OFPST_TABLE_DESC/d'], [0], [expout])
1746 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)])
1748 # Configure a maximum of 4 flows.
1751 -- --id=@t0 create Flow_Table flow-limit=4 \
1752 -- set bridge br0 flow_tables:0=@t0 \
1753 | ${PERL} $srcdir/uuidfilt.pl],
1757 for in_port in 1 2 3 4; do
1758 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
1760 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1761 in_port=1 actions=drop
1762 in_port=2 actions=drop
1763 in_port=3 actions=drop
1764 in_port=4 actions=drop
1767 # Adding another flow will be refused.
1768 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1769 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1770 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1772 # Also a mod-flow that would add a flow will be refused.
1773 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
1774 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1775 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1777 # Replacing or modifying an existing flow is allowed.
1778 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1779 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1780 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1781 in_port=1 actions=drop
1782 in_port=2 actions=drop
1783 in_port=3 actions=output:1
1784 in_port=4 actions=NORMAL
1790 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)])
1792 # Configure a maximum of 4 flows.
1795 -- --id=@t0 create Flow_Table flow-limit=4 \
1796 -- set bridge br0 flow_tables:0=@t0 \
1797 | ${PERL} $srcdir/uuidfilt.pl],
1801 for in_port in 1 2 3 4; do
1802 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
1804 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1805 in_port=1 actions=drop
1806 in_port=2 actions=drop
1807 in_port=3 actions=drop
1808 in_port=4 actions=drop
1809 OFPST_FLOW reply (OF1.2):
1811 # Adding another flow will be refused.
1812 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1813 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1814 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1816 # Replacing or modifying an existing flow is allowed.
1817 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1818 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1819 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1820 in_port=1 actions=drop
1821 in_port=2 actions=drop
1822 in_port=3 actions=output:1
1823 in_port=4 actions=NORMAL
1824 OFPST_FLOW reply (OF1.2):
1829 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
1831 # Configure a maximum of 4 flows.
1834 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1835 -- set bridge br0 flow_tables:0=@t0 \
1836 | ${PERL} $srcdir/uuidfilt.pl],
1840 for in_port in 4 3 2 1; do
1841 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1843 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1844 idle_timeout=10, in_port=1 actions=drop
1845 idle_timeout=20, in_port=2 actions=drop
1846 idle_timeout=30, in_port=3 actions=drop
1847 idle_timeout=40, in_port=4 actions=drop
1850 # Adding another flow will cause the one that expires soonest to be evicted.
1851 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1852 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1853 idle_timeout=20, in_port=2 actions=drop
1854 idle_timeout=30, in_port=3 actions=drop
1855 idle_timeout=40, in_port=4 actions=drop
1856 in_port=5 actions=drop
1859 # A mod-flow that adds a flow also causes eviction, but replacing or
1860 # modifying an existing flow doesn't.
1861 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
1862 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1863 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1864 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1865 idle_timeout=30, in_port=3 actions=output:1
1866 in_port=4 actions=NORMAL
1867 in_port=5 actions=drop
1868 in_port=6 actions=drop
1871 # Flows with no timeouts at all cannot be evicted.
1872 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
1873 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1874 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1875 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1877 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1878 in_port=4 actions=NORMAL
1879 in_port=5 actions=drop
1880 in_port=6 actions=drop
1881 in_port=7 actions=NORMAL
1887 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
1889 # Configure a maximum of 4 flows.
1892 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1893 -- set bridge br0 flow_tables:0=@t0 \
1894 | ${PERL} $srcdir/uuidfilt.pl],
1898 for in_port in 4 3 2 1; do
1899 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1901 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1902 idle_timeout=10, in_port=1 actions=drop
1903 idle_timeout=20, in_port=2 actions=drop
1904 idle_timeout=30, in_port=3 actions=drop
1905 idle_timeout=40, in_port=4 actions=drop
1906 OFPST_FLOW reply (OF1.2):
1908 # Adding another flow will cause the one that expires soonest to be evicted.
1909 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
1910 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1911 idle_timeout=20, in_port=2 actions=drop
1912 idle_timeout=30, in_port=3 actions=drop
1913 idle_timeout=40, in_port=4 actions=drop
1914 in_port=5 actions=drop
1915 OFPST_FLOW reply (OF1.2):
1917 # In OpenFlow 1.2 a mod-flow does not ever add a flow and thus
1918 # has no effect on eviction
1919 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
1920 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1921 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1922 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1923 idle_timeout=20, in_port=2 actions=drop
1924 idle_timeout=30, in_port=3 actions=output:1
1925 in_port=4 actions=NORMAL
1926 in_port=5 actions=drop
1927 OFPST_FLOW reply (OF1.2):
1929 # Flows with no timeouts at all cannot be evicted.
1930 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
1931 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
1932 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1933 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1934 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1936 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1937 in_port=4 actions=NORMAL
1938 in_port=5 actions=drop
1939 in_port=6 actions=drop
1940 in_port=7 actions=NORMAL
1941 OFPST_FLOW reply (OF1.2):
1946 AT_SETUP([ofproto - eviction using importance upon table overflow (OpenFlow 1.4)])
1948 # Configure a maximum of 4 flows.
1951 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1952 -- set bridge br0 flow_tables:0=@t0 \
1953 | ${PERL} $srcdir/uuidfilt.pl],
1956 # Use mod-table to turn on eviction just to demonstrate that it works.
1957 AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 evict])
1959 for in_port in 4 3 2 1; do
1960 ovs-ofctl -O Openflow14 add-flow br0 importance=$((in_port + 30)),priority=$((in_port + 5)),hard_timeout=$((in_port + 500)),actions=drop
1962 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1963 hard_timeout=501, importance=31, priority=6 actions=drop
1964 hard_timeout=502, importance=32, priority=7 actions=drop
1965 hard_timeout=503, importance=33, priority=8 actions=drop
1966 hard_timeout=504, importance=34, priority=9 actions=drop
1967 OFPST_FLOW reply (OF1.4):
1969 # Adding another flow will cause the one with lowest importance to be evicted.
1970 AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=505,importance=35,priority=10,in_port=2,actions=drop])
1971 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1972 hard_timeout=502, importance=32, priority=7 actions=drop
1973 hard_timeout=503, importance=33, priority=8 actions=drop
1974 hard_timeout=504, importance=34, priority=9 actions=drop
1975 hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop
1976 OFPST_FLOW reply (OF1.4):
1978 # Disable the Eviction configuration.
1979 AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 noevict])
1980 # Adding another flow will cause the system to give error for FULL TABLE.
1981 AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=506,importance=36,priority=11,actions=drop],[1], [], [stderr])
1982 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1983 [OFPT_ERROR (OF1.4): OFPFMFC_TABLE_FULL
1985 #Dump flows. It should show only the old values
1986 AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1987 hard_timeout=502, importance=32, priority=7 actions=drop
1988 hard_timeout=503, importance=33, priority=8 actions=drop
1989 hard_timeout=504, importance=34, priority=9 actions=drop
1990 hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop
1991 OFPST_FLOW reply (OF1.4):
1993 # mod-flow that would modify a flow will be done successfully.
1994 AT_CHECK([ovs-ofctl -O Openflow14 mod-flows br0 in_port=2,actions=NORMAL])
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=NORMAL
2000 OFPST_FLOW reply (OF1.4):
2002 # Also a mod-flow that would add a flow will be refused.
2003 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
2004 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
2005 [OFPT_ERROR: OFPFMFC_TABLE_FULL
2010 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
2012 # Configure a maximum of 4 flows.
2015 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
2016 overflow-policy=evict \
2017 groups='"NXM_OF_IN_PORT[[]]"' \
2018 -- set bridge br0 flow_tables:0=@t0 \
2019 | ${PERL} $srcdir/uuidfilt.pl],
2023 ovs-ofctl add-flows br0 - <<EOF
2024 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
2025 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
2026 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
2027 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
2029 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2030 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2031 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
2032 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2033 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2036 # Adding another flow will cause the one that expires soonest within
2037 # the largest group (those with in_port=1) to be evicted. In this
2038 # case this is not the same as the one that expires soonest overall
2039 # (which is what makes the test interesting):
2040 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
2041 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2042 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2043 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2044 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2045 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2048 # Enlarge the flow limit, change the eviction policy back to strictly
2049 # based on expiration, and and add some flows.
2050 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
2051 ovs-ofctl add-flows br0 - <<EOF
2052 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
2053 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
2054 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
2056 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2057 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2058 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2059 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2060 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2061 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2062 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2063 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2066 # Adding another flow will cause the one that expires soonest overall
2068 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
2069 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2070 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2071 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2072 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2073 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2074 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2075 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2076 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2079 # Reducing the flow limit also causes the flows that expire soonest
2080 # overall to be evicted.
2081 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
2082 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2083 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2084 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2085 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2086 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2092 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
2094 # Configure a maximum of 4 flows.
2097 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
2098 overflow-policy=evict \
2099 groups='"NXM_OF_IN_PORT[[]]"' \
2100 -- set bridge br0 flow_tables:0=@t0 \
2101 | ${PERL} $srcdir/uuidfilt.pl],
2105 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
2106 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
2107 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
2108 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
2109 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
2111 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2112 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2113 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
2114 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2115 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2116 OFPST_FLOW reply (OF1.2):
2118 # Adding another flow will cause the one that expires soonest within
2119 # the largest group (those with in_port=1) to be evicted. In this
2120 # case this is not the same as the one that expires soonest overall
2121 # (which is what makes the test interesting):
2122 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
2123 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2124 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2125 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2126 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2127 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2128 OFPST_FLOW reply (OF1.2):
2130 # Enlarge the flow limit, change the eviction policy back to strictly
2131 # based on expiration, and and add some flows.
2132 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
2133 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
2134 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
2135 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
2136 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
2138 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2139 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
2140 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2141 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2142 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2143 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2144 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2145 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2146 OFPST_FLOW reply (OF1.2):
2148 # Adding another flow will cause the one that expires soonest overall
2150 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'])
2151 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2152 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
2153 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
2154 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
2155 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2156 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2157 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2158 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2159 OFPST_FLOW reply (OF1.2):
2161 # Reducing the flow limit also causes the flows that expire soonest
2162 # overall to be evicted.
2163 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
2164 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2165 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2166 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2167 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2168 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2169 OFPST_FLOW reply (OF1.2):
2174 AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout])
2176 # Configure a maximum of 4 flows.
2179 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2180 -- set bridge br0 flow_tables:0=@t0 \
2181 | ${PERL} $srcdir/uuidfilt.pl],
2184 ovs-appctl time/stop
2186 for in_port in 4 3 2 1; do
2187 ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
2189 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2190 hard_timeout=13, in_port=1 actions=drop
2191 hard_timeout=16, in_port=2 actions=drop
2192 hard_timeout=19, in_port=3 actions=drop
2193 hard_timeout=22, in_port=4 actions=drop
2196 # Sleep and modify the one that expires soonest
2197 ovs-appctl time/warp 5000
2198 AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop])
2199 # At this point the table would looks like:
2200 # in_port seconds to expire
2205 ovs-appctl time/warp 2000
2206 # Adding another flow will cause the one that expires soonest to be evicted.
2207 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
2208 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2209 hard_timeout=13, in_port=1 actions=drop
2210 hard_timeout=19, in_port=3 actions=drop
2211 hard_timeout=22, in_port=4 actions=drop
2212 in_port=5 actions=drop
2218 AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout])
2219 OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1])
2220 # Configure a maximum of 4 flows.
2223 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2224 -- set bridge br0 flow_tables:0=@t0 \
2225 | ${PERL} $srcdir/uuidfilt.pl],
2229 for in_port in 4 3 2 1; do
2230 ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
2232 ovs-appctl time/stop
2233 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2234 idle_timeout=13, in_port=1 actions=drop
2235 idle_timeout=16, in_port=2 actions=drop
2236 idle_timeout=19, in_port=3 actions=drop
2237 idle_timeout=22, in_port=4 actions=drop
2240 # Sleep and receive on the flow that expires soonest
2241 ovs-appctl time/warp 5000
2242 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)'])
2243 # At this point the table would looks like:
2244 # in_port seconds to expire
2249 ovs-appctl time/warp 2000
2250 # Adding another flow will cause the one that expires soonest to be evicted.
2251 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
2252 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2253 idle_timeout=19, in_port=3 actions=drop
2254 idle_timeout=22, in_port=4 actions=drop
2255 in_port=5 actions=drop
2256 n_packets=1, n_bytes=60, idle_timeout=13, in_port=1 actions=drop
2262 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
2264 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
2266 printf '\n\n--- check_async %d ---\n\n\n' $1
2269 ovs-appctl -t ovs-ofctl ofctl/barrier
2270 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2273 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2274 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
2275 if test X"$1" = X"OFPR_ACTION"; then shift;
2276 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2277 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2280 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2281 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2282 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2283 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
2284 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2287 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2288 ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2289 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2290 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
2291 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"
2294 # OFPT_PORT_STATUS, OFPPR_ADD
2295 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
2296 if test X"$1" = X"OFPPR_ADD"; then shift;
2297 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
2300 speed: 0 Mbps now, 0 Mbps max"
2303 # OFPT_PORT_STATUS, OFPPR_DELETE
2304 ovs-vsctl del-port br0 test
2305 if test X"$1" = X"OFPPR_DELETE"; then shift;
2306 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
2309 speed: 0 Mbps now, 0 Mbps max"
2312 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2313 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
2314 ovs-ofctl --strict del-flows br0 ''
2315 if test X"$1" = X"OFPRR_DELETE"; then shift;
2316 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
2318 AT_FAIL_IF([test X"$1" != X])
2320 ovs-appctl -t ovs-ofctl ofctl/barrier
2321 echo >>expout "OFPT_BARRIER_REPLY:"
2325 s/ (xid=0x[0-9a-fA-F]*)//
2327 s/00:0.$/00:0x/' < monitor.log]],
2331 # It's a service connection so initially there should be no async messages.
2334 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2335 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2336 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2338 # Set miss_send_len to 128 and enable invalid_ttl.
2339 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
2340 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2342 # Become slave, which should disable everything except port status.
2343 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
2344 check_async 4 OFPPR_ADD OFPPR_DELETE
2346 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
2347 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
2348 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2350 # Set controller ID 123.
2351 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
2352 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2354 # Restore controller ID 0.
2355 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
2358 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
2359 check_async 7 OFPR_ACTION OFPPR_ADD
2361 ovs-appctl -t ovs-ofctl exit
2365 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
2367 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2369 printf '\n\n--- check_async %d ---\n\n\n' $1
2373 ovs-appctl -t ovs-ofctl ofctl/barrier
2374 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2377 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2378 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
2379 if test X"$1" = X"OFPR_ACTION"; then shift;
2380 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2381 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2384 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2385 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2386 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2387 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2388 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2391 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2392 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2393 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2394 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2395 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"
2398 # OFPT_PORT_STATUS, OFPPR_ADD
2399 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2400 if test X"$1" = X"OFPPR_ADD"; then shift;
2401 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2404 speed: 0 Mbps now, 0 Mbps max"
2407 # OFPT_PORT_STATUS, OFPPR_DELETE
2408 ovs-vsctl del-port br0 test
2409 if test X"$1" = X"OFPPR_DELETE"; then shift;
2410 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2413 speed: 0 Mbps now, 0 Mbps max"
2416 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2417 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
2418 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
2419 if test X"$1" = X"OFPRR_DELETE"; then shift;
2420 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
2422 AT_FAIL_IF([test X"$1" != X])
2424 ovs-appctl -t ovs-ofctl ofctl/barrier
2425 echo >>expout "OFPT_BARRIER_REPLY (OF1.2):"
2429 s/ (xid=0x[0-9a-fA-F]*)//
2431 s/00:0.$/00:0x/' < monitor.log]],
2435 # It's a service connection so initially there should be no async messages.
2438 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2439 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2440 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2442 # Set miss_send_len to 128 and enable invalid_ttl.
2443 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
2444 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2446 # Become slave (OF 1.2), which should disable everything except port status.
2447 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
2448 check_async 4 OFPPR_ADD OFPPR_DELETE
2450 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
2451 ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
2452 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2454 # Set controller ID 123.
2455 ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
2456 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2458 # Restore controller ID 0.
2459 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
2461 # Become master (OF 1.2).
2462 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
2463 check_async 7 OFPR_ACTION OFPPR_ADD
2465 ovs-appctl -t ovs-ofctl exit
2469 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
2471 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
2473 printf '\n\n--- check_async %d ---\n\n\n' $1
2477 ovs-appctl -t ovs-ofctl ofctl/barrier
2478 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2481 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2482 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
2483 if test X"$1" = X"OFPR_ACTION"; then shift;
2484 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2485 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2488 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2489 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2490 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2491 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2492 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2495 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2496 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2497 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2498 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2499 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"
2502 # OFPT_PORT_STATUS, OFPPR_ADD
2503 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2504 if test X"$1" = X"OFPPR_ADD"; then shift;
2505 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2508 speed: 0 Mbps now, 0 Mbps max"
2511 # OFPT_PORT_STATUS, OFPPR_DELETE
2512 ovs-vsctl del-port br0 test
2513 if test X"$1" = X"OFPPR_DELETE"; then shift;
2514 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2517 speed: 0 Mbps now, 0 Mbps max"
2520 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2521 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
2522 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
2523 if test X"$1" = X"OFPRR_DELETE"; then shift;
2524 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
2527 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
2528 ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10
2529 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234
2530 ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234
2531 if test X"$1" = X"OFPRR_DELETE"; then shift;
2532 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=gropu_delete table_id=0"
2535 AT_FAIL_IF([test X"$1" != X])
2537 ovs-appctl -t ovs-ofctl ofctl/barrier
2538 echo >>expout "OFPT_BARRIER_REPLY (OF1.3):"
2542 s/ (xid=0x[0-9a-fA-F]*)//
2544 s/00:0.$/00:0x/' < monitor.log]],
2548 # It's a service connection so initially there should be no async messages.
2551 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2552 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
2553 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2555 # Become slave (OF 1.3), which should disable everything except port status.
2556 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
2557 check_async 3 OFPPR_ADD OFPPR_DELETE
2559 # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
2560 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005
2561 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2563 # Set controller ID 123.
2564 ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
2565 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2567 # Restore controller ID 0.
2568 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
2570 # Become master (OF 1.3).
2571 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
2572 check_async 6 OFPR_ACTION OFPPR_ADD
2574 ovs-appctl -t ovs-ofctl exit
2578 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.4)])
2580 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile])
2582 printf '\n\n--- check_async %d ---\n\n\n' $1
2586 ovs-appctl -t ovs-ofctl ofctl/barrier
2587 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2590 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2591 ovs-ofctl -O OpenFlow14 -v packet-out br0 none controller '0001020304050010203040501234'
2592 if test X"$1" = X"OFPR_ACTION"; then shift;
2593 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2594 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2597 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2598 ovs-ofctl -O OpenFlow14 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2599 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2600 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2601 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2604 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2605 ovs-ofctl -O OpenFlow14 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2606 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2607 echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2608 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"
2611 # OFPT_PORT_STATUS, OFPPR_ADD
2612 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2613 if test X"$1" = X"OFPPR_ADD"; then shift;
2614 echo >>expout "OFPT_PORT_STATUS (OF1.4): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2617 speed: 0 Mbps now, 0 Mbps max"
2620 # OFPT_PORT_STATUS, OFPPR_MODIFY
2621 ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 test up
2622 if test X"$1" = X"OFPPR_MODIFY"; then shift;
2623 echo >>expout "OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2626 speed: 0 Mbps now, 0 Mbps max
2627 OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2630 speed: 0 Mbps now, 0 Mbps max"
2633 # OFPT_PORT_STATUS, OFPPR_DELETE
2634 ovs-vsctl del-port br0 test
2635 if test X"$1" = X"OFPPR_DELETE"; then shift;
2636 echo >>expout "OFPT_PORT_STATUS (OF1.4): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2639 speed: 0 Mbps now, 0 Mbps max"
2642 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2643 ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=drop
2644 ovs-ofctl -O OpenFlow14 --strict del-flows br0 ''
2645 if test X"$1" = X"OFPRR_DELETE"; then shift;
2646 echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=delete table_id=0"
2649 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
2650 ovs-ofctl -O OpenFlow14 add-group br0 group_id=1234,type=all,bucket=output:10
2651 ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=group:1234
2652 ovs-ofctl -O OpenFlow14 --strict del-groups br0 group_id=1234
2653 if test X"$1" = X"OFPRR_GROUP_DELETE"; then shift;
2654 echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=group_delete table_id=0"
2657 AT_FAIL_IF([test X"$1" != X])
2659 ovs-appctl -t ovs-ofctl ofctl/barrier
2660 echo >>expout "OFPT_BARRIER_REPLY (OF1.4):"
2664 s/ (xid=0x[0-9a-fA-F]*)//
2666 s/00:0.$/00:0x/' < monitor.log]],
2670 # It's a service connection so initially there should be no async messages.
2673 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2674 ovs-appctl -t ovs-ofctl ofctl/send 0509000c0123456700000080
2675 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
2677 # Become slave (OF 1.4), which should disable everything except port status.
2678 ovs-appctl -t ovs-ofctl ofctl/send 051800180000000200000003000000000000000000000001
2679 check_async 3 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
2681 # Use OF 1.4 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
2682 ovs-appctl -t ovs-ofctl ofctl/send 051c0038000000020000000800000005000100080000000200020008000000020003000800000005000400080000001c0005000800000005
2683 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
2685 # Set controller ID 123.
2686 ovs-appctl -t ovs-ofctl ofctl/send 05040018000000030000232000000014000000000000007b
2687 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
2689 # Restore controller ID 0.
2690 ovs-appctl -t ovs-ofctl ofctl/send 050400180000000300002320000000140000000000000000
2692 # Become master (OF 1.4).
2693 ovs-appctl -t ovs-ofctl ofctl/send 051800180000000400000002000000000000000000000002
2694 check_async 6 OFPR_ACTION OFPPR_ADD OFPPR_MODIFY OFPRR_DELETE
2696 ovs-appctl -t ovs-ofctl exit
2700 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.5)])
2702 AT_CHECK([ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile])
2704 printf '\n\n--- check_async %d ---\n\n\n' $1
2708 ovs-appctl -t ovs-ofctl ofctl/barrier
2709 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2712 # Other tests are not working with OF 1.5, and message
2713 # format may change, so leave them out.
2715 # OFPT_PORT_STATUS, OFPPR_ADD
2716 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2717 if test X"$1" = X"OFPPR_ADD"; then shift;
2718 echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2721 speed: 0 Mbps now, 0 Mbps max"
2724 # OFPT_PORT_STATUS, OFPPR_MODIFY
2725 ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test up
2726 if test X"$1" = X"OFPPR_MODIFY"; then shift;
2727 echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2730 speed: 0 Mbps now, 0 Mbps max
2731 OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x
2734 speed: 0 Mbps now, 0 Mbps max"
2737 # OFPT_PORT_STATUS, OFPPR_DELETE
2738 ovs-vsctl del-port br0 test
2739 if test X"$1" = X"OFPPR_DELETE"; then shift;
2740 echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2743 speed: 0 Mbps now, 0 Mbps max"
2746 AT_FAIL_IF([test X"$1" != X])
2748 ovs-appctl -t ovs-ofctl ofctl/barrier
2749 echo >>expout "OFPT_BARRIER_REPLY (OF1.5):"
2753 s/ (xid=0x[0-9a-fA-F]*)//
2755 s/00:0.$/00:0x/' < monitor.log]],
2759 # It's a service connection so initially there should be no async messages.
2762 # If we don't set this, async messages are not received.
2763 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2764 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
2765 check_async 2 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
2767 # Set-async has changed in OF 1.4 and is not yet implemented.
2769 ovs-appctl -t ovs-ofctl exit
2773 dnl This test checks that the role request/response messaging works
2774 dnl and that generation_id is handled properly.
2775 AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
2777 on_exit 'kill `cat c1.pid c2.pid`'
2779 # Start two ovs-ofctl controller processes.
2780 AT_CAPTURE_FILE([monitor1.log])
2781 AT_CAPTURE_FILE([expout1])
2782 AT_CAPTURE_FILE([experr1])
2783 AT_CAPTURE_FILE([monitor2.log])
2784 AT_CAPTURE_FILE([expout2])
2785 AT_CAPTURE_FILE([experr2])
2787 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
2788 ovs-appctl -t `pwd`/c$i ofctl/barrier
2789 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2793 # find out current role
2794 ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000
2795 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange"
2796 echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
2799 # controller 1: Become slave (generation_id is initially undefined, so
2800 # 2^63+2 should not be stale)
2801 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
2802 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
2803 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
2805 # controller 2: Become master.
2806 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
2807 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
2808 echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
2810 # controller 1: Try to become the master using a stale generation ID
2811 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
2812 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
2813 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
2814 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
2816 # controller 1: Become master using a valid generation ID
2817 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
2818 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
2819 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
2822 ovs-appctl -t `pwd`/c$i ofctl/barrier
2823 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):"
2829 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2831 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2836 dnl This test checks that the role request/response messaging works,
2837 dnl that generation_id is handled properly, and that role status update
2838 dnl messages are sent when a controller's role gets changed from master
2840 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
2842 on_exit 'kill `cat c1.pid c2.pid`'
2844 # Start two ovs-ofctl controller processes.
2845 AT_CAPTURE_FILE([monitor1.log])
2846 AT_CAPTURE_FILE([expout1])
2847 AT_CAPTURE_FILE([experr1])
2848 AT_CAPTURE_FILE([monitor2.log])
2849 AT_CAPTURE_FILE([expout2])
2850 AT_CAPTURE_FILE([experr2])
2852 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
2853 ovs-appctl -t `pwd`/c$i ofctl/barrier
2854 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2858 # find out current role
2859 ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000
2860 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange"
2861 echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
2864 # controller 1: Become slave (generation_id is initially undefined, so
2865 # 2^63+2 should not be stale)
2866 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
2867 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
2868 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
2870 # controller 2: Become master.
2871 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
2872 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
2873 echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
2875 # controller 1: Try to become the master using a stale generation ID
2876 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
2877 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2878 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
2879 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2881 # controller 1: Become master using a valid generation ID
2882 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
2883 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
2884 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
2885 echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
2888 ovs-appctl -t `pwd`/c$i ofctl/barrier
2889 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):"
2895 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2897 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2902 dnl This test checks the Group and meter notifications when a group mod
2903 dnl command is sent from one controller and the reply is received by
2904 dnl other controllers.
2905 AT_SETUP([ofproto - requestforward (OpenFlow 1.4)])
2907 on_exit 'kill `cat c1.pid c2.pid c3.pid`'
2909 # Start two ovs-ofctl controller processes.
2910 AT_CAPTURE_FILE([monitor1.log])
2911 AT_CAPTURE_FILE([expout1])
2912 AT_CAPTURE_FILE([monitor2.log])
2913 AT_CAPTURE_FILE([expout2])
2914 AT_CAPTURE_FILE([monitor3.log])
2915 AT_CAPTURE_FILE([expout3])
2917 ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile=`pwd`/c1.pid --unixctl=`pwd`/c1
2918 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c2.pid --unixctl=`pwd`/c2
2919 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c3.pid --unixctl=`pwd`/c3
2923 ovs-appctl -t `pwd`/c$i ofctl/barrier
2924 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2928 printf '\n\n--- check_async %d ---\n\n\n' $1
2933 ovs-appctl -t `pwd`/c2 ofctl/send 050f0010000000020000000000000001
2934 if test X"$1" = X"OFPGC_ADD"; then shift;
2935 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
2936 ADD group_id=1,type=all"
2937 echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
2938 ADD group_id=1,type=all"
2939 echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
2940 ADD group_id=1,type=all"
2944 ovs-appctl -t `pwd`/c2 ofctl/send 050f0010000000020001010000000001
2945 if test X"$1" = X"OFPGC_MODIFY"; then shift;
2946 echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
2947 MOD group_id=1,type=select"
2948 echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
2949 MOD group_id=1,type=select"
2950 echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
2951 MOD group_id=1,type=select"
2954 ovs-appctl -t `pwd`/c1 ofctl/barrier
2955 echo >>expout1 "OFPT_BARRIER_REPLY (OF1.5):"
2956 ovs-appctl -t `pwd`/c2 ofctl/barrier
2957 echo >>expout2 "OFPT_BARRIER_REPLY (OF1.4):"
2958 ovs-appctl -t `pwd`/c3 ofctl/barrier
2959 echo >>expout3 "OFPT_BARRIER_REPLY (OF1.4):"
2966 s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
2971 # controller 1: Become slave
2972 ovs-appctl -t `pwd`/c1 ofctl/send 061800180000000300000003000000008000000000000002
2974 # controller 2: Become master
2975 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
2977 # controller 1: Become slave
2978 ovs-appctl -t `pwd`/c3 ofctl/send 051800180000000300000003000000008000000000000004
2980 # controller 1: Enabled requestforward using set Asynchronous message
2981 ovs-appctl -t `pwd`/c1 ofctl/send 061c00280000000200000008000000050002000800000002000400080000001a000a000800000003
2983 # controller 2: Enabled requestforward using set Asynchronous message
2984 ovs-appctl -t `pwd`/c2 ofctl/send 051c002800000002000100080000000200030008000000050005000800000005000b000800000003
2986 # controller 1: Enabled requestforward using set Asynchronous message
2987 ovs-appctl -t `pwd`/c3 ofctl/send 051c00280000000200000008000000050002000800000002000400080000001a000a000800000003
2988 check_async 1 OFPGC_ADD OFPGC_MODIFY
2993 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2994 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
2995 dnl controllers despite the spec) as meaning a packet that was generated
2996 dnl by the controller.
2997 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
2999 ADD_OF_PORTS([br0], [1])
3001 # Start a monitor listening for packet-ins.
3002 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
3003 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
3004 ovs-appctl -t ovs-ofctl ofctl/barrier
3005 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3006 AT_CAPTURE_FILE([monitor.log])
3008 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
3009 AT_CHECK([ovs-ofctl packet-out br0 none controller,1 '0001020304050010203040501234'])
3010 AT_CHECK([ovs-ofctl packet-out br0 controller controller,1 '0001020304050010203040505678'])
3012 # Stop the monitor and check its output.
3013 ovs-appctl -t ovs-ofctl ofctl/barrier
3014 ovs-appctl -t ovs-ofctl exit
3016 ovs-ofctl dump-ports br0
3018 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3019 OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3020 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3021 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3022 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
3029 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
3030 dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
3031 dnl controllers despite the spec) as meaning a packet that was generated
3032 dnl by the controller.
3033 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
3036 # Start a monitor listening for packet-ins.
3037 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
3038 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
3039 ovs-appctl -t ovs-ofctl ofctl/barrier
3040 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3041 AT_CAPTURE_FILE([monitor.log])
3043 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
3044 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
3045 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
3047 # Stop the monitor and check its output.
3048 ovs-appctl -t ovs-ofctl ofctl/barrier
3049 ovs-appctl -t ovs-ofctl exit
3051 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3052 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3053 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3054 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3055 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
3056 OFPT_BARRIER_REPLY (OF1.2):
3062 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
3063 dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some
3064 dnl controllers despite the spec) as meaning a packet that was generated
3065 dnl by the controller.
3066 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)])
3069 # Start a monitor listening for packet-ins.
3070 AT_CHECK([ovs-ofctl -O OpenFlow11 monitor br0 --detach --no-chdir --pidfile])
3071 ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080
3072 ovs-appctl -t ovs-ofctl ofctl/barrier
3073 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3074 AT_CAPTURE_FILE([monitor.log])
3076 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
3077 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 none controller '0001020304050010203040501234'])
3078 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 4294967293 controller '0001020304050010203040505678'])
3080 # Stop the monitor and check its output.
3081 ovs-appctl -t ovs-ofctl ofctl/barrier
3082 ovs-appctl -t ovs-ofctl exit
3084 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3085 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3086 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3087 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3088 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
3089 OFPT_BARRIER_REPLY (OF1.1):
3095 dnl This test checks that metadata is encoded in packet_in structures,
3096 dnl supported by NXAST.
3097 AT_SETUP([ofproto - packet-out with metadata (NXM)])
3100 # Start a monitor listening for packet-ins.
3101 AT_CHECK([ovs-ofctl -P nxm monitor br0 --detach --no-chdir --pidfile])
3102 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
3103 ovs-appctl -t ovs-ofctl ofctl/barrier
3104 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3105 AT_CAPTURE_FILE([monitor.log])
3107 # Send a packet-out with a load action to set some metadata, and forward to controller
3108 AT_CHECK([ovs-ofctl packet-out br0 controller 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), load(0xaa->NXM_NX_PKT_MARK[[]]), controller' '0001020304050010203040501234'])
3110 # Stop the monitor and check its output.
3111 ovs-appctl -t ovs-ofctl ofctl/barrier
3112 ovs-appctl -t ovs-ofctl exit
3114 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3115 NXT_PACKET_IN: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3116 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3123 dnl This test checks that metadata is encoded in packet_in structures,
3124 dnl supported by NXAST.
3125 AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
3128 # Start a monitor listening for packet-ins.
3129 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
3130 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
3131 ovs-appctl -t ovs-ofctl ofctl/barrier
3132 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3133 AT_CAPTURE_FILE([monitor.log])
3135 # Send a packet-out with a set-field action to set some metadata, and forward to controller
3136 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234'])
3138 # Stop the monitor and check its output.
3139 ovs-appctl -t ovs-ofctl ofctl/barrier
3140 ovs-appctl -t ovs-ofctl exit
3142 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3143 OFPT_PACKET_IN (OF1.2): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=ANY (via action) data_len=14 (unbuffered)
3144 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3145 OFPT_BARRIER_REPLY (OF1.2):
3151 dnl This test checks that metadata is encoded in packet_in structures,
3152 dnl supported by NXAST.
3153 AT_SETUP([ofproto - packet-out with metadata and dual set_field (OpenFlow 1.3)])
3156 # Start a monitor listening for packet-ins.
3157 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
3158 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
3159 ovs-appctl -t ovs-ofctl ofctl/barrier
3160 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3161 AT_CAPTURE_FILE([monitor.log])
3163 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
3164 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, set_field:0x6b->metadata, controller' '0001020304050010203040501234'])
3166 # Stop the monitor and check its output.
3167 ovs-appctl -t ovs-ofctl ofctl/barrier
3168 ovs-appctl -t ovs-ofctl exit
3170 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3171 OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0x6b,in_port=ANY (via action) data_len=14 (unbuffered)
3172 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3173 OFPT_BARRIER_REPLY (OF1.3):
3179 dnl This test checks that tunnel metadata is encoded in packet_in structures.
3180 AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
3183 # Start a monitor listening for packet-ins.
3184 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
3185 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
3186 ovs-appctl -t ovs-ofctl ofctl/barrier
3187 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3188 AT_CAPTURE_FILE([monitor.log])
3190 # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
3191 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'])
3193 # Stop the monitor and check its output.
3194 ovs-appctl -t ovs-ofctl ofctl/barrier
3195 ovs-appctl -t ovs-ofctl exit
3197 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
3198 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)
3199 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
3200 OFPT_BARRIER_REPLY (OF1.2):
3206 m4_divert_push([PREPARE_TESTS])
3207 # Sorts groups of lines that start with a space, without moving them
3208 # past the nearest line that does not start with a space.
3218 print $_ foreach sort(@buffer);
3223 print $_ foreach sort(@buffer);
3226 m4_divert_pop([PREPARE_TESTS])
3228 AT_SETUP([ofproto - flow monitoring])
3229 AT_KEYWORDS([monitor])
3232 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
3234 # Start a monitor watching the flow table and check the initial reply.
3235 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
3236 AT_CAPTURE_FILE([monitor.log])
3237 ovs-appctl -t ovs-ofctl ofctl/barrier
3238 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3239 [NXST_FLOW_MONITOR reply:
3240 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
3244 # Add, delete, and modify some flows and check the updates.
3245 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3246 ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
3247 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
3248 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
3249 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
3250 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
3251 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
3252 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
3253 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
3254 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
3255 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
3256 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
3257 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
3258 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
3259 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
3260 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
3261 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
3262 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
3263 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
3264 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
3265 ovs-ofctl add-flow br0 in_port=0,actions=output:23
3266 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
3267 ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
3268 ovs-ofctl del-flows br0 dl_vlan=123
3269 ovs-ofctl del-flows br0
3270 ovs-appctl -t ovs-ofctl ofctl/barrier
3271 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
3272 [NXST_FLOW_MONITOR reply (xid=0x0):
3273 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
3274 NXST_FLOW_MONITOR reply (xid=0x0):
3275 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
3276 NXST_FLOW_MONITOR reply (xid=0x0):
3277 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
3278 NXST_FLOW_MONITOR reply (xid=0x0):
3279 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
3280 NXST_FLOW_MONITOR reply (xid=0x0):
3281 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
3282 NXST_FLOW_MONITOR reply (xid=0x0):
3283 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
3284 NXST_FLOW_MONITOR reply (xid=0x0):
3285 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
3286 NXST_FLOW_MONITOR reply (xid=0x0):
3287 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
3288 NXST_FLOW_MONITOR reply (xid=0x0):
3289 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
3290 NXST_FLOW_MONITOR reply (xid=0x0):
3291 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
3292 NXST_FLOW_MONITOR reply (xid=0x0):
3293 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
3294 NXST_FLOW_MONITOR reply (xid=0x0):
3295 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
3296 NXST_FLOW_MONITOR reply (xid=0x0):
3297 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
3298 NXST_FLOW_MONITOR reply (xid=0x0):
3299 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
3300 NXST_FLOW_MONITOR reply (xid=0x0):
3301 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
3302 NXST_FLOW_MONITOR reply (xid=0x0):
3303 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
3304 NXST_FLOW_MONITOR reply (xid=0x0):
3305 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
3306 NXST_FLOW_MONITOR reply (xid=0x0):
3307 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
3308 NXST_FLOW_MONITOR reply (xid=0x0):
3309 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
3310 NXST_FLOW_MONITOR reply (xid=0x0):
3311 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
3312 NXST_FLOW_MONITOR reply (xid=0x0):
3313 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
3314 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
3315 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
3316 NXST_FLOW_MONITOR reply (xid=0x0):
3317 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
3318 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
3319 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
3320 NXST_FLOW_MONITOR reply (xid=0x0):
3321 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
3322 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
3323 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
3324 NXST_FLOW_MONITOR reply (xid=0x0):
3325 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
3326 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
3327 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
3328 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
3329 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
3330 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
3331 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
3332 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
3333 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
3334 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
3335 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
3339 # Check that our own changes are reported as full updates.
3340 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3341 ovs-ofctl add-flow br0 in_port=1,actions=output:2
3342 ovs-ofctl add-flow br0 in_port=2,actions=output:1
3343 ovs-appctl -t ovs-ofctl ofctl/barrier
3344 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
3345 ovs-appctl -t ovs-ofctl ofctl/barrier
3346 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
3348 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
3349 [NXST_FLOW_MONITOR reply (xid=0x0):
3350 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
3351 NXST_FLOW_MONITOR reply (xid=0x0):
3352 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
3354 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
3355 NXST_FLOW_MONITOR reply (xid=0x0):
3356 event=DELETED reason=delete table=0 cookie=0 in_port=1 actions=output:2
3357 event=DELETED reason=delete table=0 cookie=0 in_port=2 actions=output:1
3361 ovs-appctl -t ovs-ofctl exit
3365 AT_SETUP([ofproto - flow monitoring with !own])
3366 AT_KEYWORDS([monitor])
3369 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
3371 # Start a monitor watching the flow table and check the initial reply.
3372 ovs-ofctl monitor br0 watch:\!own --detach --no-chdir --pidfile >monitor.log 2>&1
3373 AT_CAPTURE_FILE([monitor.log])
3374 ovs-appctl -t ovs-ofctl ofctl/barrier
3375 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3376 [NXST_FLOW_MONITOR reply:
3377 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
3381 # Check that our own changes are reported as abbreviations.
3382 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3383 ovs-ofctl add-flow br0 in_port=1,actions=output:2
3384 ovs-ofctl add-flow br0 in_port=2,actions=output:1
3385 ovs-appctl -t ovs-ofctl ofctl/barrier
3386 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
3387 ovs-appctl -t ovs-ofctl ofctl/barrier
3388 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
3390 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3391 [NXST_FLOW_MONITOR reply (xid=0x0):
3392 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
3393 NXST_FLOW_MONITOR reply (xid=0x0):
3394 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
3396 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
3397 NXST_FLOW_MONITOR reply (xid=0x0):
3398 event=ABBREV xid=0x12345678
3402 ovs-appctl -t ovs-ofctl exit
3406 AT_SETUP([ofproto - flow monitoring with out_port])
3407 AT_KEYWORDS([monitor])
3410 ovs-ofctl add-flow br0 in_port=0,dl_vlan=121,actions=output:1
3411 ovs-ofctl add-flow br0 in_port=0,dl_vlan=122,actions=output:1
3412 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:2
3414 # Start a monitor watching the flow table and check the initial reply.
3415 ovs-ofctl monitor br0 watch:out_port=2 --detach --no-chdir --pidfile >monitor.log 2>&1
3416 AT_CAPTURE_FILE([monitor.log])
3417 ovs-appctl -t ovs-ofctl ofctl/barrier
3418 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3419 [NXST_FLOW_MONITOR reply:
3420 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
3424 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3426 # Add, modify flows and check the updates.
3427 ovs-ofctl mod-flows br0 dl_vlan=121,actions=drop
3428 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1,output:2
3429 ovs-appctl -t ovs-ofctl ofctl/barrier
3431 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:1,output:2
3432 ovs-appctl -t ovs-ofctl ofctl/barrier
3434 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1
3435 ovs-appctl -t ovs-ofctl ofctl/barrier
3436 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:2
3437 ovs-appctl -t ovs-ofctl ofctl/barrier
3439 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3440 [NXST_FLOW_MONITOR reply (xid=0x0):
3441 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1,output:2
3443 NXST_FLOW_MONITOR reply (xid=0x0):
3444 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1,output:2
3446 NXST_FLOW_MONITOR reply (xid=0x0):
3447 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1
3449 NXST_FLOW_MONITOR reply (xid=0x0):
3450 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
3454 ovs-appctl -t ovs-ofctl exit
3458 AT_SETUP([ofproto - flow monitoring pause and resume])
3459 AT_KEYWORDS([monitor])
3461 # The maximum socket receive buffer size is important for this test, which
3462 # tests behavior when the receive buffer overflows.
3463 if test -e /proc/sys/net/core/rmem_max; then
3465 rmem_max=`cat /proc/sys/net/core/rmem_max`
3466 elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
3469 # Don't know how to get maximum socket receive buffer on this OS
3472 # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
3473 # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
3474 queue_size=`expr $rmem_max + 128 \* 1024`
3475 echo rmem_max=$rmem_max queue_size=$queue_size
3477 # If there's too much queuing skip the test to avoid timing out.
3478 AT_SKIP_IF([test $rmem_max -gt 1048576])
3480 # Each flow update message takes up at least 48 bytes of space in queues
3481 # and in practice more than that.
3482 n_msgs=`expr $queue_size / 48`
3487 # Start a monitor watching the flow table, then make it block.
3488 on_exit 'kill `cat ovs-ofctl.pid`'
3489 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
3490 AT_CAPTURE_FILE([monitor.log])
3491 ovs-appctl -t ovs-ofctl ofctl/block
3493 # Add $n_msgs flows.
3494 (echo "in_port=2,actions=output:2"
3496 for ($i = 0; $i < '$n_msgs'; $i++) {
3497 print "cookie=1,reg1=$i,actions=drop\n";
3500 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3501 # Check that multipart flow dumps work properly:
3502 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
3503 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
3504 AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
3505 AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
3507 ovs-appctl -t ovs-ofctl ofctl/unblock
3509 # Wait for the connection resumed.
3510 # A barrier doesn't work for this purpose.
3511 # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html
3512 # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html
3513 OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log])
3515 ovs-appctl -t ovs-ofctl exit
3517 # Check that the flow monitor reported the same number of flows
3518 # added and deleted, but fewer than we actually added and deleted.
3519 adds=`grep -c 'ADDED.*reg1=' monitor.log`
3520 deletes=`grep -c 'DELETED.*reg1=' monitor.log`
3521 echo adds=$adds deletes=$deletes
3522 AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
3523 AT_CHECK([test $adds = $deletes])
3525 # Check that the flow monitor reported everything in the expected order:
3527 # event=ADDED table=0 cookie=0x1 reg1=0x22
3529 # NXT_FLOW_MONITOR_PAUSED:
3531 # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3533 # event=ADDED table=0 cookie=0x3 in_port=1
3534 # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
3535 # NXT_FLOW_MONITOR_RESUMED:
3537 # except that, between the PAUSED and RESUMED, the order of the ADDED
3538 # and MODIFIED lines lines depends on hash order, that is, it varies
3539 # as we change the hash function or change architecture. Therefore,
3540 # we use a couple of tests below to accept both orders.
3541 AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
3544 /NXT_FLOW_MONITOR_PAUSED:/p
3545 /NXT_FLOW_MONITOR_RESUMED:/p
3546 ' > monitor.log.subset])
3547 AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
3548 event=ADDED table=0 cookie=0x1 reg1=0x22
3549 NXT_FLOW_MONITOR_PAUSED:
3550 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3551 event=ADDED table=0 cookie=0x3 in_port=1
3552 NXT_FLOW_MONITOR_RESUMED:
3554 AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
3555 NXT_FLOW_MONITOR_PAUSED:
3556 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3557 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
3558 NXT_FLOW_MONITOR_RESUMED:
3564 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
3565 AT_KEYWORDS([monitor])
3568 # Start a monitor, use the required protocol version
3569 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3570 AT_CAPTURE_FILE([monitor.log])
3572 # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a)
3573 ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a
3574 ovs-appctl -t ovs-ofctl ofctl/barrier
3576 # Check default setting
3577 read -r -d '' expected <<'EOF'
3580 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
3581 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
3582 OFPT_GET_ASYNC_REPLY (OF1.3):
3584 PACKET_IN: no_match action
3585 PORT_STATUS: add delete modify
3586 FLOW_REMOVED: idle hard delete
3590 PORT_STATUS: add delete modify
3592 OFPT_BARRIER_REPLY (OF1.3):
3598 AT_SETUP([ofproto - ofport_request])
3600 ADD_OF_PORTS([br0], [1], [2], [3])
3602 set_and_check_specific_ofports () {
3603 ovs-vsctl set Interface p1 ofport_request="$1" -- \
3604 set Interface p2 ofport_request="$2" -- \
3605 set Interface p3 ofport_request="$3"
3606 ofports=`ovs-vsctl get Interface p1 ofport -- \
3607 get Interface p2 ofport -- \
3608 get Interface p3 ofport`
3609 AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
3612 for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
3613 for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
3614 echo -----------------------------------------------------------
3615 echo "Check changing port numbers from $pre to $post"
3616 set_and_check_specific_ofports $pre
3617 set_and_check_specific_ofports $post
3621 ovs-vsctl del-port p3
3623 set_and_check_poorly_specified_ofports () {
3624 ovs-vsctl set Interface p1 ofport_request="$1" -- \
3625 set Interface p2 ofport_request="$2"
3626 p1=`ovs-vsctl get Interface p1 ofport`
3627 p2=`ovs-vsctl get Interface p2 ofport`
3630 AT_CHECK([test "$p1" != "$p2"])
3631 if test "$1" = "$2" && test "$1" != '[[]]'; then
3632 # One port number must be the requested one.
3633 AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
3634 # The other port number must be different (already tested above).
3636 AT_CHECK([test "$1" = '[[]]' || test "$p1" == "$1"])
3637 AT_CHECK([test "$2" = '[[]]' || test "$p2" == "$2"])
3640 for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
3642 for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
3644 echo -----------------------------------------------------------
3645 echo "Check changing port numbers from $pre to $post"
3646 set_and_check_poorly_specified_ofports $pre
3647 set_and_check_poorly_specified_ofports $post
3654 AT_SETUP([ofproto - bundles, open (OpenFlow 1.4)])
3655 AT_KEYWORDS([monitor])
3658 # Start a monitor, use the required protocol version
3659 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3660 AT_CAPTURE_FILE([monitor.log])
3662 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
3663 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3664 ovs-appctl -t ovs-ofctl ofctl/barrier
3665 ovs-appctl -t ovs-ofctl exit
3667 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
3668 send: OFPT_BUNDLE_CONTROL (OF1.4):
3669 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3670 OFPT_BUNDLE_CONTROL (OF1.4):
3671 bundle_id=0x1 type=OPEN_REPLY flags=0
3672 OFPT_BARRIER_REPLY (OF1.4):
3678 AT_SETUP([ofproto - bundles, double open (OpenFlow 1.4)])
3679 AT_KEYWORDS([monitor])
3682 # Start a monitor, use the required protocol version
3683 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3684 AT_CAPTURE_FILE([monitor.log])
3686 # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
3687 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3688 ovs-appctl -t ovs-ofctl ofctl/barrier
3689 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3690 ovs-appctl -t ovs-ofctl ofctl/barrier
3691 ovs-appctl -t ovs-ofctl exit
3693 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3694 send: OFPT_BUNDLE_CONTROL (OF1.4):
3695 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3696 OFPT_BUNDLE_CONTROL (OF1.4):
3697 bundle_id=0x1 type=OPEN_REPLY flags=0
3698 OFPT_BARRIER_REPLY (OF1.4):
3699 send: OFPT_BUNDLE_CONTROL (OF1.4):
3700 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3701 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3702 OFPT_BUNDLE_CONTROL (OF1.4):
3703 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3704 OFPT_BARRIER_REPLY (OF1.4):
3710 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)])
3711 AT_KEYWORDS([monitor])
3714 # Start a monitor, use the required protocol version
3715 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3716 AT_CAPTURE_FILE([monitor.log])
3718 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3719 ovs-appctl -t ovs-ofctl ofctl/barrier
3720 ovs-appctl -t ovs-ofctl exit
3722 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3723 send: OFPT_BUNDLE_CONTROL (OF1.4):
3724 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3725 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3726 OFPT_BUNDLE_CONTROL (OF1.4):
3727 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3728 OFPT_BARRIER_REPLY (OF1.4):
3734 AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)])
3735 AT_KEYWORDS([monitor])
3738 # Start a monitor, use the required protocol version
3739 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3740 AT_CAPTURE_FILE([monitor.log])
3742 # Open, Close, Close
3743 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3744 ovs-appctl -t ovs-ofctl ofctl/barrier
3745 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3746 ovs-appctl -t ovs-ofctl ofctl/barrier
3747 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3748 ovs-appctl -t ovs-ofctl ofctl/barrier
3749 ovs-appctl -t ovs-ofctl exit
3751 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3752 send: OFPT_BUNDLE_CONTROL (OF1.4):
3753 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3754 OFPT_BUNDLE_CONTROL (OF1.4):
3755 bundle_id=0x1 type=OPEN_REPLY flags=0
3756 OFPT_BARRIER_REPLY (OF1.4):
3757 send: OFPT_BUNDLE_CONTROL (OF1.4):
3758 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3759 OFPT_BUNDLE_CONTROL (OF1.4):
3760 bundle_id=0x1 type=CLOSE_REPLY flags=0
3761 OFPT_BARRIER_REPLY (OF1.4):
3762 send: OFPT_BUNDLE_CONTROL (OF1.4):
3763 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3764 OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED
3765 OFPT_BUNDLE_CONTROL (OF1.4):
3766 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3767 OFPT_BARRIER_REPLY (OF1.4):
3773 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)])
3774 AT_KEYWORDS([monitor])
3777 # Start a monitor, use the required protocol version
3778 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3779 AT_CAPTURE_FILE([monitor.log])
3781 # Open, Close, Close
3782 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3783 ovs-appctl -t ovs-ofctl ofctl/barrier
3784 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
3785 ovs-appctl -t ovs-ofctl ofctl/barrier
3786 ovs-appctl -t ovs-ofctl exit
3788 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3789 send: OFPT_BUNDLE_CONTROL (OF1.4):
3790 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3791 OFPT_BUNDLE_CONTROL (OF1.4):
3792 bundle_id=0x1 type=OPEN_REPLY flags=0
3793 OFPT_BARRIER_REPLY (OF1.4):
3794 send: OFPT_BUNDLE_CONTROL (OF1.4):
3795 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3796 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
3797 OFPT_BUNDLE_CONTROL (OF1.4):
3798 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3799 OFPT_BARRIER_REPLY (OF1.4):
3805 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)])
3806 AT_KEYWORDS([monitor])
3809 # Start a monitor, use the required protocol version
3810 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3811 AT_CAPTURE_FILE([monitor.log])
3813 # Open, Close, Close
3814 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02"
3815 ovs-appctl -t ovs-ofctl ofctl/barrier
3816 ovs-appctl -t ovs-ofctl exit
3818 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3819 send: OFPT_BUNDLE_CONTROL (OF1.4):
3820 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
3821 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3822 OFPT_BUNDLE_CONTROL (OF1.4):
3823 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
3824 OFPT_BARRIER_REPLY (OF1.4):
3830 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)])
3831 AT_KEYWORDS([monitor])
3834 # Start a monitor, use the required protocol version
3835 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3836 AT_CAPTURE_FILE([monitor.log])
3838 # Open, Close, Close
3839 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3840 ovs-appctl -t ovs-ofctl ofctl/barrier
3841 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01"
3842 ovs-appctl -t ovs-ofctl ofctl/barrier
3843 ovs-appctl -t ovs-ofctl exit
3845 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3846 send: OFPT_BUNDLE_CONTROL (OF1.4):
3847 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3848 OFPT_BUNDLE_CONTROL (OF1.4):
3849 bundle_id=0x1 type=OPEN_REPLY flags=0
3850 OFPT_BARRIER_REPLY (OF1.4):
3851 send: OFPT_BUNDLE_CONTROL (OF1.4):
3852 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
3853 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
3854 OFPT_BUNDLE_CONTROL (OF1.4):
3855 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
3856 OFPT_BARRIER_REPLY (OF1.4):
3862 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)])
3863 AT_KEYWORDS([monitor])
3866 # Start a monitor, use the required protocol version
3867 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3868 AT_CAPTURE_FILE([monitor.log])
3870 # Open, Close, Close
3871 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 02"
3872 ovs-appctl -t ovs-ofctl ofctl/barrier
3873 ovs-appctl -t ovs-ofctl exit
3875 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3876 send: OFPT_BUNDLE_CONTROL (OF1.4):
3877 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
3878 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3879 OFPT_BUNDLE_CONTROL (OF1.4):
3880 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
3881 OFPT_BARRIER_REPLY (OF1.4):
3888 AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.4)])
3889 AT_KEYWORDS([monitor])
3892 AT_CHECK([ovs-appctl vlog/set vconn:dbg])
3894 AT_CHECK([ovs-ofctl del-flows br0])
3896 AT_DATA([flows.txt], [dnl
3897 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
3898 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
3899 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
3900 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
3902 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
3903 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
3904 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
3905 delete in_port=2 dl_src=00:88:99:aa:bb:cc
3908 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
3910 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3911 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
3912 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
3916 AT_DATA([flows.txt], [dnl
3918 modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7
3921 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
3923 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3924 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3925 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
3929 # Adding an existing flow acts as a modify, and delete_strict also works.
3930 AT_DATA([flows.txt], [dnl
3931 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8
3932 delete_strict in_port=2 dl_src=00:66:77:88:99:aa
3933 add in_port=2 dl_src=00:66:77:88:99:aa actions=drop
3936 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
3938 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3939 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
3940 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3944 dnl Check logs for OpenFlow trace
3946 OVS_WAIT_UNTIL([cat ovs-vswitchd.log | vconn_windows_sub | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3])
3947 AT_CHECK([print_vconn_debug | vconn_windows_sub | ofctl_strip], [0], [dnl
3948 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3949 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3950 vconn|DBG|unix: received: OFPT_HELLO:
3951 version bitmap: 0x01
3952 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
3953 vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop
3954 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
3955 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
3956 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3957 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3958 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
3959 version bitmap: 0x01, 0x05
3960 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05)
3961 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3962 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
3963 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3964 bundle_id=0 type=OPEN_REPLY flags=0
3965 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3966 bundle_id=0 flags=atomic ordered
3967 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1
3968 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3969 bundle_id=0 flags=atomic ordered
3970 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2
3971 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3972 bundle_id=0 flags=atomic ordered
3973 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3
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:4
3977 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3978 bundle_id=0 flags=atomic ordered
3979 OFPT_FLOW_MOD (OF1.4): DEL table:255 actions=drop
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:66:77:88:99:aa idle:50 actions=output:5
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:77:88:99:aa:bb idle:60 actions=output:6
3986 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3987 bundle_id=0 flags=atomic ordered
3988 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7
3989 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3990 bundle_id=0 flags=atomic ordered
3991 OFPT_FLOW_MOD (OF1.4): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
3992 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3993 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
3994 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3995 bundle_id=0 type=COMMIT_REPLY flags=0
3996 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3997 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3998 vconn|DBG|unix: received: OFPT_HELLO:
3999 version bitmap: 0x01
4000 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
4001 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
4002 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
4003 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
4004 vconn|DBG|unix: received: NXST_FLOW request:
4005 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
4006 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
4007 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
4008 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4009 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4010 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
4011 version bitmap: 0x01, 0x05
4012 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05)
4013 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4014 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
4015 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4016 bundle_id=0 type=OPEN_REPLY flags=0
4017 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4018 bundle_id=0 flags=atomic ordered
4019 OFPT_FLOW_MOD (OF1.4): MOD actions=drop
4020 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4021 bundle_id=0 flags=atomic ordered
4022 OFPT_FLOW_MOD (OF1.4): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
4023 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4024 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
4025 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4026 bundle_id=0 type=COMMIT_REPLY flags=0
4027 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4028 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4029 vconn|DBG|unix: received: OFPT_HELLO:
4030 version bitmap: 0x01
4031 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
4032 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
4033 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
4034 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
4035 vconn|DBG|unix: received: NXST_FLOW request:
4036 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
4037 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4038 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
4039 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4040 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4041 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
4042 version bitmap: 0x01, 0x05
4043 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05)
4044 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4045 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
4046 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4047 bundle_id=0 type=OPEN_REPLY flags=0
4048 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4049 bundle_id=0 flags=atomic ordered
4050 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8
4051 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4052 bundle_id=0 flags=atomic ordered
4053 OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4054 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
4055 bundle_id=0 flags=atomic ordered
4056 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4057 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
4058 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
4059 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
4060 bundle_id=0 type=COMMIT_REPLY flags=0
4061 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
4062 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
4063 vconn|DBG|unix: received: OFPT_HELLO:
4064 version bitmap: 0x01
4065 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
4066 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
4067 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
4068 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
4069 vconn|DBG|unix: received: NXST_FLOW request:
4070 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
4071 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
4072 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
4079 AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.4)])
4080 AT_KEYWORDS([monitor])
4083 AT_CHECK([ovs-ofctl del-flows br0])
4085 ovs-ofctl add-flows br0 - <<EOF
4086 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=11
4087 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=22
4088 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=33
4090 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
4091 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
4092 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
4093 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
4097 # last line uses illegal table number (OVS internal table)
4098 AT_DATA([flows.txt], [dnl
4099 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
4100 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
4101 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
4102 modify idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
4104 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
4105 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
4106 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
4107 delete in_port=2 dl_src=00:88:99:aa:bb:cc
4108 add table=254 actions=drop
4111 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt 2>&1 | sed '/|WARN|/d
4112 s/unix:.*br0\.mgmt/unix:br0.mgmt/' | sed 's/(.* error)/(error)/'],
4114 OFPT_ERROR (OF1.4) (xid=0xb): OFPBRC_EPERM
4115 OFPT_FLOW_MOD (OF1.4) (xid=0xb): ADD table:254 actions=drop
4116 OFPT_ERROR (OF1.4) (xid=0xd): OFPBFC_MSG_FAILED
4117 OFPT_BUNDLE_CONTROL (OF1.4) (xid=0xd):
4118 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
4119 ovs-ofctl: talking to unix:br0.mgmt (error)
4122 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
4123 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
4124 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
4125 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33