]>
Commit | Line | Data |
---|---|---|
a2cb9dfd BP |
1 | AT_BANNER([ofproto]) |
2 | ||
a2cb9dfd | 3 | AT_SETUP([ofproto - echo request]) |
023e1e0a | 4 | OVS_VSWITCHD_START |
ea523221 | 5 | AT_CHECK([ovs-ofctl -vwarn probe br0]) |
023e1e0a | 6 | OVS_VSWITCHD_STOP |
a2cb9dfd BP |
7 | AT_CLEANUP |
8 | ||
2b4cca6f | 9 | AT_SETUP([ofproto - handling messages with bad version]) |
68030e16 | 10 | AT_KEYWORDS([monitor]) |
2b4cca6f BP |
11 | OVS_VSWITCHD_START |
12 | ||
13 | # Start a monitor running OpenFlow 1.0, then send the switch an OF1.1 features | |
14 | # request | |
6409e008 | 15 | AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile]) |
2b4cca6f BP |
16 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log |
17 | AT_CAPTURE_FILE([monitor.log]) | |
18 | ovs-appctl -t ovs-ofctl ofctl/send 0205000801234567 | |
19 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 20 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
2b4cca6f BP |
21 | |
22 | AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)// | |
23 | /ECHO/d' monitor.log], [0], [dnl | |
24 | send: OFPT_FEATURES_REQUEST (OF1.1): | |
25 | OFPT_ERROR (OF1.1): OFPBRC_BAD_VERSION | |
26 | OFPT_FEATURES_REQUEST (OF1.1): | |
27 | OFPT_BARRIER_REPLY: | |
28 | ]) | |
29 | ||
30 | OVS_VSWITCHD_STOP(["/received OpenFlow version 0x02 != expected 01/d"]) | |
31 | AT_CLEANUP | |
32 | ||
a2cb9dfd | 33 | AT_SETUP([ofproto - feature request, config request]) |
023e1e0a | 34 | OVS_VSWITCHD_START |
ea523221 | 35 | AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout]) |
8a32aaa5 | 36 | AT_CHECK([strip_xids < stdout], [0], [dnl |
9e1fd49b | 37 | OFPT_FEATURES_REPLY: dpid:fedcba9876543210 |
c184807c | 38 | n_tables:254, n_buffers:0 |
9e1fd49b | 39 | capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP |
08d1e234 | 40 | actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst |
0ab14c8e | 41 | LOCAL(br0): addr:aa:55:aa:55:00:00 |
1839c356 FL |
42 | config: PORT_DOWN |
43 | state: LINK_DOWN | |
d02a5f8e | 44 | speed: 0 Mbps now, 0 Mbps max |
3b62feba | 45 | OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0 |
a2cb9dfd | 46 | ]) |
023e1e0a | 47 | OVS_VSWITCHD_STOP |
81816a5f JP |
48 | AT_CLEANUP |
49 | ||
50 | AT_SETUP([ofproto - set OpenFlow port number]) | |
51 | OVS_VSWITCHD_START( | |
52 | [add-port br0 p1 -- set Interface p1 type=dummy --\ | |
53 | add-port br0 p2 -- set Interface p2 type=dummy ofport_request=99]) | |
54 | AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout]) | |
e44768b7 JP |
55 | AT_CHECK([[sed ' |
56 | s/ (xid=0x[0-9a-fA-F]*)// | |
57 | s/00:0.$/00:0x/' < stdout]], | |
58 | [0], [dnl | |
81816a5f | 59 | OFPT_FEATURES_REPLY: dpid:fedcba9876543210 |
c184807c | 60 | n_tables:254, n_buffers:0 |
81816a5f | 61 | capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP |
08d1e234 | 62 | actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst |
e44768b7 | 63 | 1(p1): addr:aa:55:aa:55:00:0x |
81816a5f JP |
64 | config: PORT_DOWN |
65 | state: LINK_DOWN | |
d02a5f8e | 66 | speed: 0 Mbps now, 0 Mbps max |
e44768b7 | 67 | 99(p2): addr:aa:55:aa:55:00:0x |
81816a5f JP |
68 | config: PORT_DOWN |
69 | state: LINK_DOWN | |
d02a5f8e | 70 | speed: 0 Mbps now, 0 Mbps max |
e44768b7 | 71 | LOCAL(br0): addr:aa:55:aa:55:00:0x |
1839c356 FL |
72 | config: PORT_DOWN |
73 | state: LINK_DOWN | |
d02a5f8e | 74 | speed: 0 Mbps now, 0 Mbps max |
81816a5f JP |
75 | OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0 |
76 | ]) | |
e44768b7 | 77 | |
81816a5f | 78 | OVS_VSWITCHD_STOP |
a2cb9dfd BP |
79 | AT_CLEANUP |
80 | ||
eaa6eb2a BP |
81 | dnl This is really bare-bones. |
82 | dnl It at least checks request and reply serialization and deserialization. | |
9dcd1c00 | 83 | AT_SETUP([ofproto - port stats - (OpenFlow 1.0)]) |
023e1e0a | 84 | OVS_VSWITCHD_START |
ea523221 | 85 | AT_CHECK([ovs-ofctl -vwarn dump-ports br0], [0], [stdout]) |
8a32aaa5 | 86 | AT_CHECK([strip_xids < stdout], [0], [dnl |
eaa6eb2a | 87 | OFPST_PORT reply: 1 ports |
d6e3feb5 | 88 | port LOCAL: rx pkts=0, bytes=0, drop=?, errs=?, frame=?, over=?, crc=? |
89 | tx pkts=0, bytes=0, drop=?, errs=?, coll=? | |
eaa6eb2a | 90 | ]) |
023e1e0a | 91 | OVS_VSWITCHD_STOP |
eaa6eb2a BP |
92 | AT_CLEANUP |
93 | ||
9dcd1c00 SH |
94 | AT_SETUP([ofproto - port stats - (OpenFlow 1.2)]) |
95 | OVS_VSWITCHD_START | |
96 | AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports br0], [0], [stdout]) | |
8a32aaa5 | 97 | AT_CHECK([strip_xids < stdout], [0], [dnl |
9dcd1c00 | 98 | OFPST_PORT reply (OF1.2): 1 ports |
d6e3feb5 | 99 | port LOCAL: rx pkts=0, bytes=0, drop=?, errs=?, frame=?, over=?, crc=? |
100 | tx pkts=0, bytes=0, drop=?, errs=?, coll=? | |
9dcd1c00 SH |
101 | ]) |
102 | OVS_VSWITCHD_STOP | |
103 | AT_CLEANUP | |
104 | ||
5469537b BP |
105 | AT_SETUP([ofproto - port stats - (OpenFlow 1.4)]) |
106 | OVS_VSWITCHD_START | |
107 | AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-ports br0], [0], [stdout]) | |
8a32aaa5 | 108 | AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/'], |
5469537b BP |
109 | [0], [dnl |
110 | OFPST_PORT reply (OF1.4): 1 ports | |
d6e3feb5 | 111 | port LOCAL: rx pkts=0, bytes=0, drop=?, errs=?, frame=?, over=?, crc=? |
112 | tx pkts=0, bytes=0, drop=?, errs=?, coll=? | |
5469537b BP |
113 | duration=?s |
114 | ]) | |
115 | OVS_VSWITCHD_STOP | |
116 | AT_CLEANUP | |
117 | ||
2be393ed JP |
118 | dnl This is really bare-bones. |
119 | dnl It at least checks request and reply serialization and deserialization. | |
9dcd1c00 | 120 | AT_SETUP([ofproto - port-desc stats (OpenFlow 1.0)]) |
2be393ed JP |
121 | OVS_VSWITCHD_START |
122 | AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], [stdout]) | |
8a32aaa5 | 123 | AT_CHECK([strip_xids < stdout], [0], [dnl |
2be393ed JP |
124 | OFPST_PORT_DESC reply: |
125 | LOCAL(br0): addr:aa:55:aa:55:00:00 | |
1839c356 FL |
126 | config: PORT_DOWN |
127 | state: LINK_DOWN | |
d02a5f8e | 128 | speed: 0 Mbps now, 0 Mbps max |
2be393ed JP |
129 | ]) |
130 | OVS_VSWITCHD_STOP | |
131 | AT_CLEANUP | |
132 | ||
eaa6eb2a BP |
133 | dnl This is really bare-bones. |
134 | dnl It at least checks request and reply serialization and deserialization. | |
9dcd1c00 SH |
135 | AT_SETUP([ofproto - port-desc stats (OpenFlow 1.2)]) |
136 | OVS_VSWITCHD_START | |
137 | AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc br0], [0], [stdout]) | |
8a32aaa5 | 138 | AT_CHECK([strip_xids < stdout], [0], [dnl |
9dcd1c00 SH |
139 | OFPST_PORT_DESC reply (OF1.2): |
140 | LOCAL(br0): addr:aa:55:aa:55:00:00 | |
1839c356 FL |
141 | config: PORT_DOWN |
142 | state: LINK_DOWN | |
9dcd1c00 SH |
143 | speed: 0 Mbps now, 0 Mbps max |
144 | ]) | |
145 | OVS_VSWITCHD_STOP | |
146 | AT_CLEANUP | |
147 | ||
70ae4f93 BP |
148 | AT_SETUP([ofproto - port-desc stats (OpenFlow 1.5)]) |
149 | OVS_VSWITCHD_START | |
ca5792f0 | 150 | add_of_ports br0 1 2 3 |
70ae4f93 | 151 | AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0], [0], [stdout]) |
8a32aaa5 | 152 | AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl |
70ae4f93 BP |
153 | OFPST_PORT_DESC reply (OF1.5): |
154 | 1(p1): addr:aa:55:aa:55:00:0x | |
155 | config: PORT_DOWN | |
156 | state: LINK_DOWN | |
157 | speed: 0 Mbps now, 0 Mbps max | |
158 | 2(p2): addr:aa:55:aa:55:00:0x | |
159 | config: PORT_DOWN | |
160 | state: LINK_DOWN | |
161 | speed: 0 Mbps now, 0 Mbps max | |
162 | 3(p3): addr:aa:55:aa:55:00:0x | |
163 | config: PORT_DOWN | |
164 | state: LINK_DOWN | |
165 | speed: 0 Mbps now, 0 Mbps max | |
166 | LOCAL(br0): addr:aa:55:aa:55:00:0x | |
167 | config: PORT_DOWN | |
168 | state: LINK_DOWN | |
169 | speed: 0 Mbps now, 0 Mbps max | |
170 | ]) | |
171 | AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0 2], [0], [stdout]) | |
8a32aaa5 | 172 | AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl |
70ae4f93 BP |
173 | OFPST_PORT_DESC reply (OF1.5): |
174 | 2(p2): addr:aa:55:aa:55:00:0x | |
175 | config: PORT_DOWN | |
176 | state: LINK_DOWN | |
177 | speed: 0 Mbps now, 0 Mbps max | |
178 | ]) | |
179 | OVS_VSWITCHD_STOP | |
180 | AT_CLEANUP | |
181 | ||
f72dff1a BP |
182 | dnl CHECK_QUEUE_STATS(label, option, format) |
183 | m4_define([CHECK_QUEUE_STATS], [ | |
184 | AT_SETUP([ofproto - queue stats - (OpenFlow $1)]) | |
023e1e0a | 185 | OVS_VSWITCHD_START |
f72dff1a | 186 | |
8a32aaa5 | 187 | AT_CHECK([ovs-ofctl -O $2 queue-stats br0 | strip_xids], [0], |
f72dff1a BP |
188 | [OFPST_QUEUE reply$3: 1 queues |
189 | port LOCAL queue 0: bytes=?, pkts=?, errors=?, duration=? | |
0414d158 | 190 | ]) |
eaa6eb2a | 191 | |
8a32aaa5 | 192 | AT_CHECK([ovs-ofctl -O $2 queue-stats br0 LOCAL | strip_xids], [0], |
f72dff1a BP |
193 | [OFPST_QUEUE reply$3: 1 queues |
194 | port LOCAL queue 0: bytes=?, pkts=?, errors=?, duration=? | |
9dcd1c00 | 195 | ]) |
f72dff1a | 196 | |
8a32aaa5 | 197 | AT_CHECK([ovs-ofctl -O $2 queue-stats br0 LOCAL 0 | strip_xids], [0], |
f72dff1a BP |
198 | [OFPST_QUEUE reply$3: 1 queues |
199 | port LOCAL queue 0: bytes=?, pkts=?, errors=?, duration=? | |
9dcd1c00 | 200 | ]) |
f72dff1a | 201 | |
8a32aaa5 | 202 | AT_CHECK([ovs-ofctl -O $2 queue-stats br0 ANY 0 | strip_xids], [0], |
f72dff1a BP |
203 | [OFPST_QUEUE reply$3: 1 queues |
204 | port LOCAL queue 0: bytes=?, pkts=?, errors=?, duration=? | |
9dcd1c00 | 205 | ]) |
9dcd1c00 | 206 | |
8a32aaa5 | 207 | AT_CHECK([ovs-ofctl -O $2 queue-stats br0 LOCAL 5 | strip_xids], [0], |
f72dff1a BP |
208 | [OFPT_ERROR$3: OFPQOFC_BAD_QUEUE |
209 | OFPST_QUEUE request$3: port=LOCAL queue=5 | |
1bb2cdbe | 210 | ]) |
f72dff1a | 211 | |
8a32aaa5 | 212 | AT_CHECK([ovs-ofctl -O $2 queue-stats br0 ANY 5 | strip_xids], [0], |
f72dff1a BP |
213 | [OFPT_ERROR$3: OFPQOFC_BAD_QUEUE |
214 | OFPST_QUEUE request$3: port=ANY queue=5 | |
1bb2cdbe | 215 | ]) |
f72dff1a | 216 | |
8a32aaa5 | 217 | AT_CHECK([ovs-ofctl -O $2 queue-stats br0 10 | strip_xids], [0], |
f72dff1a BP |
218 | [OFPT_ERROR$3: OFPQOFC_BAD_PORT |
219 | OFPST_QUEUE request$3: port=10 queue=ALL | |
1bb2cdbe BP |
220 | ]) |
221 | OVS_VSWITCHD_STOP | |
222 | AT_CLEANUP | |
f72dff1a BP |
223 | ]) |
224 | CHECK_QUEUE_STATS([1.0], [OpenFlow10], []) | |
225 | CHECK_QUEUE_STATS([1.1], [OpenFlow11], [ (OF1.1)]) | |
226 | CHECK_QUEUE_STATS([1.2], [OpenFlow12], [ (OF1.2)]) | |
227 | CHECK_QUEUE_STATS([1.3], [OpenFlow13], [ (OF1.3)]) | |
228 | CHECK_QUEUE_STATS([1.4], [OpenFlow14], [ (OF1.4)]) | |
1bb2cdbe | 229 | |
e8f9a7bb VG |
230 | dnl This is really bare-bones. |
231 | dnl It at least checks request and reply serialization and deserialization. | |
232 | AT_SETUP([ofproto - queue configuration - (OpenFlow 1.0)]) | |
233 | OVS_VSWITCHD_START | |
ca5792f0 | 234 | add_of_ports br0 1 2 |
e8f9a7bb | 235 | AT_CHECK([ovs-ofctl queue-get-config br0 1], [0], [stdout]) |
8a32aaa5 | 236 | AT_CHECK([strip_xids < stdout], [0], [dnl |
e8f9a7bb | 237 | OFPT_QUEUE_GET_CONFIG_REPLY: port=1 |
f72dff1a | 238 | queue 0: |
e8f9a7bb | 239 | ]) |
56085be5 | 240 | AT_CHECK([ovs-ofctl queue-get-config br0], [0], [stdout]) |
8a32aaa5 | 241 | AT_CHECK([strip_xids < stdout | sort], [0], [dnl |
56085be5 BP |
242 | OFPT_QUEUE_GET_CONFIG_REPLY: port=1 |
243 | OFPT_QUEUE_GET_CONFIG_REPLY: port=2 | |
f72dff1a BP |
244 | queue 0: |
245 | queue 0: | |
56085be5 | 246 | ]) |
e8f9a7bb VG |
247 | AT_CHECK([ovs-ofctl queue-get-config br0 10], [0], |
248 | [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT | |
249 | OFPT_QUEUE_GET_CONFIG_REQUEST (xid=0x2): port=10 | |
250 | ]) | |
251 | OVS_VSWITCHD_STOP | |
252 | AT_CLEANUP | |
253 | ||
d2e5fa1f BP |
254 | AT_SETUP([ofproto - queue configuration - (OpenFlow 1.1)]) |
255 | OVS_VSWITCHD_START | |
ca5792f0 | 256 | add_of_ports br0 1 2 |
e016fb63 | 257 | AT_CHECK([ovs-ofctl -O OpenFlow11 queue-get-config br0 1], [0], [stdout]) |
8a32aaa5 | 258 | AT_CHECK([strip_xids < stdout], [0], [dnl |
e016fb63 | 259 | OFPT_QUEUE_GET_CONFIG_REPLY (OF1.1): port=1 |
f72dff1a | 260 | queue 0: |
d2e5fa1f | 261 | ]) |
8a32aaa5 | 262 | AT_CHECK([ovs-ofctl -O OpenFlow11 queue-get-config br0 10 | strip_xids], [0], |
e016fb63 BP |
263 | [OFPT_ERROR (OF1.1): OFPQOFC_BAD_PORT |
264 | OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.1): port=10 | |
d2e5fa1f BP |
265 | ]) |
266 | OVS_VSWITCHD_STOP | |
267 | AT_CLEANUP | |
268 | ||
e8f9a7bb VG |
269 | AT_SETUP([ofproto - queue configuration - (OpenFlow 1.2)]) |
270 | OVS_VSWITCHD_START | |
ca5792f0 | 271 | add_of_ports br0 1 2 |
e8f9a7bb | 272 | AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 1], [0], [stdout]) |
8a32aaa5 | 273 | AT_CHECK([strip_xids < stdout], [0], [dnl |
e8f9a7bb | 274 | OFPT_QUEUE_GET_CONFIG_REPLY (OF1.2): port=1 |
f72dff1a | 275 | queue 0: |
e8f9a7bb | 276 | ]) |
56085be5 | 277 | AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 ANY], [0], [stdout]) |
8a32aaa5 | 278 | AT_CHECK([strip_xids < stdout], [0], [dnl |
56085be5 | 279 | OFPT_QUEUE_GET_CONFIG_REPLY (OF1.2): port=ANY |
f72dff1a BP |
280 | queue 0: |
281 | queue 0: | |
282 | queue 0: | |
56085be5 | 283 | ]) |
8a32aaa5 | 284 | AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 10 | strip_xids], [0], |
e016fb63 BP |
285 | [OFPT_ERROR (OF1.2): OFPQOFC_BAD_PORT |
286 | OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.2): port=10 | |
287 | ]) | |
288 | OVS_VSWITCHD_STOP | |
289 | AT_CLEANUP | |
290 | ||
291 | AT_SETUP([ofproto - queue configuration - (OpenFlow 1.4)]) | |
292 | OVS_VSWITCHD_START | |
ca5792f0 | 293 | add_of_ports br0 1 2 |
e016fb63 | 294 | |
8a32aaa5 | 295 | AT_CHECK([ovs-ofctl -O OpenFlow14 queue-get-config br0 any | strip_xids], [0], |
e016fb63 BP |
296 | [OFPST_QUEUE_DESC reply (OF1.4): port=1 |
297 | queue 0: | |
e016fb63 BP |
298 | port=2 |
299 | queue 0: | |
a28239c0 BP |
300 | port=LOCAL |
301 | queue 0: | |
e016fb63 BP |
302 | ]) |
303 | ||
8a32aaa5 | 304 | AT_CHECK([ovs-ofctl -O OpenFlow14 queue-get-config br0 1 | strip_xids], [0], |
e016fb63 BP |
305 | [OFPST_QUEUE_DESC reply (OF1.4): port=1 |
306 | queue 0: | |
307 | ]) | |
308 | ||
8a32aaa5 | 309 | AT_CHECK([ovs-ofctl -O OpenFlow14 queue-get-config br0 10 | strip_xids], [0], |
e016fb63 BP |
310 | [OFPT_ERROR (OF1.4): OFPQOFC_BAD_PORT |
311 | OFPST_QUEUE_DESC request (OF1.4): port=10 | |
312 | ]) | |
313 | ||
8a32aaa5 | 314 | AT_CHECK([ovs-ofctl -O OpenFlow14 queue-get-config br0 1 2 | strip_xids], [0], |
e016fb63 BP |
315 | [OFPT_ERROR (OF1.4): OFPQOFC_BAD_QUEUE |
316 | OFPST_QUEUE_DESC request (OF1.4): port=1 queue=2 | |
e8f9a7bb VG |
317 | ]) |
318 | OVS_VSWITCHD_STOP | |
319 | AT_CLEANUP | |
320 | ||
05f589da SH |
321 | dnl This is really bare-bones. |
322 | dnl It at least checks request and reply serialization and deserialization. | |
323 | dnl Actions definition listed in both supported formats (w/ actions=) | |
324 | AT_SETUP([ofproto - no group support (OpenFlow 1.0)]) | |
325 | OVS_VSWITCHD_START | |
326 | AT_DATA([groups.txt], [dnl | |
327 | group_id=1234,type=all,bucket=output:10 | |
328 | group_id=1235,type=all,bucket=actions=output:10 | |
329 | ]) | |
330 | AT_DATA([stderr], [dnl | |
331 | ovs-ofctl: none of the usable flow formats (OXM,OpenFlow11) is among the allowed flow formats (OpenFlow10,NXM) | |
332 | ]) | |
333 | AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-groups br0 groups.txt], [1], ,[stderr]) | |
334 | AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn mod-group br0 'group_id=1234,type=all,bucket=output:10'], [1], ,[stderr]) | |
335 | AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0], [1], ,[stderr]) | |
336 | AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0 ], [1], ,[stderr]) | |
337 | OVS_VSWITCHD_STOP | |
338 | AT_CLEANUP | |
339 | ||
433702fc SH |
340 | dnl This is really bare-bones. |
341 | dnl It at least checks request and reply serialization and deserialization. | |
f1457c26 | 342 | dnl Actions definition listed in both supported formats (w/ actions=) |
afc63bb4 | 343 | AT_SETUP([ofproto - del group (OpenFlow 1.1)]) |
433702fc SH |
344 | OVS_VSWITCHD_START |
345 | AT_DATA([groups.txt], [dnl | |
346 | group_id=1234,type=all,bucket=output:10 | |
f1457c26 | 347 | group_id=1235,type=all,bucket=actions=output:10 |
433702fc SH |
348 | ]) |
349 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt]) | |
afc63bb4 | 350 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0 ], [0], [stdout]) |
db88b35c | 351 | AT_CHECK([strip_xids < stdout | sort], [0], [dnl |
afc63bb4 SH |
352 | group_id=1234,type=all,bucket=actions=output:10 |
353 | group_id=1235,type=all,bucket=actions=output:10 | |
db88b35c | 354 | OFPST_GROUP_DESC reply (OF1.1): |
19187a71 | 355 | ]) |
433702fc SH |
356 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234]) |
357 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 358 | AT_CHECK([strip_xids < stdout], [0], [dnl |
433702fc SH |
359 | OFPST_GROUP_DESC reply (OF1.1): |
360 | group_id=1235,type=all,bucket=actions=output:10 | |
361 | ]) | |
362 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234]) | |
363 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 364 | AT_CHECK([strip_xids < stdout], [0], [dnl |
433702fc SH |
365 | OFPST_GROUP_DESC reply (OF1.1): |
366 | group_id=1235,type=all,bucket=actions=output:10 | |
367 | ]) | |
368 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0], [0]) | |
369 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 370 | AT_CHECK([strip_xids < stdout], [0], [dnl |
433702fc SH |
371 | OFPST_GROUP_DESC reply (OF1.1): |
372 | ]) | |
aa6fb077 BP |
373 | |
374 | # Negative test. | |
375 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=0xfffffff0], | |
376 | [1], [], [ovs-ofctl: invalid group id 4294967280 | |
377 | ]) | |
433702fc SH |
378 | OVS_VSWITCHD_STOP |
379 | AT_CLEANUP | |
380 | ||
e1799eb7 SH |
381 | dnl This is really bare-bones. |
382 | dnl It at least checks request and reply serialization and deserialization. | |
383 | dnl Actions definition listed in both supported formats (w/ actions=) | |
384 | AT_SETUP([ofproto - add indirect group]) | |
385 | OVS_VSWITCHD_START | |
386 | dnl indirect group must have exactly one bucket | |
387 | AT_DATA([stderr], [dnl | |
388 | OFPT_ERROR (OF1.1) (xid=0x2): OFPGMFC_INVALID_GROUP | |
389 | OFPT_GROUP_MOD (OF1.1) (xid=0x2): ***decode error: OFPGMFC_INVALID_GROUP*** | |
390 | ]) | |
391 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1234,type=indirect'], [1], , [stderr]) | |
392 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1235,type=indirect,bucket=output:10']) | |
393 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1236,type=indirect,bucket=output:10,bucket=output:11'], [1], , [stderr]) | |
394 | OVS_VSWITCHD_STOP | |
395 | AT_CLEANUP | |
396 | ||
25070e04 | 397 | AT_SETUP([ofproto - group mod with mod and add_or_mod command]) |
88b87a36 JS |
398 | OVS_VSWITCHD_START |
399 | dnl Check that mod-group for non-existing group fails without --may-create | |
400 | AT_DATA([stderr], [dnl | |
401 | OFPT_ERROR (OF1.3) (xid=0x2): OFPGMFC_UNKNOWN_GROUP | |
402 | OFPT_GROUP_MOD (OF1.3) (xid=0x2): | |
403 | MOD group_id=1234,type=indirect,bucket=actions=output:2 | |
404 | ]) | |
405 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn mod-group br0 'group_id=1234,type=indirect,bucket=actions=2'], [1], , [stderr]) | |
406 | dnl Check that mod-group for non-existing group succeeds with --may-create | |
407 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn --may-create mod-group br0 'group_id=1234,type=indirect,bucket=actions=2']) | |
408 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout]) | |
409 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
410 | OFPST_GROUP_DESC reply (OF1.3): | |
411 | group_id=1234,type=indirect,bucket=actions=output:2 | |
412 | ]) | |
413 | dnl Check that mod-group for existing group succeeds with --may-create | |
414 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn --may-create mod-group br0 'group_id=1234,type=indirect,bucket=actions=3']) | |
415 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout]) | |
416 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
417 | OFPST_GROUP_DESC reply (OF1.3): | |
418 | group_id=1234,type=indirect,bucket=actions=output:3 | |
419 | ]) | |
420 | OVS_VSWITCHD_STOP | |
421 | AT_CLEANUP | |
422 | ||
afc63bb4 SH |
423 | dnl This is really bare-bones. |
424 | dnl It at least checks request and reply serialization and deserialization. | |
425 | dnl Actions definition listed in both supported formats (w/ actions=) | |
426 | AT_SETUP([ofproto - del group (OpenFlow 1.5)]) | |
427 | OVS_VSWITCHD_START | |
428 | AT_DATA([groups.txt], [dnl | |
3986cae6 | 429 | group_id=1233,type=select,selection_method=hash,bucket=output:10,bucket=output:11 |
68dfc25b | 430 | group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11 |
afc63bb4 | 431 | group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 |
53cc166a | 432 | group_id=1236,type=select,selection_method=dp_hash,bucket=output:10,bucket=output:11 |
afc63bb4 SH |
433 | ]) |
434 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt]) | |
435 | AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) | |
8a32aaa5 | 436 | AT_CHECK([strip_xids < stdout], [0], [dnl |
afc63bb4 | 437 | OFPST_GROUP_DESC reply (OF1.5): |
68dfc25b | 438 | group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 |
afc63bb4 SH |
439 | ]) |
440 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234]) | |
441 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
db88b35c | 442 | AT_CHECK([strip_xids < stdout | sort], [0], [dnl |
3986cae6 | 443 | group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 |
db88b35c | 444 | 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 |
53cc166a | 445 | group_id=1236,type=select,selection_method=dp_hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 |
db88b35c | 446 | OFPST_GROUP_DESC reply (OF1.5): |
afc63bb4 SH |
447 | ]) |
448 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234]) | |
449 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
db88b35c | 450 | AT_CHECK([strip_xids < stdout | sort], [0], [dnl |
3986cae6 | 451 | group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 |
db88b35c | 452 | 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 |
53cc166a | 453 | group_id=1236,type=select,selection_method=dp_hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 |
db88b35c | 454 | OFPST_GROUP_DESC reply (OF1.5): |
afc63bb4 SH |
455 | ]) |
456 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0], [0]) | |
457 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 458 | AT_CHECK([strip_xids < stdout], [0], [dnl |
afc63bb4 SH |
459 | OFPST_GROUP_DESC reply (OF1.5): |
460 | ]) | |
461 | OVS_VSWITCHD_STOP | |
462 | AT_CLEANUP | |
463 | ||
433702fc SH |
464 | dnl This is really bare-bones. |
465 | dnl It at least checks request and reply serialization and deserialization. | |
466 | AT_SETUP([ofproto - del group deletes flows]) | |
467 | OVS_VSWITCHD_START | |
468 | AT_DATA([groups.txt], [dnl | |
469 | group_id=1234,type=all,bucket=output:10 | |
470 | group_id=1235,type=all,bucket=output:10 | |
471 | ]) | |
472 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt]) | |
473 | AT_DATA([flows.txt], [dnl | |
474 | tcp actions=group:1234 | |
8b792aef | 475 | table=2 udp actions=group:1235 |
433702fc SH |
476 | ]) |
477 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt]) | |
478 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort], | |
479 | [0], [dnl | |
8b792aef | 480 | table=2, udp actions=group:1235 |
433702fc | 481 | tcp actions=group:1234 |
433702fc SH |
482 | OFPST_FLOW reply (OF1.1): |
483 | ]) | |
484 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234]) | |
485 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort], | |
486 | [0], [dnl | |
8b792aef | 487 | table=2, udp actions=group:1235 |
433702fc SH |
488 | OFPST_FLOW reply (OF1.1): |
489 | ]) | |
490 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234]) | |
491 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort], | |
492 | [0], [dnl | |
8b792aef | 493 | table=2, udp actions=group:1235 |
433702fc SH |
494 | OFPST_FLOW reply (OF1.1): |
495 | ]) | |
496 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0]) | |
497 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort], | |
498 | [0], [dnl | |
499 | OFPST_FLOW reply (OF1.1): | |
500 | ]) | |
501 | OVS_VSWITCHD_STOP | |
502 | AT_CLEANUP | |
503 | ||
bdbb8426 SH |
504 | dnl This is really bare-bones. |
505 | dnl It at least checks request and reply serialization and deserialization. | |
506 | dnl Actions definition listed in both supported formats (w/ actions=) | |
25070e04 | 507 | AT_SETUP([ofproto - insert group buckets]) |
bdbb8426 | 508 | OVS_VSWITCHD_START |
8e19e655 | 509 | # Add group with no buckets. |
bdbb8426 | 510 | AT_DATA([groups.txt], [dnl |
8e19e655 | 511 | group_id=1234,type=all |
bdbb8426 SH |
512 | ]) |
513 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt]) | |
514 | AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) | |
8a32aaa5 | 515 | AT_CHECK([strip_xids < stdout], [0], [dnl |
8e19e655 BP |
516 | OFPST_GROUP_DESC reply (OF1.5): |
517 | group_id=1234,type=all | |
518 | ]) | |
519 | ||
520 | # Add two buckets, using "last". | |
521 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11]) | |
522 | AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) | |
8a32aaa5 | 523 | AT_CHECK([strip_xids < stdout], [0], [dnl |
8e19e655 BP |
524 | OFPST_GROUP_DESC reply (OF1.5): |
525 | group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11 | |
526 | ]) | |
527 | ||
528 | # Start over again, then add two buckets using "first". | |
529 | AT_CHECK([ovs-ofctl -O OpenFlow15 --strict del-groups br0 group_id=1234]) | |
530 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-group br0 group_id=1234,type=all]) | |
531 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11]) | |
532 | AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) | |
8a32aaa5 | 533 | AT_CHECK([strip_xids < stdout], [0], [dnl |
bdbb8426 SH |
534 | OFPST_GROUP_DESC reply (OF1.5): |
535 | group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11 | |
536 | ]) | |
8e19e655 BP |
537 | |
538 | # Add two more buckets before the existing ones. | |
bdbb8426 SH |
539 | 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]) |
540 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 541 | AT_CHECK([strip_xids < stdout], [0], [dnl |
bdbb8426 SH |
542 | OFPST_GROUP_DESC reply (OF1.5): |
543 | 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 | |
544 | ]) | |
8e19e655 BP |
545 | |
546 | # Add another bucket at the end. | |
bdbb8426 SH |
547 | 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]) |
548 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 549 | AT_CHECK([strip_xids < stdout], [0], [dnl |
bdbb8426 SH |
550 | OFPST_GROUP_DESC reply (OF1.5): |
551 | 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 | |
552 | ]) | |
23a31238 BP |
553 | |
554 | # Verify that duplicate bucket IDs are rejected. | |
555 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15], [1], [], [stderr]) | |
8a32aaa5 | 556 | AT_CHECK([strip_xids < stderr | sed '/truncated/,$d'], [0], [dnl |
23a31238 BP |
557 | OFPT_ERROR (OF1.5): OFPGMFC_BUCKET_EXISTS |
558 | OFPT_GROUP_MOD (OF1.5): | |
559 | ]) | |
560 | ||
8e19e655 BP |
561 | |
562 | # Add another bucket just before bucket 15. | |
bdbb8426 SH |
563 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15]) |
564 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 565 | AT_CHECK([strip_xids < stdout], [0], [dnl |
bdbb8426 SH |
566 | OFPST_GROUP_DESC reply (OF1.5): |
567 | group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15 | |
568 | ]) | |
8e19e655 BP |
569 | |
570 | # Add two more buckets just before bucket 11, | |
571 | # getting the command from a file. | |
bdbb8426 SH |
572 | AT_DATA([buckets.txt], [dnl |
573 | group_id=1234,command_bucket_id=11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13 | |
574 | ]) | |
575 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 - < buckets.txt]) | |
576 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 577 | AT_CHECK([strip_xids < stdout], [0], [dnl |
bdbb8426 SH |
578 | OFPST_GROUP_DESC reply (OF1.5): |
579 | 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 | |
580 | ]) | |
8e19e655 BP |
581 | |
582 | # Add yet two more buckets. | |
bdbb8426 SH |
583 | 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]) |
584 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 585 | AT_CHECK([strip_xids < stdout], [0], [dnl |
bdbb8426 SH |
586 | OFPST_GROUP_DESC reply (OF1.5): |
587 | 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 | |
588 | ]) | |
908995c5 | 589 | |
9dd30b05 | 590 | # Negative tests. |
908995c5 BP |
591 | 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], [], |
592 | [ovs-ofctl: invalid command bucket id 4294967041 | |
593 | ]) | |
9dd30b05 BP |
594 | 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], [], |
595 | [ovs-ofctl: insert-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15') | |
596 | ]) | |
bdbb8426 SH |
597 | OVS_VSWITCHD_STOP |
598 | AT_CLEANUP | |
599 | ||
600 | dnl This is really bare-bones. | |
601 | dnl It at least checks request and reply serialization and deserialization. | |
602 | dnl Actions definition listed in both supported formats (w/ actions=) | |
25070e04 | 603 | AT_SETUP([ofproto - remove group buckets]) |
bdbb8426 SH |
604 | OVS_VSWITCHD_START |
605 | AT_DATA([groups.txt], [dnl | |
606 | 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 | |
607 | ]) | |
608 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt]) | |
609 | AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) | |
8a32aaa5 | 610 | AT_CHECK([strip_xids < stdout], [0], [dnl |
bdbb8426 SH |
611 | OFPST_GROUP_DESC reply (OF1.5): |
612 | 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 | |
613 | ]) | |
614 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first]) | |
615 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 616 | AT_CHECK([strip_xids < stdout], [0], [dnl |
bdbb8426 SH |
617 | OFPST_GROUP_DESC reply (OF1.5): |
618 | 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 | |
619 | ]) | |
620 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last]) | |
621 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 622 | AT_CHECK([strip_xids < stdout], [0], [dnl |
bdbb8426 SH |
623 | OFPST_GROUP_DESC reply (OF1.5): |
624 | 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 | |
625 | ]) | |
626 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=13]) | |
627 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 628 | AT_CHECK([strip_xids < stdout], [0], [dnl |
bdbb8426 SH |
629 | OFPST_GROUP_DESC reply (OF1.5): |
630 | 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 | |
631 | ]) | |
632 | AT_DATA([buckets.txt], [dnl | |
633 | group_id=1234 | |
634 | ]) | |
635 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 - < buckets.txt]) | |
636 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 637 | AT_CHECK([strip_xids < stdout], [0], [dnl |
bdbb8426 SH |
638 | OFPST_GROUP_DESC reply (OF1.5): |
639 | group_id=1234,type=all | |
640 | ]) | |
641 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first]) | |
642 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last]) | |
643 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=all]) | |
644 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=1], [1], [], [stderr]) | |
38b0b29f | 645 | AT_CHECK([ofctl_strip < stderr], [0], [dnl |
bdbb8426 SH |
646 | OFPT_ERROR (OF1.5): OFPGMFC_UNKNOWN_BUCKET |
647 | OFPT_GROUP_MOD (OF1.5): | |
648 | REMOVE_BUCKET command_bucket_id:1,group_id=1234 | |
649 | ]) | |
9dd30b05 BP |
650 | # Negative test. |
651 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [], | |
652 | [ovs-ofctl: remove-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15') | |
653 | ]) | |
bdbb8426 SH |
654 | OVS_VSWITCHD_STOP |
655 | AT_CLEANUP | |
656 | ||
25070e04 JR |
657 | AT_SETUP([ofproto - bundle del group (OpenFlow 1.3)]) |
658 | OVS_VSWITCHD_START | |
659 | AT_DATA([groups.txt], [dnl | |
660 | group_id=1234,type=all,bucket=output:10 | |
661 | group_id=1235,type=all,bucket=actions=output:10 | |
662 | ]) | |
663 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn add-groups br0 groups.txt]) | |
664 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0 ], [0], [stdout]) | |
665 | AT_CHECK([strip_xids < stdout | sort], [0], [dnl | |
666 | group_id=1234,type=all,bucket=actions=output:10 | |
667 | group_id=1235,type=all,bucket=actions=output:10 | |
668 | OFPST_GROUP_DESC reply (OF1.3): | |
669 | ]) | |
670 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn del-groups br0 group_id=1234]) | |
671 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout]) | |
672 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
673 | OFPST_GROUP_DESC reply (OF1.3): | |
674 | group_id=1235,type=all,bucket=actions=output:10 | |
675 | ]) | |
676 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn del-groups br0 group_id=1234]) | |
677 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout]) | |
678 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
679 | OFPST_GROUP_DESC reply (OF1.3): | |
680 | group_id=1235,type=all,bucket=actions=output:10 | |
681 | ]) | |
682 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn del-groups br0], [0]) | |
683 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-groups br0], [0], [stdout]) | |
684 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
685 | OFPST_GROUP_DESC reply (OF1.3): | |
686 | ]) | |
687 | ||
688 | # Negative test. | |
689 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow13 -vwarn del-groups br0 group_id=0xfffffff0], | |
690 | [1], [], [ovs-ofctl: invalid group id 4294967280 | |
691 | ]) | |
692 | OVS_VSWITCHD_STOP | |
693 | AT_CLEANUP | |
694 | ||
695 | AT_SETUP([ofproto - bundle add indirect group]) | |
696 | OVS_VSWITCHD_START | |
697 | dnl indirect group must have exactly one bucket | |
698 | AT_DATA([stderr], [dnl | |
699 | OFPT_ERROR (OF1.4) (xid=0x2): OFPGMFC_INVALID_GROUP | |
700 | OFPT_BUNDLE_ADD_MESSAGE (OF1.4) (xid=0x2): | |
701 | bundle_id=0 flags=atomic ordered | |
702 | OFPT_GROUP_MOD (OF1.4) (xid=0x2): ***decode error: OFPGMFC_INVALID_GROUP*** | |
703 | ]) | |
704 | AT_CHECK([ovs-ofctl --bundle -vwarn add-group br0 'group_id=1234,type=indirect'], [1], , [stderr]) | |
705 | AT_CHECK([ovs-ofctl --bundle -vwarn add-group br0 'group_id=1235,type=indirect,bucket=output:10']) | |
706 | AT_CHECK([ovs-ofctl --bundle -vwarn add-group br0 'group_id=1236,type=indirect,bucket=output:10,bucket=output:11'], [1], , [stderr]) | |
707 | OVS_VSWITCHD_STOP | |
708 | AT_CLEANUP | |
709 | ||
710 | AT_SETUP([ofproto - bundle group mod with mod and add_or_mod command]) | |
711 | OVS_VSWITCHD_START | |
712 | dnl Check that mod-group for non-existing group fails without --may-create | |
713 | AT_DATA([stderr], [dnl | |
714 | OFPT_ERROR (OF1.4) (xid=0x2): OFPGMFC_UNKNOWN_GROUP | |
715 | OFPT_GROUP_MOD (OF1.4) (xid=0x2): | |
716 | MOD group_id=1234,type=indirect,bucket=actions=output:2 | |
717 | ]) | |
718 | AT_CHECK([ovs-ofctl --bundle -vwarn mod-group br0 'group_id=1234,type=indirect,bucket=actions=2'], [1], , [stderr]) | |
719 | dnl Check that mod-group for non-existing group succeeds with --may-create | |
720 | AT_CHECK([ovs-ofctl --bundle -vwarn --may-create mod-group br0 'group_id=1234,type=indirect,bucket=actions=2']) | |
721 | AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-groups br0], [0], [stdout]) | |
722 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
723 | OFPST_GROUP_DESC reply (OF1.4): | |
724 | group_id=1234,type=indirect,bucket=actions=output:2 | |
725 | ]) | |
726 | dnl Check that mod-group for existing group succeeds with --may-create | |
727 | AT_CHECK([ovs-ofctl --bundle -vwarn --may-create mod-group br0 'group_id=1234,type=indirect,bucket=actions=3']) | |
728 | AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-groups br0], [0], [stdout]) | |
729 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
730 | OFPST_GROUP_DESC reply (OF1.4): | |
731 | group_id=1234,type=indirect,bucket=actions=output:3 | |
732 | ]) | |
733 | OVS_VSWITCHD_STOP | |
734 | AT_CLEANUP | |
735 | ||
736 | AT_SETUP([ofproto - bundle del group (OpenFlow 1.5)]) | |
737 | OVS_VSWITCHD_START | |
738 | AT_DATA([groups.txt], [dnl | |
739 | group_id=1233,type=select,selection_method=hash,bucket=output:10,bucket=output:11 | |
740 | group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11 | |
741 | group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 | |
742 | ]) | |
743 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn add-groups br0 groups.txt]) | |
744 | AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) | |
745 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
746 | OFPST_GROUP_DESC reply (OF1.5): | |
747 | group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 | |
748 | ]) | |
749 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn del-groups br0 group_id=1234]) | |
750 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
751 | AT_CHECK([strip_xids < stdout | sort], [0], [dnl | |
752 | group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 | |
753 | 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 | |
754 | OFPST_GROUP_DESC reply (OF1.5): | |
755 | ]) | |
756 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn del-groups br0 group_id=1234]) | |
757 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
758 | AT_CHECK([strip_xids < stdout | sort], [0], [dnl | |
759 | group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 | |
760 | 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 | |
761 | OFPST_GROUP_DESC reply (OF1.5): | |
762 | ]) | |
763 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn del-groups br0], [0]) | |
764 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
765 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
766 | OFPST_GROUP_DESC reply (OF1.5): | |
767 | ]) | |
768 | OVS_VSWITCHD_STOP | |
769 | AT_CLEANUP | |
770 | ||
771 | AT_SETUP([ofproto - bundle del group deletes flows]) | |
772 | OVS_VSWITCHD_START | |
773 | AT_DATA([groups.txt], [dnl | |
774 | group_id=1234,type=all,bucket=output:10 | |
775 | group_id=1235,type=all,bucket=output:10 | |
776 | ]) | |
777 | AT_CHECK([ovs-ofctl --bundle -vwarn add-groups br0 groups.txt]) | |
778 | AT_DATA([flows.txt], [dnl | |
779 | tcp actions=group:1234 | |
780 | table=2 udp actions=group:1235 | |
781 | ]) | |
782 | AT_CHECK([ovs-ofctl --bundle -vwarn add-flows br0 flows.txt]) | |
783 | AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-flows br0 | ofctl_strip | sort], | |
784 | [0], [dnl | |
785 | table=2, udp actions=group:1235 | |
786 | tcp actions=group:1234 | |
787 | OFPST_FLOW reply (OF1.4): | |
788 | ]) | |
789 | AT_CHECK([ovs-ofctl --bundle -vwarn del-groups br0 group_id=1234]) | |
790 | AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-flows br0 | ofctl_strip | sort], | |
791 | [0], [dnl | |
792 | table=2, udp actions=group:1235 | |
793 | OFPST_FLOW reply (OF1.4): | |
794 | ]) | |
795 | AT_CHECK([ovs-ofctl --bundle -vwarn del-groups br0 group_id=1234]) | |
796 | AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-flows br0 | ofctl_strip | sort], | |
797 | [0], [dnl | |
798 | table=2, udp actions=group:1235 | |
799 | OFPST_FLOW reply (OF1.4): | |
800 | ]) | |
801 | AT_CHECK([ovs-ofctl --bundle -vwarn del-groups br0]) | |
802 | AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-flows br0 | ofctl_strip | sort], | |
803 | [0], [dnl | |
804 | OFPST_FLOW reply (OF1.4): | |
805 | ]) | |
806 | OVS_VSWITCHD_STOP | |
807 | AT_CLEANUP | |
808 | ||
809 | dnl This is really bare-bones. | |
810 | dnl It at least checks request and reply serialization and deserialization. | |
811 | dnl Actions definition listed in both supported formats (w/ actions=) | |
812 | AT_SETUP([ofproto - bundle insert group buckets]) | |
813 | OVS_VSWITCHD_START | |
814 | # Add group with no buckets. | |
815 | AT_DATA([groups.txt], [dnl | |
816 | group_id=1234,type=all | |
817 | ]) | |
818 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn add-groups br0 groups.txt]) | |
819 | AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) | |
820 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
821 | OFPST_GROUP_DESC reply (OF1.5): | |
822 | group_id=1234,type=all | |
823 | ]) | |
824 | ||
825 | # Add two buckets, using "last". | |
826 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11]) | |
827 | AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) | |
828 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
829 | OFPST_GROUP_DESC reply (OF1.5): | |
830 | group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11 | |
831 | ]) | |
832 | ||
833 | # Start over again, then add two buckets using "first". | |
834 | AT_DATA([groups.txt], [dnl | |
835 | delete group_id=1234 | |
836 | add group_id=1234,type=all | |
837 | insert_bucket group_id=1234,command_bucket_id=first,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11 | |
838 | ]) | |
839 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn add-groups br0 groups.txt]) | |
840 | AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) | |
841 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
842 | OFPST_GROUP_DESC reply (OF1.5): | |
843 | group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11 | |
844 | ]) | |
845 | ||
846 | # Add two more buckets before the existing ones. | |
847 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1]) | |
848 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
849 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
850 | OFPST_GROUP_DESC reply (OF1.5): | |
851 | 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 | |
852 | ]) | |
853 | ||
854 | # Add another bucket at the end. | |
855 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15]) | |
856 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
857 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
858 | OFPST_GROUP_DESC reply (OF1.5): | |
859 | 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 | |
860 | ]) | |
861 | ||
862 | # Verify that duplicate bucket IDs are rejected. | |
863 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15], [1], [], [stderr]) | |
864 | AT_CHECK([strip_xids < stderr | sed '/talking to/,$d'], [0], [dnl | |
865 | Error OFPGMFC_BUCKET_EXISTS for: OFPT_GROUP_MOD (OF1.5): | |
866 | INSERT_BUCKET command_bucket_id:last,group_id=1234,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15 | |
867 | Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.5): | |
868 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered | |
869 | ]) | |
870 | ||
871 | # Add another bucket just before bucket 15. | |
872 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15]) | |
873 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
874 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
875 | OFPST_GROUP_DESC reply (OF1.5): | |
876 | 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 | |
877 | ]) | |
878 | ||
879 | # Add two more buckets just before bucket 11, | |
880 | # getting the command from a file. | |
881 | AT_DATA([buckets.txt], [dnl | |
882 | group_id=1234,command_bucket_id=11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13 | |
883 | ]) | |
884 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 - < buckets.txt]) | |
885 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
886 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
887 | OFPST_GROUP_DESC reply (OF1.5): | |
888 | 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 | |
889 | ]) | |
890 | ||
891 | # Add yet two more buckets. | |
892 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15,bucket=bucket_id:20,actions=output:20,bucket=bucket_id:21,actions=output:21]) | |
893 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
894 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
895 | OFPST_GROUP_DESC reply (OF1.5): | |
896 | 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 | |
897 | ]) | |
898 | ||
899 | # Negative tests. | |
900 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=0xffffff01,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [], | |
901 | [ovs-ofctl: invalid command bucket id 4294967041 | |
902 | ]) | |
903 | AT_CHECK([ovs-ofctl --bundle -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [], | |
904 | [ovs-ofctl: insert-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15') | |
905 | ]) | |
906 | OVS_VSWITCHD_STOP | |
907 | AT_CLEANUP | |
908 | ||
909 | AT_SETUP([ofproto - bundle remove group buckets]) | |
910 | OVS_VSWITCHD_START | |
911 | AT_DATA([groups.txt], [dnl | |
912 | 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 | |
913 | ]) | |
914 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn add-groups br0 groups.txt]) | |
915 | AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) | |
916 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
917 | OFPST_GROUP_DESC reply (OF1.5): | |
918 | 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 | |
919 | ]) | |
920 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first]) | |
921 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
922 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
923 | OFPST_GROUP_DESC reply (OF1.5): | |
924 | 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 | |
925 | ]) | |
926 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last]) | |
927 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
928 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
929 | OFPST_GROUP_DESC reply (OF1.5): | |
930 | 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 | |
931 | ]) | |
932 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=13]) | |
933 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
934 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
935 | OFPST_GROUP_DESC reply (OF1.5): | |
936 | 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 | |
937 | ]) | |
938 | AT_DATA([buckets.txt], [dnl | |
939 | group_id=1234 | |
940 | ]) | |
941 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 - < buckets.txt]) | |
942 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) | |
943 | AT_CHECK([strip_xids < stdout], [0], [dnl | |
944 | OFPST_GROUP_DESC reply (OF1.5): | |
945 | group_id=1234,type=all | |
946 | ]) | |
947 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first]) | |
948 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last]) | |
949 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=all]) | |
950 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=1], [1], [], [stderr]) | |
951 | AT_CHECK([ofctl_strip < stderr | sed '/talking to/,$d'], [0], [dnl | |
952 | Error OFPGMFC_UNKNOWN_BUCKET for: OFPT_GROUP_MOD (OF1.5): | |
953 | REMOVE_BUCKET command_bucket_id:1,group_id=1234 | |
954 | Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.5): | |
955 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered | |
956 | ]) | |
957 | # Negative test. | |
958 | AT_CHECK([ovs-ofctl --bundle -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [], | |
959 | [ovs-ofctl: remove-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15') | |
960 | ]) | |
961 | OVS_VSWITCHD_STOP | |
962 | AT_CLEANUP | |
963 | ||
0860fea7 SH |
964 | dnl This is really bare-bones. |
965 | dnl It at least checks request and reply serialization and deserialization. | |
966 | AT_SETUP([ofproto - flow mod checks group availability]) | |
967 | OVS_VSWITCHD_START | |
968 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10]) | |
969 | AT_DATA([flows.txt], [dnl | |
970 | tcp actions=group:1234 | |
971 | udp actions=group:1235 | |
972 | ]) | |
973 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234']) | |
974 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'], [1], [], [stderr]) | |
975 | ||
976 | # The output should look like this: | |
977 | # | |
978 | # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................| | |
979 | # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................| | |
980 | # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................| | |
981 | # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............| | |
982 | # | |
983 | # This 'sed' command captures the error message but drops details. | |
984 | AT_CHECK([sed '/truncated/d | |
8a32aaa5 | 985 | /^000000.0/d' stderr | strip_xids], [0], |
0860fea7 SH |
986 | [OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP |
987 | OFPT_FLOW_MOD (OF1.1): | |
988 | ]) | |
989 | OVS_VSWITCHD_STOP | |
990 | AT_CLEANUP | |
991 | ||
25070e04 JR |
992 | AT_SETUP([ofproto - bundle flow mod checks group availability]) |
993 | OVS_VSWITCHD_START | |
994 | AT_DATA([bundle.txt], [dnl | |
995 | group add group_id=1234,type=all,bucket=output:10 | |
996 | flow add tcp actions=group:1234 | |
997 | flow add udp actions=group:1235 | |
998 | ]) | |
999 | AT_CHECK([ovs-ofctl -vwarn bundle br0 bundle.txt], [1], [], [stderr]) | |
1000 | ||
1001 | # The output should look like this: | |
1002 | # | |
1003 | # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................| | |
1004 | # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................| | |
1005 | # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................| | |
1006 | # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............| | |
1007 | # | |
1008 | # This 'sed' command captures the error message but drops details. | |
1009 | AT_CHECK([sed '/truncated/d | |
1010 | /^000000.0/d' stderr | ofctl_strip | sed '/talking to/,$d'], [0], | |
1011 | [dnl | |
1012 | Error OFPBAC_BAD_OUT_GROUP for: OFPT_FLOW_MOD (OF1.4): ADD udp actions=group:1235 | |
1013 | Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.4): | |
1014 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered | |
1015 | ]) | |
1016 | OVS_VSWITCHD_STOP | |
1017 | AT_CLEANUP | |
1018 | ||
433702fc SH |
1019 | dnl This is really bare-bones. |
1020 | dnl It at least checks request and reply serialization and deserialization. | |
1021 | AT_SETUP([ofproto - group description]) | |
1022 | OVS_VSWITCHD_START | |
1023 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10], [0], [stdout]) | |
1024 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 1025 | AT_CHECK([strip_xids < stdout], [0], [dnl |
433702fc SH |
1026 | OFPST_GROUP_DESC reply (OF1.1): |
1027 | group_id=1234,type=all,bucket=actions=output:10 | |
1028 | ]) | |
1029 | OVS_VSWITCHD_STOP | |
1030 | AT_CLEANUP | |
1031 | ||
2134b5ec SH |
1032 | dnl This is really bare-bones. |
1033 | dnl It at least checks request and reply serialization and deserialization. | |
1034 | AT_SETUP([ofproto - group description]) | |
1035 | OVS_VSWITCHD_START | |
1036 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10]) | |
1037 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout]) | |
8a32aaa5 | 1038 | AT_CHECK([strip_xids < stdout], [0], [dnl |
2134b5ec SH |
1039 | OFPST_GROUP_DESC reply (OF1.1): |
1040 | group_id=1234,type=all,bucket=actions=output:10 | |
1041 | ]) | |
1042 | OVS_VSWITCHD_STOP | |
1043 | AT_CLEANUP | |
1044 | ||
d45418dd SH |
1045 | dnl This is really bare-bones. |
1046 | dnl It at least checks request and reply serialization and deserialization. | |
1047 | AT_SETUP([ofproto - group features]) | |
1048 | OVS_VSWITCHD_START | |
1049 | AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout]) | |
8a32aaa5 | 1050 | AT_CHECK([strip_xids < stdout], [0], [dnl |
d45418dd SH |
1051 | OFPST_GROUP_FEATURES reply (OF1.2): |
1052 | Group table: | |
0ae01c64 | 1053 | Types: 0xf |
7cb279c2 | 1054 | Capabilities: 0x7 |
0ae01c64 SS |
1055 | all group: |
1056 | max_groups=0xffffff00 | |
1057 | 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 | |
1058 | select group: | |
1059 | max_groups=0xffffff00 | |
1060 | 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 | |
1061 | indirect group: | |
1062 | max_groups=0xffffff00 | |
1063 | 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 | |
1064 | fast failover group: | |
1065 | max_groups=0xffffff00 | |
1066 | 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 | |
d45418dd SH |
1067 | ]) |
1068 | OVS_VSWITCHD_STOP | |
1069 | AT_CLEANUP | |
1070 | ||
2134b5ec SH |
1071 | dnl This is really bare-bones. |
1072 | dnl It at least checks request and reply serialization and deserialization. | |
5335a6f3 | 1073 | AT_SETUP([ofproto - group stats (OpenFlow 1.1)]) |
2134b5ec SH |
1074 | OVS_VSWITCHD_START |
1075 | AT_DATA([groups.txt], [dnl | |
1076 | group_id=1234,type=all,bucket=output:10 | |
1077 | group_id=1235,type=all,bucket=output:10 | |
1078 | ]) | |
1079 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt]) | |
1080 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234']) | |
1081 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout]) | |
8a32aaa5 | 1082 | AT_CHECK([strip_xids < stdout | sort], [0], [dnl |
2134b5ec SH |
1083 | group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 |
1084 | OFPST_GROUP reply (OF1.1): | |
1085 | ]) | |
1086 | AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0], [0], [stdout]) | |
8a32aaa5 | 1087 | AT_CHECK([strip_xids < stdout | sort], [0], [dnl |
2134b5ec SH |
1088 | group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 |
1089 | group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 | |
1090 | OFPST_GROUP reply (OF1.1): | |
1091 | ]) | |
1092 | OVS_VSWITCHD_STOP | |
1093 | AT_CLEANUP | |
1094 | ||
5335a6f3 SH |
1095 | dnl This is really bare-bones. |
1096 | dnl It at least checks request and reply serialization and deserialization. | |
1097 | AT_SETUP([ofproto - group stats (OpenFlow 1.3)]) | |
1098 | OVS_VSWITCHD_START | |
1099 | AT_DATA([groups.txt], [dnl | |
1100 | group_id=1234,type=all,bucket=output:10 | |
1101 | group_id=1235,type=all,bucket=output:10 | |
1102 | ]) | |
1103 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt]) | |
1104 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-flow br0 'tcp actions=group:1234']) | |
1105 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout]) | |
8a32aaa5 | 1106 | AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl |
5335a6f3 SH |
1107 | group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 |
1108 | OFPST_GROUP reply (OF1.3): | |
1109 | ]) | |
1110 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0], [0], [stdout]) | |
8a32aaa5 | 1111 | AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl |
5335a6f3 SH |
1112 | group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 |
1113 | group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 | |
1114 | OFPST_GROUP reply (OF1.3): | |
1115 | ]) | |
1116 | OVS_VSWITCHD_STOP | |
1117 | AT_CLEANUP | |
1118 | ||
afc63bb4 SH |
1119 | dnl This is really bare-bones. |
1120 | dnl It at least checks request and reply serialization and deserialization. | |
1121 | AT_SETUP([ofproto - group stats (OpenFlow 1.5)]) | |
1122 | OVS_VSWITCHD_START | |
1123 | AT_DATA([groups.txt], [dnl | |
1124 | group_id=1234,type=all,bucket=output:10 | |
1125 | group_id=1235,type=all,bucket=output:10 | |
1126 | ]) | |
1127 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt]) | |
1128 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-flow br0 'tcp actions=group:1234']) | |
1129 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout]) | |
8a32aaa5 | 1130 | AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl |
afc63bb4 SH |
1131 | group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 |
1132 | OFPST_GROUP reply (OF1.5): | |
1133 | ]) | |
1134 | AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0], [0], [stdout]) | |
8a32aaa5 | 1135 | AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl |
afc63bb4 SH |
1136 | group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 |
1137 | group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 | |
1138 | OFPST_GROUP reply (OF1.5): | |
1139 | ]) | |
1140 | OVS_VSWITCHD_STOP | |
1141 | AT_CLEANUP | |
1142 | ||
daab0ae6 BP |
1143 | dnl This found a use-after-free error in bridge destruction in the |
1144 | dnl presence of groups. | |
1145 | AT_SETUP([ofproto - group add then bridge delete (OpenFlow 1.3)]) | |
1146 | OVS_VSWITCHD_START | |
1147 | AT_DATA([groups.txt], [dnl | |
1148 | group_id=1234,type=all,bucket=output:10 | |
1149 | group_id=1235,type=all,bucket=output:10 | |
4a48cdfb BP |
1150 | |
1151 | dnl This checks for regression against a parser bug such that | |
1152 | dnl "actions=resbmit(,1)" etc. was rejected as a syntax error. | |
1153 | group_id=2345,type=select,bucket=weight:10,actions=resubmit(,1),bucket=weight:10,actions=resubmit(,2),bucket=weight:1,actions=resubmit(,3) | |
daab0ae6 BP |
1154 | ]) |
1155 | AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt]) | |
1156 | AT_CHECK([ovs-vsctl del-br br0]) | |
1157 | OVS_VSWITCHD_STOP | |
1158 | AT_CLEANUP | |
1159 | ||
9dcd1c00 | 1160 | AT_SETUP([ofproto - mod-port (OpenFlow 1.0)]) |
023e1e0a | 1161 | OVS_VSWITCHD_START |
a2cb9dfd BP |
1162 | for command_config_state in \ |
1163 | 'up 0 0' \ | |
0ab14c8e BP |
1164 | 'noflood NO_FLOOD 0' \ |
1165 | 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \ | |
28124950 BP |
1166 | 'flood PORT_DOWN LINK_DOWN' \ |
1167 | 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \ | |
1168 | 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \ | |
1169 | 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \ | |
1170 | 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \ | |
1171 | 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \ | |
1172 | 'up NO_RECV 0' \ | |
1173 | 'receive 0 0' | |
a2cb9dfd BP |
1174 | do |
1175 | set $command_config_state | |
0ab14c8e | 1176 | command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3] |
ea523221 BP |
1177 | AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command]) |
1178 | AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout]) | |
8a32aaa5 | 1179 | AT_CHECK_UNQUOTED([strip_xids < stdout], [0], [dnl |
9e1fd49b | 1180 | OFPT_FEATURES_REPLY: dpid:fedcba9876543210 |
c184807c | 1181 | n_tables:254, n_buffers:0 |
9e1fd49b | 1182 | capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP |
08d1e234 | 1183 | 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 |
0ab14c8e BP |
1184 | LOCAL(br0): addr:aa:55:aa:55:00:00 |
1185 | config: $config | |
1186 | state: $state | |
d02a5f8e | 1187 | speed: 0 Mbps now, 0 Mbps max |
3b62feba | 1188 | OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0 |
a2cb9dfd BP |
1189 | ]) |
1190 | done | |
023e1e0a | 1191 | OVS_VSWITCHD_STOP |
a2cb9dfd | 1192 | AT_CLEANUP |
640c7c94 | 1193 | |
9dcd1c00 SH |
1194 | AT_SETUP([ofproto - mod-port (OpenFlow 1.2)]) |
1195 | OVS_VSWITCHD_START | |
1196 | for command_config_state in \ | |
1197 | 'up 0 0' \ | |
1198 | 'down PORT_DOWN LINK_DOWN' \ | |
1199 | 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \ | |
1200 | 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \ | |
1201 | 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \ | |
1202 | 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \ | |
1203 | 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \ | |
1204 | 'up NO_RECV 0' \ | |
1205 | 'receive 0 0' | |
1206 | do | |
1207 | set $command_config_state | |
1208 | command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3] | |
1209 | AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command]) | |
1210 | AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout]) | |
8a32aaa5 | 1211 | AT_CHECK_UNQUOTED([strip_xids < stdout], [0], [dnl |
9dcd1c00 | 1212 | OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210 |
c184807c | 1213 | n_tables:254, n_buffers:0 |
4efe455d | 1214 | capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS |
9dcd1c00 SH |
1215 | LOCAL(br0): addr:aa:55:aa:55:00:00 |
1216 | config: $config | |
1217 | state: $state | |
1218 | speed: 0 Mbps now, 0 Mbps max | |
1219 | OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0 | |
1220 | ]) | |
1221 | done | |
1222 | OVS_VSWITCHD_STOP | |
1223 | AT_CLEANUP | |
1224 | ||
18cc69d9 BP |
1225 | AT_SETUP([ofproto - mod-port (OpenFlow 1.4)]) |
1226 | OVS_VSWITCHD_START | |
1227 | for command_config_state in \ | |
1228 | 'up 0 0' \ | |
1229 | 'down PORT_DOWN LINK_DOWN' \ | |
1230 | 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \ | |
1231 | 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \ | |
1232 | 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \ | |
1233 | 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \ | |
1234 | 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \ | |
1235 | 'up NO_RECV 0' \ | |
1236 | 'receive 0 0' | |
1237 | do | |
1238 | set $command_config_state | |
1239 | command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3] | |
1240 | AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command]) | |
1241 | AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn show br0], [0], [stdout]) | |
8a32aaa5 | 1242 | AT_CHECK_UNQUOTED([strip_xids < stdout], [0], [dnl |
18cc69d9 | 1243 | OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210 |
c184807c | 1244 | n_tables:254, n_buffers:0 |
50b73fe1 | 1245 | capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS BUNDLES |
18cc69d9 BP |
1246 | OFPST_PORT_DESC reply (OF1.4): |
1247 | LOCAL(br0): addr:aa:55:aa:55:00:00 | |
1248 | config: $config | |
1249 | state: $state | |
1250 | speed: 0 Mbps now, 0 Mbps max | |
1251 | OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0 | |
1252 | ]) | |
1253 | done | |
1254 | OVS_VSWITCHD_STOP | |
1255 | AT_CLEANUP | |
1256 | ||
c168dcc8 | 1257 | AT_SETUP([ofproto - basic flow_mod commands (NXM)]) |
023e1e0a | 1258 | OVS_VSWITCHD_START |
ef0ce8ae | 1259 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply: |
640c7c94 | 1260 | ]) |
c6100d92 BP |
1261 | AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -]) |
1262 | AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2]) | |
1263 | AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3]) | |
ef0ce8ae | 1264 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 BP |
1265 | in_port=1 actions=output:2 |
1266 | in_port=2 actions=output:1 | |
1267 | table=1, in_port=4 actions=output:3 | |
0721c073 | 1268 | NXST_FLOW reply: |
640c7c94 | 1269 | ]) |
8a32aaa5 | 1270 | AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | strip_xids], [0], [dnl |
c168dcc8 BP |
1271 | NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2 |
1272 | ]) | |
640c7c94 | 1273 | AT_CHECK([ovs-ofctl del-flows br0]) |
ef0ce8ae | 1274 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply: |
640c7c94 | 1275 | ]) |
023e1e0a | 1276 | OVS_VSWITCHD_STOP |
640c7c94 | 1277 | AT_CLEANUP |
c168dcc8 BP |
1278 | |
1279 | AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)]) | |
023e1e0a | 1280 | OVS_VSWITCHD_START |
ef0ce8ae | 1281 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply: |
c168dcc8 | 1282 | ]) |
c6100d92 BP |
1283 | AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -]) |
1284 | AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2]) | |
1285 | AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3]) | |
ef0ce8ae | 1286 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 BP |
1287 | in_port=1 actions=output:2 |
1288 | in_port=2 actions=output:1 | |
1289 | table=1, in_port=4 actions=output:3 | |
c168dcc8 BP |
1290 | OFPST_FLOW reply: |
1291 | ]) | |
8a32aaa5 | 1292 | AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | strip_xids], [0], [dnl |
c168dcc8 BP |
1293 | OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2 |
1294 | ]) | |
1295 | AT_CHECK([ovs-ofctl -F openflow10 del-flows br0]) | |
ef0ce8ae | 1296 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply: |
c168dcc8 | 1297 | ]) |
023e1e0a | 1298 | OVS_VSWITCHD_STOP |
c168dcc8 | 1299 | AT_CLEANUP |
e729e793 | 1300 | |
13327b8e BP |
1301 | # It's really dumb that check_overlap and reset_counts are considered |
1302 | # part of flow state, but OpenFlow implies that it is, and OFTest and | |
1303 | # some users insist on it. | |
1304 | AT_SETUP([ofproto - add-flow and flags]) | |
1305 | OVS_VSWITCHD_START | |
1306 | AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 check_overlap,in_port=1,actions=drop]) | |
1307 | # Prior to OF1.3, flow dumps didn't include a "flags" field. | |
1308 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [dnl | |
1309 | OFPST_FLOW reply: | |
1310 | in_port=1 actions=drop | |
1311 | ]) | |
1312 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl | |
1313 | OFPST_FLOW reply (OF1.1): | |
1314 | in_port=1 actions=drop | |
1315 | ]) | |
1316 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [dnl | |
1317 | OFPST_FLOW reply (OF1.2): | |
1318 | in_port=1 actions=drop | |
1319 | ]) | |
1320 | # OF1.3 makes the flags visible. | |
1321 | AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip], [0], [dnl | |
1322 | OFPST_FLOW reply (OF1.3): | |
1323 | check_overlap reset_counts in_port=1 actions=drop | |
1324 | ]) | |
1325 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip], [0], [dnl | |
1326 | OFPST_FLOW reply (OF1.4): | |
1327 | check_overlap reset_counts in_port=1 actions=drop | |
1328 | ]) | |
1329 | AT_CHECK([ovs-ofctl -O OpenFlow15 dump-flows br0 | ofctl_strip], [0], [dnl | |
1330 | OFPST_FLOW reply (OF1.5): | |
1331 | check_overlap reset_counts in_port=1 actions=drop | |
1332 | ]) | |
1333 | OVS_VSWITCHD_STOP | |
1334 | AT_CLEANUP | |
1335 | ||
75fa58f8 BP |
1336 | AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)]) |
1337 | OVS_VSWITCHD_START | |
1338 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1): | |
1339 | ]) | |
1340 | AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -]) | |
1341 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2]) | |
1342 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3]) | |
1343 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1344 | in_port=1 actions=output:2 | |
1345 | in_port=2 actions=output:1 | |
1346 | table=1, in_port=4 actions=output:3 | |
1347 | OFPST_FLOW reply (OF1.1): | |
1348 | ]) | |
8a32aaa5 | 1349 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | strip_xids], [0], [dnl |
75fa58f8 BP |
1350 | OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2 |
1351 | ]) | |
1352 | AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0]) | |
1353 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1): | |
0e197060 | 1354 | table=1, in_port=4 actions=output:3 |
75fa58f8 BP |
1355 | ]) |
1356 | OVS_VSWITCHD_STOP | |
1357 | AT_CLEANUP | |
1358 | ||
862d8eed BP |
1359 | AT_SETUP([ofproto - flow_mod negative test (OpenFlow 1.1)]) |
1360 | OVS_VSWITCHD_START( | |
1361 | [set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]) | |
1362 | AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2]) | |
862d8eed | 1363 | |
0e197060 BP |
1364 | # The error message here actually comes from ovs-ofctl, not from ovs-vswitchd, |
1365 | # but at least it's the same code in ofpacts_check() that issues the error. | |
1366 | AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1], | |
1367 | [1], [], | |
8c87971e | 1368 | [ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID) |
862d8eed BP |
1369 | ]) |
1370 | OVS_VSWITCHD_STOP | |
1371 | AT_CLEANUP | |
1372 | ||
f5c45121 SH |
1373 | AT_SETUP([ofproto - set-field flow_mod commands (NXM)]) |
1374 | OVS_VSWITCHD_START | |
1375 | AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop]) | |
1376 | 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]) | |
e60e935b | 1377 | 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]) |
f5c45121 | 1378 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl |
e60e935b | 1379 | 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[[]] |
f5c45121 SH |
1380 | table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]] |
1381 | NXST_FLOW reply: | |
1382 | ]) | |
1383 | OVS_VSWITCHD_STOP | |
1384 | AT_CLEANUP | |
1385 | ||
9dcd1c00 | 1386 | AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)]) |
e729e793 | 1387 | OVS_VSWITCHD_START |
9dcd1c00 | 1388 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2): |
e729e793 | 1389 | ]) |
9dcd1c00 SH |
1390 | AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -]) |
1391 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2]) | |
1392 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3]) | |
1393 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1394 | in_port=1 actions=output:2 | |
1395 | in_port=2 actions=output:1 | |
1396 | table=1, in_port=4 actions=output:3 | |
1397 | OFPST_FLOW reply (OF1.2): | |
e729e793 | 1398 | ]) |
9dcd1c00 SH |
1399 | AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0]) |
1400 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2): | |
e729e793 JP |
1401 | ]) |
1402 | OVS_VSWITCHD_STOP | |
1403 | AT_CLEANUP | |
1404 | ||
e60e935b SRCSA |
1405 | AT_SETUP([ofproto - set-field flow_mod commands (OF1.2)]) |
1406 | OVS_VSWITCHD_START | |
1407 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 ipv6,table=1,in_port=3,actions=drop]) | |
1408 | 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]) | |
1409 | 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]) | |
1410 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1411 | 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 | |
1412 | table=1, ipv6,in_port=3 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src | |
1413 | OFPST_FLOW reply (OF1.2): | |
1414 | ]) | |
1415 | OVS_VSWITCHD_STOP | |
1416 | AT_CLEANUP | |
1417 | ||
9dcd1c00 | 1418 | AT_SETUP([ofproto - dump flows with cookie]) |
e729e793 | 1419 | OVS_VSWITCHD_START |
c6100d92 BP |
1420 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1]) |
1421 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1]) | |
1422 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1]) | |
ef0ce8ae | 1423 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 BP |
1424 | cookie=0x1, in_port=1 actions=output:1 |
1425 | cookie=0x2, in_port=2 actions=output:1 | |
1426 | cookie=0x3, in_port=3 actions=output:1 | |
e729e793 JP |
1427 | NXST_FLOW reply: |
1428 | ]) | |
8a32aaa5 | 1429 | AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | strip_xids], [0], [dnl |
e729e793 JP |
1430 | NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3 |
1431 | ]) | |
9dcd1c00 | 1432 | AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl |
c6100d92 | 1433 | cookie=0x3, in_port=3 actions=output:1 |
e729e793 JP |
1434 | NXST_FLOW reply: |
1435 | ]) | |
8a32aaa5 | 1436 | AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | strip_xids], [0], [dnl |
9dcd1c00 | 1437 | NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1 |
e729e793 JP |
1438 | ]) |
1439 | OVS_VSWITCHD_STOP | |
1440 | AT_CLEANUP | |
1441 | ||
623e1caf JP |
1442 | AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)]) |
1443 | OVS_VSWITCHD_START | |
c6100d92 | 1444 | AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1]) |
623e1caf | 1445 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 | 1446 | cookie=0x1, in_port=1 actions=output:1 |
623e1caf JP |
1447 | OFPST_FLOW reply: |
1448 | ]) | |
1449 | ||
c6100d92 | 1450 | AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1]) |
623e1caf | 1451 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 | 1452 | cookie=0x2, in_port=1 actions=output:1 |
623e1caf JP |
1453 | OFPST_FLOW reply: |
1454 | ]) | |
1455 | OVS_VSWITCHD_STOP | |
1456 | AT_CLEANUP | |
1457 | ||
1458 | AT_SETUP([ofproto - mod flow with cookie change (NXM)]) | |
1459 | OVS_VSWITCHD_START | |
c6100d92 | 1460 | AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1]) |
623e1caf | 1461 | AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 | 1462 | cookie=0x1, in_port=1 actions=output:1 |
623e1caf JP |
1463 | NXST_FLOW reply: |
1464 | ]) | |
1465 | ||
c6100d92 | 1466 | AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1]) |
623e1caf | 1467 | AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 | 1468 | cookie=0x2, in_port=1 actions=output:1 |
623e1caf JP |
1469 | NXST_FLOW reply: |
1470 | ]) | |
1471 | OVS_VSWITCHD_STOP | |
1472 | AT_CLEANUP | |
1473 | ||
75fa58f8 BP |
1474 | AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)]) |
1475 | OVS_VSWITCHD_START | |
1476 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1]) | |
1477 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1478 | cookie=0x1, in_port=1 actions=output:1 | |
1479 | OFPST_FLOW reply (OF1.1): | |
1480 | ]) | |
1481 | AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1]) | |
1482 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1483 | cookie=0x1, in_port=1 actions=output:1 | |
1484 | OFPST_FLOW reply (OF1.1): | |
1485 | ]) | |
1486 | OVS_VSWITCHD_STOP | |
1487 | AT_CLEANUP | |
1488 | ||
9dcd1c00 | 1489 | dnl The OpenFlow 1.2 spec states that the cookie may not be modified |
2df3b874 | 1490 | AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)]) |
9dcd1c00 SH |
1491 | OVS_VSWITCHD_START |
1492 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1]) | |
1493 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1494 | cookie=0x1, in_port=1 actions=output:1 | |
1495 | OFPST_FLOW reply (OF1.2): | |
1496 | ]) | |
1497 | ||
1498 | AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1]) | |
1499 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1500 | cookie=0x1, in_port=1 actions=output:1 | |
1501 | OFPST_FLOW reply (OF1.2): | |
1502 | ]) | |
1503 | OVS_VSWITCHD_STOP | |
1504 | AT_CLEANUP | |
1505 | ||
1506 | AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)]) | |
623e1caf | 1507 | OVS_VSWITCHD_START |
c6100d92 BP |
1508 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1]) |
1509 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1]) | |
1510 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1]) | |
623e1caf | 1511 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 BP |
1512 | cookie=0x1, in_port=1 actions=output:1 |
1513 | cookie=0x1, in_port=2 actions=output:1 | |
1514 | cookie=0x2, in_port=3 actions=output:1 | |
623e1caf JP |
1515 | NXST_FLOW reply: |
1516 | ]) | |
1517 | ||
1518 | AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4]) | |
1519 | AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1520 | cookie=0x1, in_port=1 actions=output:4 | |
1521 | cookie=0x1, in_port=2 actions=output:4 | |
c6100d92 | 1522 | cookie=0x2, in_port=3 actions=output:1 |
623e1caf JP |
1523 | NXST_FLOW reply: |
1524 | ]) | |
1525 | OVS_VSWITCHD_STOP | |
1526 | AT_CLEANUP | |
1527 | ||
75fa58f8 BP |
1528 | AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)]) |
1529 | OVS_VSWITCHD_START | |
1530 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1]) | |
1531 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1]) | |
1532 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1]) | |
1533 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1534 | cookie=0x1, in_port=1 actions=output:1 | |
1535 | cookie=0x1, in_port=2 actions=output:1 | |
1536 | cookie=0x2, in_port=3 actions=output:1 | |
1537 | OFPST_FLOW reply (OF1.1): | |
1538 | ]) | |
1539 | ||
1540 | AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4]) | |
1541 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1542 | cookie=0x1, in_port=1 actions=output:4 | |
1543 | cookie=0x1, in_port=2 actions=output:4 | |
1544 | cookie=0x2, in_port=3 actions=output:1 | |
1545 | OFPST_FLOW reply (OF1.1): | |
1546 | ]) | |
1547 | OVS_VSWITCHD_STOP | |
1548 | AT_CLEANUP | |
1549 | ||
9dcd1c00 SH |
1550 | AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)]) |
1551 | OVS_VSWITCHD_START | |
1552 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1]) | |
1553 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1]) | |
1554 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1]) | |
1555 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1556 | cookie=0x1, in_port=1 actions=output:1 | |
1557 | cookie=0x1, in_port=2 actions=output:1 | |
1558 | cookie=0x2, in_port=3 actions=output:1 | |
1559 | OFPST_FLOW reply (OF1.2): | |
1560 | ]) | |
1561 | ||
1562 | AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4]) | |
1563 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1564 | cookie=0x1, in_port=1 actions=output:4 | |
1565 | cookie=0x1, in_port=2 actions=output:4 | |
1566 | cookie=0x2, in_port=3 actions=output:1 | |
1567 | OFPST_FLOW reply (OF1.2): | |
1568 | ]) | |
1569 | OVS_VSWITCHD_STOP | |
1570 | AT_CLEANUP | |
1571 | ||
1572 | dnl The OpenFlow 1.2 spec states that the cookie may not be modified | |
623e1caf JP |
1573 | AT_SETUP([ofproto - mod flows based on cookie mask with cookie change]) |
1574 | OVS_VSWITCHD_START | |
c6100d92 BP |
1575 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1]) |
1576 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1]) | |
1577 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1]) | |
623e1caf | 1578 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 BP |
1579 | cookie=0x1, in_port=1 actions=output:1 |
1580 | cookie=0x1, in_port=2 actions=output:1 | |
1581 | cookie=0x2, in_port=3 actions=output:1 | |
623e1caf JP |
1582 | NXST_FLOW reply: |
1583 | ]) | |
1584 | ||
1585 | AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4]) | |
1586 | AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
c6100d92 | 1587 | cookie=0x2, in_port=3 actions=output:1 |
623e1caf JP |
1588 | cookie=0x4, in_port=1 actions=output:4 |
1589 | cookie=0x4, in_port=2 actions=output:4 | |
1590 | NXST_FLOW reply: | |
1591 | ]) | |
1592 | OVS_VSWITCHD_STOP | |
1593 | AT_CLEANUP | |
1594 | ||
490020fe | 1595 | AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM]) |
623e1caf | 1596 | OVS_VSWITCHD_START |
c6100d92 | 1597 | AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1]) |
623e1caf | 1598 | AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 | 1599 | in_port=1 actions=output:1 |
623e1caf JP |
1600 | NXST_FLOW reply: |
1601 | ]) | |
1602 | OVS_VSWITCHD_STOP | |
1603 | AT_CLEANUP | |
1604 | ||
75fa58f8 BP |
1605 | AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1]) |
1606 | OVS_VSWITCHD_START | |
1607 | AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1]) | |
1608 | AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1609 | in_port=1 actions=output:1 | |
1610 | OFPST_FLOW reply (OF1.1): | |
1611 | ]) | |
1612 | OVS_VSWITCHD_STOP | |
1613 | AT_CLEANUP | |
1614 | ||
490020fe BP |
1615 | AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2]) |
1616 | OVS_VSWITCHD_START | |
1617 | AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1]) | |
1618 | AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1619 | OFPST_FLOW reply (OF1.2): | |
1620 | ]) | |
1621 | OVS_VSWITCHD_STOP | |
1622 | AT_CLEANUP | |
1623 | ||
1624 | AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM]) | |
623e1caf | 1625 | OVS_VSWITCHD_START |
c6100d92 | 1626 | AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1]) |
623e1caf JP |
1627 | AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl |
1628 | NXST_FLOW reply: | |
1629 | ]) | |
1630 | OVS_VSWITCHD_STOP | |
1631 | AT_CLEANUP | |
1632 | ||
75fa58f8 BP |
1633 | AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1]) |
1634 | OVS_VSWITCHD_START | |
1635 | AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1]) | |
1636 | AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1637 | OFPST_FLOW reply (OF1.1): | |
1638 | ]) | |
1639 | OVS_VSWITCHD_STOP | |
1640 | AT_CLEANUP | |
1641 | ||
490020fe BP |
1642 | AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2]) |
1643 | OVS_VSWITCHD_START | |
1644 | AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1]) | |
1645 | AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1646 | OFPST_FLOW reply (OF1.2): | |
1647 | ]) | |
1648 | OVS_VSWITCHD_STOP | |
1649 | AT_CLEANUP | |
1650 | ||
623e1caf JP |
1651 | AT_SETUP([ofproto - del flows with cookies]) |
1652 | OVS_VSWITCHD_START | |
c6100d92 BP |
1653 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1]) |
1654 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1]) | |
1655 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1]) | |
623e1caf | 1656 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 BP |
1657 | cookie=0x1, in_port=1 actions=output:1 |
1658 | cookie=0x2, in_port=2 actions=output:1 | |
1659 | cookie=0x3, in_port=3 actions=output:1 | |
623e1caf JP |
1660 | NXST_FLOW reply: |
1661 | ]) | |
1662 | ||
1663 | AT_CHECK([ovs-ofctl del-flows br0]) | |
1664 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1665 | NXST_FLOW reply: | |
1666 | ]) | |
1667 | OVS_VSWITCHD_STOP | |
1668 | AT_CLEANUP | |
1669 | ||
1670 | AT_SETUP([ofproto - del flows based on cookie]) | |
e729e793 | 1671 | OVS_VSWITCHD_START |
c6100d92 BP |
1672 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1]) |
1673 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1]) | |
1674 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1]) | |
ef0ce8ae | 1675 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 BP |
1676 | cookie=0x1, in_port=1 actions=output:1 |
1677 | cookie=0x2, in_port=2 actions=output:1 | |
1678 | cookie=0x3, in_port=3 actions=output:1 | |
e729e793 JP |
1679 | NXST_FLOW reply: |
1680 | ]) | |
80d5aefd | 1681 | |
623e1caf | 1682 | AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1]) |
ef0ce8ae | 1683 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 BP |
1684 | cookie=0x1, in_port=1 actions=output:1 |
1685 | cookie=0x2, in_port=2 actions=output:1 | |
e729e793 JP |
1686 | NXST_FLOW reply: |
1687 | ]) | |
1688 | OVS_VSWITCHD_STOP | |
1689 | AT_CLEANUP | |
1690 | ||
623e1caf | 1691 | AT_SETUP([ofproto - del flows based on cookie mask]) |
e729e793 | 1692 | OVS_VSWITCHD_START |
c6100d92 BP |
1693 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1]) |
1694 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1]) | |
1695 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1]) | |
ef0ce8ae | 1696 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 BP |
1697 | cookie=0x1, in_port=1 actions=output:1 |
1698 | cookie=0x2, in_port=2 actions=output:1 | |
1699 | cookie=0x3, in_port=3 actions=output:1 | |
e729e793 JP |
1700 | NXST_FLOW reply: |
1701 | ]) | |
1702 | AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1]) | |
ef0ce8ae | 1703 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl |
c6100d92 | 1704 | cookie=0x2, in_port=2 actions=output:1 |
e729e793 JP |
1705 | NXST_FLOW reply: |
1706 | ]) | |
1707 | OVS_VSWITCHD_STOP | |
1708 | AT_CLEANUP | |
254750ce | 1709 | |
9dcd1c00 | 1710 | AT_SETUP([ofproto - del flows based on table id (NXM)]) |
c90cfeaf SH |
1711 | OVS_VSWITCHD_START |
1712 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1]) | |
1713 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1]) | |
1714 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1715 | cookie=0x1, in_port=1 actions=output:1 | |
1716 | cookie=0x2, table=1, in_port=2 actions=output:1 | |
1717 | NXST_FLOW reply: | |
1718 | ]) | |
1719 | AT_CHECK([ovs-ofctl del-flows br0 table=0]) | |
1720 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1721 | cookie=0x2, table=1, in_port=2 actions=output:1 | |
1722 | NXST_FLOW reply: | |
1723 | ]) | |
1724 | AT_CHECK([ovs-ofctl del-flows br0 table=1]) | |
1725 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1726 | NXST_FLOW reply: | |
1727 | ]) | |
1728 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1]) | |
1729 | AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1]) | |
1730 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1731 | cookie=0x1, in_port=1 actions=output:1 | |
1732 | cookie=0x2, table=1, in_port=2 actions=output:1 | |
1733 | NXST_FLOW reply: | |
1734 | ]) | |
1735 | AT_CHECK([ovs-ofctl del-flows br0]) | |
1736 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1737 | NXST_FLOW reply: | |
1738 | ]) | |
1739 | OVS_VSWITCHD_STOP | |
1740 | AT_CLEANUP | |
1741 | ||
75fa58f8 BP |
1742 | AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)]) |
1743 | OVS_VSWITCHD_START | |
1744 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1]) | |
1745 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1]) | |
1746 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1747 | cookie=0x1, in_port=1 actions=output:1 | |
1748 | cookie=0x2, table=1, in_port=2 actions=output:1 | |
1749 | OFPST_FLOW reply (OF1.1): | |
1750 | ]) | |
1751 | AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0]) | |
1752 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1753 | cookie=0x2, table=1, in_port=2 actions=output:1 | |
1754 | OFPST_FLOW reply (OF1.1): | |
1755 | ]) | |
1756 | AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1]) | |
1757 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1758 | OFPST_FLOW reply (OF1.1): | |
1759 | ]) | |
1760 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1]) | |
1761 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1]) | |
1762 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1763 | cookie=0x1, in_port=1 actions=output:1 | |
1764 | cookie=0x2, table=1, in_port=2 actions=output:1 | |
1765 | OFPST_FLOW reply (OF1.1): | |
1766 | ]) | |
1767 | AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0]) | |
0e197060 | 1768 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl |
75fa58f8 | 1769 | OFPST_FLOW reply (OF1.1): |
0e197060 | 1770 | cookie=0x2, table=1, in_port=2 actions=output:1 |
75fa58f8 BP |
1771 | ]) |
1772 | OVS_VSWITCHD_STOP | |
1773 | AT_CLEANUP | |
1774 | ||
9dcd1c00 SH |
1775 | AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)]) |
1776 | OVS_VSWITCHD_START | |
1777 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1]) | |
1778 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1]) | |
1779 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1780 | cookie=0x1, in_port=1 actions=output:1 | |
1781 | cookie=0x2, table=1, in_port=2 actions=output:1 | |
1782 | OFPST_FLOW reply (OF1.2): | |
1783 | ]) | |
1784 | AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0]) | |
1785 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1786 | cookie=0x2, table=1, in_port=2 actions=output:1 | |
1787 | OFPST_FLOW reply (OF1.2): | |
1788 | ]) | |
1789 | AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1]) | |
1790 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1791 | OFPST_FLOW reply (OF1.2): | |
1792 | ]) | |
1793 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1]) | |
1794 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1]) | |
1795 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1796 | cookie=0x1, in_port=1 actions=output:1 | |
1797 | cookie=0x2, table=1, in_port=2 actions=output:1 | |
1798 | OFPST_FLOW reply (OF1.2): | |
1799 | ]) | |
1800 | AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0]) | |
1801 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
1802 | OFPST_FLOW reply (OF1.2): | |
1803 | ]) | |
1804 | OVS_VSWITCHD_STOP | |
1805 | AT_CLEANUP | |
1806 | ||
71300040 BP |
1807 | AT_SETUP([ofproto - flow_mod with out_port matching (OpenFlow 1.0)]) |
1808 | OVS_VSWITCHD_START | |
1809 | AT_DATA([flows.txt], [dnl | |
1810 | in_port=1 actions=output:2 | |
1811 | in_port=2 actions=output:1,output:2,output:3 | |
1812 | in_port=3 actions=output:3,output:1,output:2 | |
1813 | in_port=4 actions=drop | |
1814 | in_port=5 actions=output:3 | |
1815 | in_port=6 actions=output:1 | |
1816 | ]) | |
1817 | AT_CHECK([ovs-ofctl -F openflow10 add-flows br0 flows.txt]) | |
1818 | (cat flows.txt; echo 'OFPST_FLOW reply:') > expout | |
1819 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], | |
1820 | [expout]) | |
1821 | ||
1822 | (grep 'output:2' flows.txt; echo 'OFPST_FLOW reply:') > expout | |
1823 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 out_port=2 | ofctl_strip | sort], [0], [expout]) | |
1824 | ||
1825 | AT_CHECK([ovs-ofctl -F openflow10 del-flows br0 out_port=2]) | |
1826 | (grep -v 'output:2' flows.txt; echo 'OFPST_FLOW reply:') > expout | |
1827 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], | |
1828 | [expout]) | |
1829 | ||
1830 | AT_CHECK([ovs-ofctl -F openflow10 del-flows br0 out_port=3]) | |
1831 | (grep -v 'output:[[23]]' flows.txt; echo 'OFPST_FLOW reply:') > expout | |
1832 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], | |
1833 | [expout]) | |
1834 | ||
1835 | AT_CHECK([ovs-ofctl -F openflow10 del-flows br0 out_port=1]) | |
1836 | (grep -v 'output:[[123]]' flows.txt; echo 'OFPST_FLOW reply:') > expout | |
1837 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], | |
1838 | [expout]) | |
1839 | ||
1840 | OVS_VSWITCHD_STOP | |
1841 | AT_CLEANUP | |
1842 | ||
1843 | AT_SETUP([ofproto - flow_mod with out_port matching (OpenFlow 1.1)]) | |
1844 | OVS_VSWITCHD_START | |
1845 | AT_DATA([flows.txt], [dnl | |
1846 | in_port=1 actions=output:2 | |
1847 | in_port=2 actions=output:1,write_actions(output:2,output:3) | |
1848 | in_port=3 actions=output:3,output:1,write_actions(output:2) | |
1849 | in_port=4 actions=drop | |
1850 | in_port=5 actions=write_actions(output:3) | |
1851 | in_port=6 actions=output:1 | |
1852 | ]) | |
1853 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-flows br0 flows.txt]) | |
1854 | (cat flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout | |
1855 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], | |
1856 | [expout]) | |
1857 | ||
1858 | (grep 'output:2' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout | |
1859 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 out_port=2 | ofctl_strip | sort], [0], [expout]) | |
1860 | ||
1861 | AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_port=2]) | |
1862 | (grep -v 'output:2' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout | |
1863 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], | |
1864 | [expout]) | |
1865 | ||
1866 | AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_port=3]) | |
1867 | (grep -v 'output:[[23]]' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout | |
1868 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], | |
1869 | [expout]) | |
1870 | ||
1871 | AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_port=1]) | |
1872 | (grep -v 'output:[[123]]' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout | |
1873 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], | |
1874 | [expout]) | |
1875 | ||
1876 | OVS_VSWITCHD_STOP | |
1877 | AT_CLEANUP | |
1878 | ||
1879 | AT_SETUP([ofproto - flow_mod with out_group matching (OpenFlow 1.1)]) | |
1880 | OVS_VSWITCHD_START | |
1881 | AT_DATA([groups.txt], [dnl | |
1882 | group_id=1,type=all,bucket=output:10 | |
1883 | group_id=2,type=all,bucket=output:10 | |
1884 | group_id=3,type=all,bucket=output:10 | |
1885 | ]) | |
1886 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-groups br0 groups.txt]) | |
1887 | AT_DATA([flows.txt], [dnl | |
1888 | in_port=1 actions=group:2,output:5 | |
1889 | in_port=2 actions=group:1,write_actions(group:2,group:3,output:6) | |
1890 | in_port=3 actions=group:3,group:1,write_actions(group:2,output:3) | |
1891 | in_port=4 actions=output:4 | |
1892 | in_port=5 actions=write_actions(output:4,group:3) | |
1893 | in_port=6 actions=group:1 | |
1894 | ]) | |
1895 | AT_CHECK([ovs-ofctl -O OpenFlow11 add-flows br0 flows.txt]) | |
1896 | (cat flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout | |
1897 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], | |
1898 | [expout]) | |
1899 | ||
1900 | (grep 'output:3' flows.txt | grep 'group:2'; echo 'OFPST_FLOW reply (OF1.1):') > expout | |
1901 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 out_port=3,out_group=2 | ofctl_strip | sort], [0], [expout]) | |
1902 | ||
1903 | AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_group=2]) | |
1904 | (grep -v 'group:2' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout | |
1905 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], | |
1906 | [expout]) | |
1907 | ||
1908 | AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_group=3]) | |
1909 | (grep -v 'group:[[23]]' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout | |
1910 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], | |
1911 | [expout]) | |
1912 | ||
1913 | AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 out_group=1]) | |
1914 | (grep -v 'group:[[123]]' flows.txt; echo 'OFPST_FLOW reply (OF1.1):') > expout | |
1915 | AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], | |
1916 | [expout]) | |
1917 | ||
1918 | OVS_VSWITCHD_STOP | |
1919 | AT_CLEANUP | |
1920 | ||
25070e04 JR |
1921 | AT_SETUP([ofproto - bundle flow_mod with out group matching (OpenFlow 1.4)]) |
1922 | OVS_VSWITCHD_START | |
1923 | AT_DATA([bundle.txt], [dnl | |
1924 | group group_id=1,type=all,bucket=output:10 | |
1925 | group group_id=2,type=all,bucket=output:10 | |
1926 | group group_id=3,type=all,bucket=output:10 | |
1927 | flow in_port=1 actions=group:2,output:5 | |
1928 | flow in_port=2 actions=group:1,write_actions(group:2,group:3,output:6) | |
1929 | flow in_port=3 actions=group:3,group:1,write_actions(group:2,output:3) | |
1930 | flow in_port=4 actions=output:4 | |
1931 | flow in_port=5 actions=write_actions(output:4,group:3) | |
1932 | flow in_port=6 actions=group:1 | |
1933 | ]) | |
1934 | AT_CHECK([ovs-ofctl bundle br0 bundle.txt]) | |
1935 | ||
1936 | # for checking | |
1937 | AT_DATA([flows.txt], [dnl | |
1938 | in_port=1 actions=group:2,output:5 | |
1939 | in_port=2 actions=group:1,write_actions(group:2,group:3,output:6) | |
1940 | in_port=3 actions=group:3,group:1,write_actions(group:2,output:3) | |
1941 | in_port=4 actions=output:4 | |
1942 | in_port=5 actions=write_actions(output:4,group:3) | |
1943 | in_port=6 actions=group:1 | |
1944 | ]) | |
1945 | ||
1946 | (cat flows.txt; echo 'OFPST_FLOW reply (OF1.4):') > expout | |
1947 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], | |
1948 | [expout]) | |
1949 | ||
1950 | (grep 'output:3' flows.txt | grep 'group:2'; echo 'OFPST_FLOW reply (OF1.4):') > expout | |
1951 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 out_port=3,out_group=2 | ofctl_strip | sort], [0], [expout]) | |
1952 | ||
1953 | AT_CHECK([ovs-ofctl -O OpenFlow14 del-flows br0 out_group=2]) | |
1954 | (grep -v 'group:2' flows.txt; echo 'OFPST_FLOW reply (OF1.4):') > expout | |
1955 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], | |
1956 | [expout]) | |
1957 | ||
1958 | AT_CHECK([ovs-ofctl -O OpenFlow14 del-flows br0 out_group=3]) | |
1959 | (grep -v 'group:[[23]]' flows.txt; echo 'OFPST_FLOW reply (OF1.4):') > expout | |
1960 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], | |
1961 | [expout]) | |
1962 | ||
1963 | AT_CHECK([ovs-ofctl -O OpenFlow14 del-flows br0 out_group=1]) | |
1964 | (grep -v 'group:[[123]]' flows.txt; echo 'OFPST_FLOW reply (OF1.4):') > expout | |
1965 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], | |
1966 | [expout]) | |
1967 | ||
1968 | OVS_VSWITCHD_STOP | |
1969 | AT_CLEANUP | |
1970 | ||
6dd3c787 JR |
1971 | AT_SETUP([ofproto - bundle packet-out (OpenFlow 1.4)]) |
1972 | OVS_VSWITCHD_START | |
1973 | ||
1974 | ovs-ofctl del-flows br0 | |
1975 | ovs-ofctl add-flow br0 priority=0,actions=drop | |
1976 | ||
1977 | # Start a monitor listening for packet-ins. | |
1978 | AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile]) | |
1979 | ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080 | |
1980 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
1981 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
1982 | AT_CAPTURE_FILE([monitor.log]) | |
1983 | ||
1984 | # This bundle adds a group, a flow using that group and then a | |
1985 | # packet-out that needs them both. Finally the bundle deletes all | |
1986 | # groups, which also deletes the flow, leaving only the drop flow in | |
1987 | # the table. If this works properly, the packet-out should get | |
1988 | # translated and processed before the flow disappears. Also, if the | |
1989 | # bundle were to fail, the packet-in should not get executed. | |
1990 | AT_DATA([bundle.txt], [dnl | |
1991 | group group_id=1,type=all,bucket=output:controller | |
1992 | flow in_port=6 actions=group:1 | |
1993 | packet-out in_port=6, packet=0001020304050010203040501234 actions=table | |
1994 | group delete | |
1995 | ]) | |
1996 | AT_CHECK([ovs-ofctl bundle br0 bundle.txt]) | |
1997 | ||
1998 | # Verify that only the drop flow remains. | |
1999 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], | |
2000 | [ reset_counts priority=0 actions=drop | |
2001 | OFPST_FLOW reply (OF1.4): | |
2002 | ]) | |
2003 | ||
2004 | # Verify that the packet-in was received via controller action. | |
2005 | AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0], | |
2006 | [OFPT_PACKET_IN (xid=0x0): total_len=14 in_port=6 (via action) data_len=14 (unbuffered) | |
2007 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 | |
2008 | ]) | |
2009 | ||
2010 | OVS_VSWITCHD_STOP | |
2011 | AT_CLEANUP | |
2012 | ||
2013 | AT_SETUP([ofproto - bundle packet-out, failing bundle commit (OpenFlow 1.4)]) | |
2014 | OVS_VSWITCHD_START | |
2015 | ||
2016 | ovs-ofctl del-flows br0 | |
2017 | ovs-ofctl add-flow br0 priority=0,actions=drop | |
2018 | ||
2019 | # Start a monitor listening for packet-ins. | |
2020 | AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile]) | |
2021 | ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080 | |
2022 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
2023 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
2024 | AT_CAPTURE_FILE([monitor.log]) | |
2025 | ||
2026 | # This bundle adds a flow using that group and then a packet-out that | |
2027 | # needs them both. Finally the bundle adds another flow that referes | |
2028 | # to a non-existing group, causing the bundle to fail, and the | |
2029 | # packet-in should not get executed. | |
2030 | AT_DATA([bundle.txt], [dnl | |
2031 | group group_id=1,type=all,bucket=output:controller | |
2032 | flow in_port=6 actions=group:1 | |
2033 | packet-out in_port=6, packet=0001020304050010203040501234 actions=table | |
2034 | flow in_port=7 actions=group:2 | |
2035 | ]) | |
2036 | AT_CHECK([ovs-ofctl bundle br0 bundle.txt 2>&1 | sed '/talking to/,$d'], [], [dnl | |
2037 | Error OFPBAC_BAD_OUT_GROUP for: OFPT_FLOW_MOD (OF1.4) (xid=0x5): ADD in_port=7 actions=group:2 | |
2038 | Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.4) (xid=0x8): | |
2039 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered | |
2040 | ]) | |
2041 | ||
2042 | # Verify that only the drop flow remains. | |
2043 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], | |
2044 | [ reset_counts priority=0 actions=drop | |
2045 | OFPST_FLOW reply (OF1.4): | |
2046 | ]) | |
2047 | ||
2048 | # Verify that the packet-in was NOT received via controller action. | |
2049 | AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0], []) | |
2050 | ||
2051 | OVS_VSWITCHD_STOP | |
2052 | AT_CLEANUP | |
2053 | ||
2054 | AT_SETUP([ofproto - bundle packet-out makes bundle commit to fail(OpenFlow 1.4)]) | |
2055 | OVS_VSWITCHD_START | |
2056 | ||
2057 | ovs-ofctl del-flows br0 | |
2058 | ovs-ofctl add-flow br0 priority=0,actions=drop | |
2059 | ||
2060 | # Start a monitor listening for packet-ins. | |
2061 | AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile]) | |
2062 | ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080 | |
2063 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
2064 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
2065 | AT_CAPTURE_FILE([monitor.log]) | |
2066 | ||
2067 | # This bundle adds a flow using that group and then a packet-out that | |
2068 | # needs them both. Finally the bundle adds another flow that referes | |
2069 | # to a non-existing group, causing the bundle to fail, and the | |
2070 | # packet-in should not get executed. | |
2071 | AT_DATA([bundle.txt], [dnl | |
2072 | group group_id=1,type=all,bucket=output:controller | |
2073 | flow in_port=6 actions=group:1 | |
2074 | packet-out in_port=6, packet=0001020304050010203040501234 actions=table | |
2075 | packet-out in_port=6, packet=0001020304050010203040501234 actions=group:2 | |
2076 | ]) | |
2077 | AT_CHECK([ovs-ofctl bundle br0 bundle.txt 2>&1 | sed '/talking to/,$d'], [], [dnl | |
2078 | Error OFPBAC_BAD_OUT_GROUP for: OFPT_PACKET_OUT (OF1.4) (xid=0x5): in_port=6 actions=group:2 data_len=14 | |
2079 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 | |
2080 | Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.4) (xid=0x8): | |
2081 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered | |
2082 | ]) | |
2083 | ||
2084 | # Verify that only the drop flow remains. | |
2085 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], | |
2086 | [ reset_counts priority=0 actions=drop | |
2087 | OFPST_FLOW reply (OF1.4): | |
2088 | ]) | |
2089 | ||
2090 | # Verify that the packet-in was NOT received via controller action. | |
2091 | AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0], []) | |
2092 | ||
2093 | OVS_VSWITCHD_STOP | |
2094 | AT_CLEANUP | |
2095 | ||
9dcd1c00 | 2096 | AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)]) |
254750ce BP |
2097 | OVS_VSWITCHD_START |
2098 | # Check the default configuration. | |
8811fc0a BP |
2099 | head_table() { |
2100 | printf 'OFPST_TABLE reply (xid=0x2): | |
2101 | table 0 ("%s"): | |
3c1bb396 BP |
2102 | active=0, lookup=0, matched=0 |
2103 | max_entries=1000000 | |
2104 | matching: | |
2105 | in_port: exact match or wildcard | |
2106 | eth_src: exact match or wildcard | |
2107 | eth_dst: exact match or wildcard | |
2108 | eth_type: exact match or wildcard | |
2109 | vlan_vid: exact match or wildcard | |
2110 | vlan_pcp: exact match or wildcard | |
2111 | ip_src: exact match or wildcard | |
2112 | ip_dst: exact match or wildcard | |
2113 | nw_proto: exact match or wildcard | |
2114 | nw_tos: exact match or wildcard | |
2115 | tcp_src: exact match or wildcard | |
2116 | tcp_dst: exact match or wildcard | |
8811fc0a BP |
2117 | |
2118 | ' $1 | |
2119 | } | |
2120 | ditto() { | |
2121 | for i in `seq $1 $2`; do | |
2122 | printf ' table %d ("table%d"): ditto\n' $i $i | |
2123 | done | |
2124 | } | |
2125 | (head_table classifier; ditto 1 253) > expout | |
254750ce BP |
2126 | AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout]) |
2127 | # Change the configuration. | |
2128 | AT_CHECK( | |
2129 | [ovs-vsctl \ | |
2130 | -- --id=@t0 create Flow_Table name=main \ | |
2131 | -- --id=@t1 create Flow_Table flow-limit=1024 \ | |
2132 | -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \ | |
5c6d0628 | 2133 | | ${PERL} $srcdir/uuidfilt.pl], |
254750ce BP |
2134 | [0], [<0> |
2135 | <1> | |
2136 | ]) | |
2137 | # Check that the configuration was updated. | |
8811fc0a BP |
2138 | (head_table main; echo ' table 1 ("table1"): |
2139 | active=0, lookup=0, matched=0 | |
2140 | max_entries=1024 | |
2141 | (same matching) | |
2142 | ||
2143 | table 2 ("table2"): | |
2144 | active=0, lookup=0, matched=0 | |
2145 | max_entries=1000000 | |
2146 | (same matching) | |
2147 | '; ditto 3 253) > expout | |
254750ce BP |
2148 | AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout]) |
2149 | OVS_VSWITCHD_STOP | |
2150 | AT_CLEANUP | |
2151 | ||
3fbbcba7 BP |
2152 | dnl In-band and fail-open add "hidden rules" to table 0. These rules shouldn't |
2153 | dnl be visible to OpenFlow. This test checks that "dump-flows" and | |
2154 | dnl "dump-tables" don't make them visible. | |
2155 | AT_SETUP([ofproto - hidden rules not in table stats]) | |
2156 | # Use an IP address for a controller that won't actually exist: we | |
2157 | # want to create in-band rules but we do not want to actually connect | |
2158 | # to a controller (because that could mess about with our test). The | |
2159 | # Class E range 240.0.0.0 - 255.255.255.255 seems like a good choice. | |
2160 | OVS_VSWITCHD_START([set-controller br0 tcp:240.0.0.1:6653]) | |
2161 | for i in 1 2 3 4 5; do ovs-appctl time/warp 1000; done | |
2162 | ||
2163 | # Check that no hidden flows are visible in OpenFlow. | |
2164 | AT_CHECK([ovs-ofctl dump-flows br0], [0], [NXST_FLOW reply (xid=0x4): | |
2165 | ]) | |
2166 | ||
2167 | # Check that some hidden flows related to 240.0.0.1 are actually in table 0. | |
2168 | # | |
2169 | # We discard flows that mention table_id because we only want table 0 flows, | |
2170 | # which in OVS is implied by the absence of a table_id. | |
2171 | AT_CHECK([ovs-appctl bridge/dump-flows br0], [0], [stdout]) | |
2172 | AT_CHECK([test `grep '240\.0\.0\.1' stdout | grep -v table_id= | wc -l` -gt 0]) | |
2173 | ||
2174 | # Check that dump-tables doesn't count the hidden flows. | |
8811fc0a BP |
2175 | head_table() { |
2176 | printf 'OFPST_TABLE reply (xid=0x2): | |
2177 | table 0 ("%s"): | |
3fbbcba7 BP |
2178 | active=0, lookup=0, matched=0 |
2179 | max_entries=1000000 | |
2180 | matching: | |
2181 | in_port: exact match or wildcard | |
2182 | eth_src: exact match or wildcard | |
2183 | eth_dst: exact match or wildcard | |
2184 | eth_type: exact match or wildcard | |
2185 | vlan_vid: exact match or wildcard | |
2186 | vlan_pcp: exact match or wildcard | |
2187 | ip_src: exact match or wildcard | |
2188 | ip_dst: exact match or wildcard | |
2189 | nw_proto: exact match or wildcard | |
2190 | nw_tos: exact match or wildcard | |
2191 | tcp_src: exact match or wildcard | |
2192 | tcp_dst: exact match or wildcard | |
8811fc0a BP |
2193 | |
2194 | ' $1 | |
2195 | } | |
2196 | ditto() { | |
2197 | for i in `seq $1 $2`; do | |
2198 | printf ' table %d ("table%d"): ditto\n' $i $i | |
2199 | done | |
2200 | } | |
2201 | (head_table classifier; ditto 1 253) > expout | |
3fbbcba7 | 2202 | AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout]) |
74f5c9db | 2203 | OVS_VSWITCHD_STOP(["/240\.0\.0\.1/d"]) |
3fbbcba7 BP |
2204 | AT_CLEANUP |
2205 | ||
9dcd1c00 SH |
2206 | AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)]) |
2207 | OVS_VSWITCHD_START | |
2208 | # Check the default configuration. | |
8811fc0a BP |
2209 | head_table() { |
2210 | printf 'OFPST_TABLE reply (OF1.2) (xid=0x2): | |
2211 | table 0 ("%s"): | |
3c1bb396 BP |
2212 | active=0, lookup=0, matched=0 |
2213 | metadata: match=0xffffffffffffffff write=0xffffffffffffffff | |
2214 | config=controller | |
2215 | max_entries=1000000 | |
2216 | instructions (table miss and others): | |
8811fc0a | 2217 | instructions: apply_actions,clear_actions,write_actions,write_metadata,goto_table |
3c1bb396 BP |
2218 | Write-Actions and Apply-Actions features: |
2219 | 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 | |
f6ecf944 | 2220 | supported on Set-Field: metadata in_port_oxm eth_src eth_dst vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ipv6_label ip_dscp nw_ecn arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst icmp_type icmp_code icmpv6_type icmpv6_code nd_target nd_sll nd_tll |
3c1bb396 BP |
2221 | matching: |
2222 | metadata: exact match or wildcard | |
2223 | in_port_oxm: exact match or wildcard | |
2224 | eth_src: exact match or wildcard | |
2225 | eth_dst: exact match or wildcard | |
2226 | eth_type: exact match or wildcard | |
2227 | vlan_vid: exact match or wildcard | |
2228 | vlan_pcp: exact match or wildcard | |
2229 | mpls_label: exact match or wildcard | |
2230 | mpls_tc: exact match or wildcard | |
2231 | ip_src: exact match or wildcard | |
2232 | ip_dst: exact match or wildcard | |
2233 | ipv6_src: exact match or wildcard | |
2234 | ipv6_dst: exact match or wildcard | |
2235 | ipv6_label: exact match or wildcard | |
2236 | nw_proto: exact match or wildcard | |
2237 | ip_dscp: exact match or wildcard | |
2238 | nw_ecn: exact match or wildcard | |
2239 | arp_op: exact match or wildcard | |
2240 | arp_spa: exact match or wildcard | |
2241 | arp_tpa: exact match or wildcard | |
2242 | arp_sha: exact match or wildcard | |
2243 | arp_tha: exact match or wildcard | |
2244 | tcp_src: exact match or wildcard | |
2245 | tcp_dst: exact match or wildcard | |
2246 | udp_src: exact match or wildcard | |
2247 | udp_dst: exact match or wildcard | |
2248 | sctp_src: exact match or wildcard | |
2249 | sctp_dst: exact match or wildcard | |
2250 | icmp_type: exact match or wildcard | |
2251 | icmp_code: exact match or wildcard | |
2252 | icmpv6_type: exact match or wildcard | |
2253 | icmpv6_code: exact match or wildcard | |
2254 | nd_target: exact match or wildcard | |
2255 | nd_sll: exact match or wildcard | |
8811fc0a BP |
2256 | nd_tll: exact match or wildcard |
2257 | ||
2258 | ' $1 | |
2259 | } | |
2260 | ditto() { | |
2261 | for i in `seq $1 $2`; do | |
2262 | printf ' table %d ("table%d"): ditto\n' $i $i | |
2263 | done | |
2264 | } | |
2265 | tail_table() { | |
2266 | printf ' table 253 ("table253"): | |
2267 | active=0, lookup=0, matched=0 | |
2268 | metadata: match=0xffffffffffffffff write=0xffffffffffffffff | |
2269 | config=controller | |
2270 | max_entries=1000000 | |
2271 | instructions (table miss and others): | |
2272 | instructions: apply_actions,clear_actions,write_actions,write_metadata | |
2273 | (same actions) | |
2274 | (same matching) | |
2275 | ' | |
2276 | } | |
2277 | (head_table classifier; ditto 1 252; tail_table) > expout | |
9dcd1c00 SH |
2278 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout]) |
2279 | # Change the configuration. | |
2280 | AT_CHECK( | |
2281 | [ovs-vsctl \ | |
2282 | -- --id=@t0 create Flow_Table name=main \ | |
2283 | -- --id=@t1 create Flow_Table flow-limit=1024 \ | |
2284 | -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \ | |
5c6d0628 | 2285 | | ${PERL} $srcdir/uuidfilt.pl], |
9dcd1c00 SH |
2286 | [0], [<0> |
2287 | <1> | |
2288 | ]) | |
2289 | # Check that the configuration was updated. | |
8811fc0a BP |
2290 | (head_table main; echo ' table 1 ("table1"): |
2291 | active=0, lookup=0, matched=0 | |
2292 | metadata: match=0xffffffffffffffff write=0xffffffffffffffff | |
2293 | config=controller | |
2294 | max_entries=1024 | |
2295 | (same instructions) | |
2296 | (same matching) | |
2297 | ||
2298 | table 2 ("table2"): | |
2299 | active=0, lookup=0, matched=0 | |
2300 | metadata: match=0xffffffffffffffff write=0xffffffffffffffff | |
2301 | config=controller | |
2302 | max_entries=1000000 | |
2303 | (same instructions) | |
2304 | (same matching) | |
2305 | '; ditto 3 252; tail_table) > expout | |
9dcd1c00 SH |
2306 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout]) |
2307 | OVS_VSWITCHD_STOP | |
2308 | AT_CLEANUP | |
2309 | ||
3c4e10fb BP |
2310 | AT_SETUP([ofproto - table features (OpenFlow 1.3)]) |
2311 | OVS_VSWITCHD_START | |
8811fc0a BP |
2312 | head_table () { |
2313 | printf ' table 0 ("%s"): | |
3c4e10fb BP |
2314 | metadata: match=0xffffffffffffffff write=0xffffffffffffffff |
2315 | max_entries=1000000 | |
8811fc0a BP |
2316 | instructions (table miss and others): |
2317 | next tables: 1-253 | |
2318 | instructions: meter,apply_actions,clear_actions,write_actions,write_metadata,goto_table | |
3c4e10fb BP |
2319 | Write-Actions and Apply-Actions features: |
2320 | 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 | |
7dad8e9a | 2321 | supported on Set-Field: tun_id tun_src tun_dst tun_ipv6_src tun_ipv6_dst tun_flags tun_gbp_id tun_gbp_flags tun_metadata0 dnl |
a07eb11f | 2322 | tun_metadata1 tun_metadata2 tun_metadata3 tun_metadata4 tun_metadata5 tun_metadata6 tun_metadata7 tun_metadata8 tun_metadata9 tun_metadata10 tun_metadata11 tun_metadata12 tun_metadata13 tun_metadata14 tun_metadata15 tun_metadata16 tun_metadata17 tun_metadata18 tun_metadata19 tun_metadata20 tun_metadata21 tun_metadata22 tun_metadata23 tun_metadata24 tun_metadata25 tun_metadata26 tun_metadata27 tun_metadata28 tun_metadata29 tun_metadata30 tun_metadata31 tun_metadata32 tun_metadata33 tun_metadata34 tun_metadata35 tun_metadata36 tun_metadata37 tun_metadata38 tun_metadata39 tun_metadata40 tun_metadata41 tun_metadata42 tun_metadata43 tun_metadata44 tun_metadata45 tun_metadata46 tun_metadata47 tun_metadata48 tun_metadata49 tun_metadata50 tun_metadata51 tun_metadata52 tun_metadata53 tun_metadata54 tun_metadata55 tun_metadata56 tun_metadata57 tun_metadata58 tun_metadata59 tun_metadata60 tun_metadata61 tun_metadata62 tun_metadata63 dnl |
b23ada8e | 2323 | metadata in_port in_port_oxm pkt_mark ct_mark ct_label reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 reg9 reg10 reg11 reg12 reg13 reg14 reg15 xreg0 xreg1 xreg2 xreg3 xreg4 xreg5 xreg6 xreg7 xxreg0 xxreg1 xxreg2 xxreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc mpls_ttl ip_src ip_dst ipv6_src ipv6_dst ipv6_label nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst icmp_type icmp_code icmpv6_type icmpv6_code nd_target nd_sll nd_tll |
3c4e10fb BP |
2324 | matching: |
2325 | dp_hash: arbitrary mask | |
2326 | recirc_id: exact match or wildcard | |
18080541 | 2327 | conj_id: exact match or wildcard |
3c4e10fb BP |
2328 | tun_id: arbitrary mask |
2329 | tun_src: arbitrary mask | |
2330 | tun_dst: arbitrary mask | |
7dad8e9a TLSC |
2331 | tun_ipv6_src: arbitrary mask |
2332 | tun_ipv6_dst: arbitrary mask | |
b666962b | 2333 | tun_flags: arbitrary mask |
ac6073e3 MC |
2334 | tun_gbp_id: arbitrary mask |
2335 | tun_gbp_flags: arbitrary mask | |
9558d2a5 JG |
2336 | tun_metadata0: arbitrary mask |
2337 | tun_metadata1: arbitrary mask | |
2338 | tun_metadata2: arbitrary mask | |
2339 | tun_metadata3: arbitrary mask | |
2340 | tun_metadata4: arbitrary mask | |
2341 | tun_metadata5: arbitrary mask | |
2342 | tun_metadata6: arbitrary mask | |
2343 | tun_metadata7: arbitrary mask | |
2344 | tun_metadata8: arbitrary mask | |
2345 | tun_metadata9: arbitrary mask | |
2346 | tun_metadata10: arbitrary mask | |
2347 | tun_metadata11: arbitrary mask | |
2348 | tun_metadata12: arbitrary mask | |
2349 | tun_metadata13: arbitrary mask | |
2350 | tun_metadata14: arbitrary mask | |
2351 | tun_metadata15: arbitrary mask | |
2352 | tun_metadata16: arbitrary mask | |
2353 | tun_metadata17: arbitrary mask | |
2354 | tun_metadata18: arbitrary mask | |
2355 | tun_metadata19: arbitrary mask | |
2356 | tun_metadata20: arbitrary mask | |
2357 | tun_metadata21: arbitrary mask | |
2358 | tun_metadata22: arbitrary mask | |
2359 | tun_metadata23: arbitrary mask | |
2360 | tun_metadata24: arbitrary mask | |
2361 | tun_metadata25: arbitrary mask | |
2362 | tun_metadata26: arbitrary mask | |
2363 | tun_metadata27: arbitrary mask | |
2364 | tun_metadata28: arbitrary mask | |
2365 | tun_metadata29: arbitrary mask | |
2366 | tun_metadata30: arbitrary mask | |
2367 | tun_metadata31: arbitrary mask | |
2368 | tun_metadata32: arbitrary mask | |
2369 | tun_metadata33: arbitrary mask | |
2370 | tun_metadata34: arbitrary mask | |
2371 | tun_metadata35: arbitrary mask | |
2372 | tun_metadata36: arbitrary mask | |
2373 | tun_metadata37: arbitrary mask | |
2374 | tun_metadata38: arbitrary mask | |
2375 | tun_metadata39: arbitrary mask | |
2376 | tun_metadata40: arbitrary mask | |
2377 | tun_metadata41: arbitrary mask | |
2378 | tun_metadata42: arbitrary mask | |
2379 | tun_metadata43: arbitrary mask | |
2380 | tun_metadata44: arbitrary mask | |
2381 | tun_metadata45: arbitrary mask | |
2382 | tun_metadata46: arbitrary mask | |
2383 | tun_metadata47: arbitrary mask | |
2384 | tun_metadata48: arbitrary mask | |
2385 | tun_metadata49: arbitrary mask | |
2386 | tun_metadata50: arbitrary mask | |
2387 | tun_metadata51: arbitrary mask | |
2388 | tun_metadata52: arbitrary mask | |
2389 | tun_metadata53: arbitrary mask | |
2390 | tun_metadata54: arbitrary mask | |
2391 | tun_metadata55: arbitrary mask | |
2392 | tun_metadata56: arbitrary mask | |
2393 | tun_metadata57: arbitrary mask | |
2394 | tun_metadata58: arbitrary mask | |
2395 | tun_metadata59: arbitrary mask | |
2396 | tun_metadata60: arbitrary mask | |
2397 | tun_metadata61: arbitrary mask | |
2398 | tun_metadata62: arbitrary mask | |
2399 | tun_metadata63: arbitrary mask | |
3c4e10fb BP |
2400 | metadata: arbitrary mask |
2401 | in_port: exact match or wildcard | |
2402 | in_port_oxm: exact match or wildcard | |
c61f3870 | 2403 | actset_output: exact match or wildcard |
3c4e10fb | 2404 | pkt_mark: arbitrary mask |
07659514 JS |
2405 | ct_state: arbitrary mask |
2406 | ct_zone: exact match or wildcard | |
8e53fe8c | 2407 | ct_mark: arbitrary mask |
9daf2348 | 2408 | ct_label: arbitrary mask |
3c4e10fb BP |
2409 | reg0: arbitrary mask |
2410 | reg1: arbitrary mask | |
2411 | reg2: arbitrary mask | |
2412 | reg3: arbitrary mask | |
2413 | reg4: arbitrary mask | |
2414 | reg5: arbitrary mask | |
2415 | reg6: arbitrary mask | |
2416 | reg7: arbitrary mask | |
847b8b02 JP |
2417 | reg8: arbitrary mask |
2418 | reg9: arbitrary mask | |
2419 | reg10: arbitrary mask | |
2420 | reg11: arbitrary mask | |
2421 | reg12: arbitrary mask | |
2422 | reg13: arbitrary mask | |
2423 | reg14: arbitrary mask | |
2424 | reg15: arbitrary mask | |
3c4e10fb BP |
2425 | xreg0: arbitrary mask |
2426 | xreg1: arbitrary mask | |
2427 | xreg2: arbitrary mask | |
2428 | xreg3: arbitrary mask | |
847b8b02 JP |
2429 | xreg4: arbitrary mask |
2430 | xreg5: arbitrary mask | |
2431 | xreg6: arbitrary mask | |
2432 | xreg7: arbitrary mask | |
b23ada8e JP |
2433 | xxreg0: arbitrary mask |
2434 | xxreg1: arbitrary mask | |
2435 | xxreg2: arbitrary mask | |
2436 | xxreg3: arbitrary mask | |
3c4e10fb BP |
2437 | eth_src: arbitrary mask |
2438 | eth_dst: arbitrary mask | |
2439 | eth_type: exact match or wildcard | |
2440 | vlan_tci: arbitrary mask | |
2441 | vlan_vid: arbitrary mask | |
2442 | vlan_pcp: exact match or wildcard | |
2443 | mpls_label: exact match or wildcard | |
2444 | mpls_tc: exact match or wildcard | |
2445 | mpls_bos: exact match or wildcard | |
bef3f465 | 2446 | mpls_ttl: exact match or wildcard |
3c4e10fb BP |
2447 | ip_src: arbitrary mask |
2448 | ip_dst: arbitrary mask | |
2449 | ipv6_src: arbitrary mask | |
2450 | ipv6_dst: arbitrary mask | |
2451 | ipv6_label: arbitrary mask | |
2452 | nw_proto: exact match or wildcard | |
2453 | nw_tos: exact match or wildcard | |
2454 | ip_dscp: exact match or wildcard | |
2455 | nw_ecn: exact match or wildcard | |
2456 | nw_ttl: exact match or wildcard | |
2457 | ip_frag: arbitrary mask | |
2458 | arp_op: exact match or wildcard | |
2459 | arp_spa: arbitrary mask | |
2460 | arp_tpa: arbitrary mask | |
2461 | arp_sha: arbitrary mask | |
2462 | arp_tha: arbitrary mask | |
2463 | tcp_src: arbitrary mask | |
2464 | tcp_dst: arbitrary mask | |
2465 | tcp_flags: arbitrary mask | |
2466 | udp_src: arbitrary mask | |
2467 | udp_dst: arbitrary mask | |
2468 | sctp_src: arbitrary mask | |
2469 | sctp_dst: arbitrary mask | |
2470 | icmp_type: exact match or wildcard | |
2471 | icmp_code: exact match or wildcard | |
2472 | icmpv6_type: exact match or wildcard | |
2473 | icmpv6_code: exact match or wildcard | |
2474 | nd_target: arbitrary mask | |
2475 | nd_sll: arbitrary mask | |
8811fc0a BP |
2476 | nd_tll: arbitrary mask |
2477 | ||
2478 | ' $1 | |
2479 | } | |
2480 | ditto() { | |
2481 | printf ' table %d ("%s"): | |
2482 | metadata: match=0xffffffffffffffff write=0xffffffffffffffff | |
2483 | max_entries=%d | |
2484 | instructions (table miss and others): | |
2485 | next tables: %d-253 | |
2486 | (same instructions) | |
2487 | (same actions) | |
2488 | (same matching) | |
2489 | ||
2490 | ' $1 $2 $3 `expr $1 + 1` | |
2491 | } | |
2492 | tail_tables() { | |
2493 | echo ' table 252 ("table252"): | |
2494 | metadata: match=0xffffffffffffffff write=0xffffffffffffffff | |
2495 | max_entries=1000000 | |
2496 | instructions (table miss and others): | |
2497 | next tables: 253 | |
2498 | (same instructions) | |
2499 | (same actions) | |
2500 | (same matching) | |
2501 | ||
2502 | table 253 ("table253"): | |
2503 | metadata: match=0xffffffffffffffff write=0xffffffffffffffff | |
2504 | max_entries=1000000 | |
2505 | instructions (table miss and others): | |
2506 | instructions: meter,apply_actions,clear_actions,write_actions,write_metadata | |
2507 | (same actions) | |
2508 | (same matching) | |
2509 | ' | |
2510 | } | |
2511 | (head_table classifier | |
2512 | for i in `seq 1 251`; do | |
2513 | ditto $i table$i 1000000 | |
2514 | done | |
2515 | tail_tables) > expout | |
2516 | AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout]) | |
3c4e10fb BP |
2517 | # Change the configuration. |
2518 | AT_CHECK( | |
2519 | [ovs-vsctl \ | |
2520 | -- --id=@t0 create Flow_Table name=main \ | |
2521 | -- --id=@t1 create Flow_Table flow-limit=1024 \ | |
2522 | -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \ | |
2523 | | ${PERL} $srcdir/uuidfilt.pl], | |
2524 | [0], [<0> | |
2525 | <1> | |
2526 | ]) | |
2527 | # Check that the configuration was updated. | |
8811fc0a BP |
2528 | (head_table main |
2529 | ditto 1 table1 1024 | |
2530 | for i in `seq 2 251`; do | |
2531 | ditto $i table$i 1000000 | |
2532 | done | |
2533 | tail_tables) > expout | |
2534 | AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout]) | |
3c4e10fb BP |
2535 | OVS_VSWITCHD_STOP |
2536 | AT_CLEANUP | |
2537 | ||
03c72922 BP |
2538 | AT_SETUP([ofproto - table description (OpenFlow 1.4)]) |
2539 | OVS_VSWITCHD_START | |
2540 | (x=0 | |
2541 | while test $x -lt 254; do | |
2542 | y=`expr $x + 1` | |
2543 | echo " table $x: | |
bab86012 SJ |
2544 | eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME |
2545 | vacancy=off" | |
03c72922 BP |
2546 | x=$y |
2547 | done) > expout | |
2548 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d | |
2549 | /^OFPST_TABLE_DESC/d'], [0], [expout]) | |
2550 | ||
2551 | # Change the configuration. | |
2552 | AT_CHECK([ovs-ofctl -O Openflow14 mod-table br0 0 evict]) | |
2553 | # Check that the configuration was updated. | |
2554 | mv expout orig-expout | |
2555 | sed -e '2s/eviction=off/eviction=on/' <orig-expout > expout | |
2556 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d | |
2557 | /^OFPST_TABLE_DESC/d'], [0], [expout]) | |
de7d3c07 SJ |
2558 | |
2559 | AT_CHECK([ovs-ofctl -O Openflow14 mod-table br0 0 vacancy:20,80]) | |
2560 | # Check that the configuration was updated. | |
2561 | mv expout orig-expout | |
6c6eedc5 | 2562 | sed -e '3s/vacancy=off/vacancy=on vacancy_down=20% vacancy_up=80% vacancy=100%/' <orig-expout > expout |
de7d3c07 SJ |
2563 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-table-desc br0 | sed '/^$/d |
2564 | /^OFPST_TABLE_DESC/d'], [0], [expout]) | |
03c72922 BP |
2565 | OVS_VSWITCHD_STOP |
2566 | AT_CLEANUP | |
2567 | ||
06f64d03 | 2568 | AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)]) |
254750ce BP |
2569 | OVS_VSWITCHD_START |
2570 | # Configure a maximum of 4 flows. | |
2571 | AT_CHECK( | |
2572 | [ovs-vsctl \ | |
2573 | -- --id=@t0 create Flow_Table flow-limit=4 \ | |
2574 | -- set bridge br0 flow_tables:0=@t0 \ | |
5c6d0628 | 2575 | | ${PERL} $srcdir/uuidfilt.pl], |
254750ce BP |
2576 | [0], [<0> |
2577 | ]) | |
2578 | # Add 4 flows. | |
2579 | for in_port in 1 2 3 4; do | |
2580 | ovs-ofctl add-flow br0 in_port=$in_port,actions=drop | |
2581 | done | |
2582 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2583 | in_port=1 actions=drop | |
2584 | in_port=2 actions=drop | |
2585 | in_port=3 actions=drop | |
2586 | in_port=4 actions=drop | |
2587 | NXST_FLOW reply: | |
2588 | ]) | |
2589 | # Adding another flow will be refused. | |
2590 | AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr]) | |
27527aa0 | 2591 | AT_CHECK([head -n 1 stderr | ofctl_strip], [0], |
be2b69d1 | 2592 | [OFPT_ERROR: OFPFMFC_TABLE_FULL |
254750ce BP |
2593 | ]) |
2594 | # Also a mod-flow that would add a flow will be refused. | |
2595 | AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr]) | |
27527aa0 | 2596 | AT_CHECK([head -n 1 stderr | ofctl_strip], [0], |
be2b69d1 | 2597 | [OFPT_ERROR: OFPFMFC_TABLE_FULL |
254750ce BP |
2598 | ]) |
2599 | # Replacing or modifying an existing flow is allowed. | |
2600 | AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal]) | |
2601 | AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1]) | |
2602 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2603 | in_port=1 actions=drop | |
2604 | in_port=2 actions=drop | |
2605 | in_port=3 actions=output:1 | |
2606 | in_port=4 actions=NORMAL | |
2607 | NXST_FLOW reply: | |
2608 | ]) | |
2609 | OVS_VSWITCHD_STOP | |
2610 | AT_CLEANUP | |
2611 | ||
06f64d03 | 2612 | AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)]) |
9dcd1c00 SH |
2613 | OVS_VSWITCHD_START |
2614 | # Configure a maximum of 4 flows. | |
2615 | AT_CHECK( | |
2616 | [ovs-vsctl \ | |
2617 | -- --id=@t0 create Flow_Table flow-limit=4 \ | |
2618 | -- set bridge br0 flow_tables:0=@t0 \ | |
5c6d0628 | 2619 | | ${PERL} $srcdir/uuidfilt.pl], |
9dcd1c00 SH |
2620 | [0], [<0> |
2621 | ]) | |
2622 | # Add 4 flows. | |
2623 | for in_port in 1 2 3 4; do | |
2624 | ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop | |
2625 | done | |
2626 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2627 | in_port=1 actions=drop | |
2628 | in_port=2 actions=drop | |
2629 | in_port=3 actions=drop | |
2630 | in_port=4 actions=drop | |
2631 | OFPST_FLOW reply (OF1.2): | |
2632 | ]) | |
2633 | # Adding another flow will be refused. | |
2634 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr]) | |
2635 | AT_CHECK([head -n 1 stderr | ofctl_strip], [0], | |
2636 | [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL | |
2637 | ]) | |
2638 | # Replacing or modifying an existing flow is allowed. | |
2639 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal]) | |
2640 | AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1]) | |
2641 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2642 | in_port=1 actions=drop | |
2643 | in_port=2 actions=drop | |
2644 | in_port=3 actions=output:1 | |
2645 | in_port=4 actions=NORMAL | |
2646 | OFPST_FLOW reply (OF1.2): | |
2647 | ]) | |
2648 | OVS_VSWITCHD_STOP | |
2649 | AT_CLEANUP | |
2650 | ||
2651 | AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)]) | |
254750ce BP |
2652 | OVS_VSWITCHD_START |
2653 | # Configure a maximum of 4 flows. | |
2654 | AT_CHECK( | |
2655 | [ovs-vsctl \ | |
2656 | -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \ | |
2657 | -- set bridge br0 flow_tables:0=@t0 \ | |
5c6d0628 | 2658 | | ${PERL} $srcdir/uuidfilt.pl], |
254750ce BP |
2659 | [0], [<0> |
2660 | ]) | |
2661 | # Add 4 flows. | |
2662 | for in_port in 4 3 2 1; do | |
2663 | ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop | |
2664 | done | |
2665 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
b9718b7b BP |
2666 | idle_timeout=10, in_port=1 actions=drop |
2667 | idle_timeout=20, in_port=2 actions=drop | |
2668 | idle_timeout=30, in_port=3 actions=drop | |
2669 | idle_timeout=40, in_port=4 actions=drop | |
254750ce BP |
2670 | NXST_FLOW reply: |
2671 | ]) | |
2672 | # Adding another flow will cause the one that expires soonest to be evicted. | |
2673 | AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop]) | |
2674 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
b9718b7b BP |
2675 | idle_timeout=20, in_port=2 actions=drop |
2676 | idle_timeout=30, in_port=3 actions=drop | |
2677 | idle_timeout=40, in_port=4 actions=drop | |
254750ce BP |
2678 | in_port=5 actions=drop |
2679 | NXST_FLOW reply: | |
2680 | ]) | |
2681 | # A mod-flow that adds a flow also causes eviction, but replacing or | |
2682 | # modifying an existing flow doesn't. | |
2683 | AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop]) | |
2684 | AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal]) | |
2685 | AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1]) | |
2686 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
b9718b7b | 2687 | idle_timeout=30, in_port=3 actions=output:1 |
254750ce BP |
2688 | in_port=4 actions=NORMAL |
2689 | in_port=5 actions=drop | |
2690 | in_port=6 actions=drop | |
2691 | NXST_FLOW reply: | |
2692 | ]) | |
2693 | # Flows with no timeouts at all cannot be evicted. | |
2694 | AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal]) | |
2695 | AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr]) | |
27527aa0 | 2696 | AT_CHECK([head -n 1 stderr | ofctl_strip], [0], |
be2b69d1 | 2697 | [OFPT_ERROR: OFPFMFC_TABLE_FULL |
254750ce BP |
2698 | ]) |
2699 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2700 | in_port=4 actions=NORMAL | |
2701 | in_port=5 actions=drop | |
2702 | in_port=6 actions=drop | |
2703 | in_port=7 actions=NORMAL | |
2704 | NXST_FLOW reply: | |
2705 | ]) | |
2706 | OVS_VSWITCHD_STOP | |
2707 | AT_CLEANUP | |
2708 | ||
9dcd1c00 SH |
2709 | AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)]) |
2710 | OVS_VSWITCHD_START | |
2711 | # Configure a maximum of 4 flows. | |
2712 | AT_CHECK( | |
2713 | [ovs-vsctl \ | |
2714 | -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \ | |
2715 | -- set bridge br0 flow_tables:0=@t0 \ | |
5c6d0628 | 2716 | | ${PERL} $srcdir/uuidfilt.pl], |
9dcd1c00 SH |
2717 | [0], [<0> |
2718 | ]) | |
2719 | # Add 4 flows. | |
2720 | for in_port in 4 3 2 1; do | |
2721 | ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop | |
2722 | done | |
2723 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2724 | idle_timeout=10, in_port=1 actions=drop | |
2725 | idle_timeout=20, in_port=2 actions=drop | |
2726 | idle_timeout=30, in_port=3 actions=drop | |
2727 | idle_timeout=40, in_port=4 actions=drop | |
2728 | OFPST_FLOW reply (OF1.2): | |
2729 | ]) | |
2730 | # Adding another flow will cause the one that expires soonest to be evicted. | |
2731 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop]) | |
2732 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2733 | idle_timeout=20, in_port=2 actions=drop | |
2734 | idle_timeout=30, in_port=3 actions=drop | |
2735 | idle_timeout=40, in_port=4 actions=drop | |
2736 | in_port=5 actions=drop | |
2737 | OFPST_FLOW reply (OF1.2): | |
2738 | ]) | |
0746a84f | 2739 | # In OpenFlow 1.2 a mod-flow does not ever add a flow and thus |
9dcd1c00 SH |
2740 | # has no effect on eviction |
2741 | AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop]) | |
2742 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal]) | |
2743 | AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1]) | |
2744 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2745 | idle_timeout=20, in_port=2 actions=drop | |
2746 | idle_timeout=30, in_port=3 actions=output:1 | |
2747 | in_port=4 actions=NORMAL | |
2748 | in_port=5 actions=drop | |
2749 | OFPST_FLOW reply (OF1.2): | |
2750 | ]) | |
2751 | # Flows with no timeouts at all cannot be evicted. | |
2752 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop]) | |
2753 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal]) | |
2754 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr]) | |
2755 | AT_CHECK([head -n 1 stderr | ofctl_strip], [0], | |
2756 | [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL | |
2757 | ]) | |
2758 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2759 | in_port=4 actions=NORMAL | |
2760 | in_port=5 actions=drop | |
2761 | in_port=6 actions=drop | |
2762 | in_port=7 actions=NORMAL | |
2763 | OFPST_FLOW reply (OF1.2): | |
2764 | ]) | |
2765 | OVS_VSWITCHD_STOP | |
2766 | AT_CLEANUP | |
2767 | ||
f70b94de BP |
2768 | AT_SETUP([ofproto - eviction using importance upon table overflow (OpenFlow 1.4)]) |
2769 | OVS_VSWITCHD_START | |
2770 | # Configure a maximum of 4 flows. | |
2771 | AT_CHECK( | |
2772 | [ovs-vsctl \ | |
82c22d34 | 2773 | -- --id=@t0 create Flow_Table name=evict flow-limit=4 \ |
f70b94de BP |
2774 | -- set bridge br0 flow_tables:0=@t0 \ |
2775 | | ${PERL} $srcdir/uuidfilt.pl], | |
2776 | [0], [<0> | |
2777 | ]) | |
82c22d34 BP |
2778 | # Use mod-table to turn on eviction just to demonstrate that it works. |
2779 | AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 evict]) | |
f70b94de BP |
2780 | # Add 4 flows. |
2781 | for in_port in 4 3 2 1; do | |
2782 | ovs-ofctl -O Openflow14 add-flow br0 importance=$((in_port + 30)),priority=$((in_port + 5)),hard_timeout=$((in_port + 500)),actions=drop | |
2783 | done | |
2784 | AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2785 | hard_timeout=501, importance=31, priority=6 actions=drop | |
2786 | hard_timeout=502, importance=32, priority=7 actions=drop | |
2787 | hard_timeout=503, importance=33, priority=8 actions=drop | |
2788 | hard_timeout=504, importance=34, priority=9 actions=drop | |
2789 | OFPST_FLOW reply (OF1.4): | |
2790 | ]) | |
2791 | # Adding another flow will cause the one with lowest importance to be evicted. | |
2792 | AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=505,importance=35,priority=10,in_port=2,actions=drop]) | |
2793 | AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2794 | hard_timeout=502, importance=32, priority=7 actions=drop | |
2795 | hard_timeout=503, importance=33, priority=8 actions=drop | |
2796 | hard_timeout=504, importance=34, priority=9 actions=drop | |
2797 | hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop | |
2798 | OFPST_FLOW reply (OF1.4): | |
2799 | ]) | |
2800 | # Disable the Eviction configuration. | |
82c22d34 | 2801 | AT_CHECK([ovs-ofctl -O OpenFlow14 mod-table br0 0 noevict]) |
f70b94de BP |
2802 | # Adding another flow will cause the system to give error for FULL TABLE. |
2803 | AT_CHECK([ovs-ofctl -O Openflow14 add-flow br0 hard_timeout=506,importance=36,priority=11,actions=drop],[1], [], [stderr]) | |
2804 | AT_CHECK([head -n 1 stderr | ofctl_strip], [0], | |
2805 | [OFPT_ERROR (OF1.4): OFPFMFC_TABLE_FULL | |
2806 | ]) | |
2807 | #Dump flows. It should show only the old values | |
2808 | AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2809 | hard_timeout=502, importance=32, priority=7 actions=drop | |
2810 | hard_timeout=503, importance=33, priority=8 actions=drop | |
2811 | hard_timeout=504, importance=34, priority=9 actions=drop | |
2812 | hard_timeout=505, importance=35, priority=10,in_port=2 actions=drop | |
2813 | OFPST_FLOW reply (OF1.4): | |
2814 | ]) | |
2815 | # mod-flow that would modify a flow will be done successfully. | |
2816 | AT_CHECK([ovs-ofctl -O Openflow14 mod-flows br0 in_port=2,actions=NORMAL]) | |
2817 | AT_CHECK([ovs-ofctl -O Openflow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2818 | hard_timeout=502, importance=32, priority=7 actions=drop | |
2819 | hard_timeout=503, importance=33, priority=8 actions=drop | |
2820 | hard_timeout=504, importance=34, priority=9 actions=drop | |
2821 | hard_timeout=505, importance=35, priority=10,in_port=2 actions=NORMAL | |
2822 | OFPST_FLOW reply (OF1.4): | |
2823 | ]) | |
2824 | # Also a mod-flow that would add a flow will be refused. | |
2825 | AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr]) | |
2826 | AT_CHECK([head -n 1 stderr | ofctl_strip], [0], | |
2827 | [OFPT_ERROR: OFPFMFC_TABLE_FULL | |
2828 | ]) | |
2829 | OVS_VSWITCHD_STOP | |
2830 | AT_CLEANUP | |
2831 | ||
9dcd1c00 | 2832 | AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)]) |
254750ce BP |
2833 | OVS_VSWITCHD_START |
2834 | # Configure a maximum of 4 flows. | |
2835 | AT_CHECK( | |
2836 | [ovs-vsctl \ | |
2837 | -- --id=@t0 create Flow_Table name=evict flow-limit=4 \ | |
2838 | overflow-policy=evict \ | |
2839 | groups='"NXM_OF_IN_PORT[[]]"' \ | |
2840 | -- set bridge br0 flow_tables:0=@t0 \ | |
5c6d0628 | 2841 | | ${PERL} $srcdir/uuidfilt.pl], |
254750ce BP |
2842 | [0], [<0> |
2843 | ]) | |
2844 | # Add 4 flows. | |
2845 | ovs-ofctl add-flows br0 - <<EOF | |
2846 | idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop | |
2847 | idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop | |
2848 | idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop | |
2849 | idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop | |
2850 | EOF | |
2851 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
b9718b7b BP |
2852 | idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop |
2853 | idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop | |
2854 | idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop | |
2855 | idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop | |
254750ce BP |
2856 | NXST_FLOW reply: |
2857 | ]) | |
2858 | # Adding another flow will cause the one that expires soonest within | |
2859 | # the largest group (those with in_port=1) to be evicted. In this | |
2860 | # case this is not the same as the one that expires soonest overall | |
2861 | # (which is what makes the test interesting): | |
2862 | AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop]) | |
2863 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
b9718b7b BP |
2864 | idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop |
2865 | idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop | |
2866 | idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop | |
254750ce BP |
2867 | in_port=2,dl_src=00:55:66:77:88:99 actions=drop |
2868 | NXST_FLOW reply: | |
2869 | ]) | |
2870 | # Enlarge the flow limit, change the eviction policy back to strictly | |
2871 | # based on expiration, and and add some flows. | |
2872 | AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7]) | |
2873 | ovs-ofctl add-flows br0 - <<EOF | |
2874 | idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop | |
2875 | idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop | |
2876 | idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop | |
2877 | EOF | |
2878 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
b9718b7b BP |
2879 | idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop |
2880 | idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop | |
2881 | idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop | |
2882 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
2883 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop | |
2884 | idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop | |
254750ce BP |
2885 | in_port=2,dl_src=00:55:66:77:88:99 actions=drop |
2886 | NXST_FLOW reply: | |
2887 | ]) | |
2888 | # Adding another flow will cause the one that expires soonest overall | |
2889 | # to be evicted. | |
2890 | AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop']) | |
2891 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
b9718b7b BP |
2892 | idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop |
2893 | idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop | |
2894 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
2895 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop | |
2896 | idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop | |
2897 | idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop | |
254750ce BP |
2898 | in_port=2,dl_src=00:55:66:77:88:99 actions=drop |
2899 | NXST_FLOW reply: | |
2900 | ]) | |
2901 | # Reducing the flow limit also causes the flows that expire soonest | |
2902 | # overall to be evicted. | |
2903 | AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4]) | |
2904 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
b9718b7b BP |
2905 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop |
2906 | idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop | |
2907 | idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop | |
254750ce BP |
2908 | in_port=2,dl_src=00:55:66:77:88:99 actions=drop |
2909 | NXST_FLOW reply: | |
2910 | ]) | |
2911 | OVS_VSWITCHD_STOP | |
2912 | AT_CLEANUP | |
80d5aefd | 2913 | |
9dcd1c00 SH |
2914 | AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)]) |
2915 | OVS_VSWITCHD_START | |
2916 | # Configure a maximum of 4 flows. | |
2917 | AT_CHECK( | |
2918 | [ovs-vsctl \ | |
2919 | -- --id=@t0 create Flow_Table name=evict flow-limit=4 \ | |
2920 | overflow-policy=evict \ | |
2921 | groups='"NXM_OF_IN_PORT[[]]"' \ | |
2922 | -- set bridge br0 flow_tables:0=@t0 \ | |
5c6d0628 | 2923 | | ${PERL} $srcdir/uuidfilt.pl], |
9dcd1c00 SH |
2924 | [0], [<0> |
2925 | ]) | |
2926 | # Add 4 flows. | |
2927 | ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF | |
2928 | idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop | |
2929 | idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop | |
2930 | idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop | |
2931 | idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop | |
2932 | EOF | |
2933 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2934 | idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop | |
2935 | idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop | |
2936 | idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop | |
2937 | idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop | |
2938 | OFPST_FLOW reply (OF1.2): | |
2939 | ]) | |
2940 | # Adding another flow will cause the one that expires soonest within | |
2941 | # the largest group (those with in_port=1) to be evicted. In this | |
2942 | # case this is not the same as the one that expires soonest overall | |
2943 | # (which is what makes the test interesting): | |
2944 | AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop]) | |
2945 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2946 | idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop | |
2947 | idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop | |
2948 | idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop | |
2949 | in_port=2,dl_src=00:55:66:77:88:99 actions=drop | |
2950 | OFPST_FLOW reply (OF1.2): | |
2951 | ]) | |
2952 | # Enlarge the flow limit, change the eviction policy back to strictly | |
2953 | # based on expiration, and and add some flows. | |
2954 | AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7]) | |
2955 | ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF | |
2956 | idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop | |
2957 | idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop | |
2958 | idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop | |
2959 | EOF | |
2960 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2961 | idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop | |
2962 | idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop | |
2963 | idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop | |
2964 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
2965 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop | |
2966 | idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop | |
2967 | in_port=2,dl_src=00:55:66:77:88:99 actions=drop | |
2968 | OFPST_FLOW reply (OF1.2): | |
2969 | ]) | |
2970 | # Adding another flow will cause the one that expires soonest overall | |
2971 | # to be evicted. | |
2972 | 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']) | |
2973 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2974 | idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop | |
2975 | idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop | |
2976 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
2977 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop | |
2978 | idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop | |
2979 | idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop | |
2980 | in_port=2,dl_src=00:55:66:77:88:99 actions=drop | |
2981 | OFPST_FLOW reply (OF1.2): | |
2982 | ]) | |
2983 | # Reducing the flow limit also causes the flows that expire soonest | |
2984 | # overall to be evicted. | |
2985 | AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4]) | |
2986 | AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
2987 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop | |
2988 | idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop | |
2989 | idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop | |
2990 | in_port=2,dl_src=00:55:66:77:88:99 actions=drop | |
2991 | OFPST_FLOW reply (OF1.2): | |
2992 | ]) | |
2993 | OVS_VSWITCHD_STOP | |
2994 | AT_CLEANUP | |
2995 | ||
6d56c1f1 K |
2996 | AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout]) |
2997 | OVS_VSWITCHD_START | |
2998 | # Configure a maximum of 4 flows. | |
2999 | AT_CHECK( | |
3000 | [ovs-vsctl \ | |
3001 | -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \ | |
3002 | -- set bridge br0 flow_tables:0=@t0 \ | |
3003 | | ${PERL} $srcdir/uuidfilt.pl], | |
3004 | [0], [<0> | |
3005 | ]) | |
337a3866 | 3006 | ovs-appctl time/stop |
6d56c1f1 K |
3007 | # Add 4 flows. |
3008 | for in_port in 4 3 2 1; do | |
337a3866 | 3009 | ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop |
6d56c1f1 K |
3010 | done |
3011 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
337a3866 YT |
3012 | hard_timeout=13, in_port=1 actions=drop |
3013 | hard_timeout=16, in_port=2 actions=drop | |
3014 | hard_timeout=19, in_port=3 actions=drop | |
3015 | hard_timeout=22, in_port=4 actions=drop | |
6d56c1f1 K |
3016 | NXST_FLOW reply: |
3017 | ]) | |
3018 | # Sleep and modify the one that expires soonest | |
337a3866 | 3019 | ovs-appctl time/warp 5000 |
6d56c1f1 | 3020 | AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop]) |
337a3866 YT |
3021 | # At this point the table would looks like: |
3022 | # in_port seconds to expire | |
3023 | # 1 13 | |
3024 | # 2 11 | |
3025 | # 3 14 | |
3026 | # 4 17 | |
3027 | ovs-appctl time/warp 2000 | |
6d56c1f1 K |
3028 | # Adding another flow will cause the one that expires soonest to be evicted. |
3029 | AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop]) | |
3030 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
337a3866 YT |
3031 | hard_timeout=13, in_port=1 actions=drop |
3032 | hard_timeout=19, in_port=3 actions=drop | |
3033 | hard_timeout=22, in_port=4 actions=drop | |
6d56c1f1 K |
3034 | in_port=5 actions=drop |
3035 | NXST_FLOW reply: | |
3036 | ]) | |
3037 | OVS_VSWITCHD_STOP | |
3038 | AT_CLEANUP | |
3039 | ||
3040 | AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout]) | |
3041 | OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1]) | |
3042 | # Configure a maximum of 4 flows. | |
3043 | AT_CHECK( | |
3044 | [ovs-vsctl \ | |
3045 | -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \ | |
3046 | -- set bridge br0 flow_tables:0=@t0 \ | |
3047 | | ${PERL} $srcdir/uuidfilt.pl], | |
3048 | [0], [<0> | |
3049 | ]) | |
3050 | # Add 4 flows. | |
3051 | for in_port in 4 3 2 1; do | |
337a3866 | 3052 | ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop |
6d56c1f1 | 3053 | done |
337a3866 | 3054 | ovs-appctl time/stop |
6d56c1f1 | 3055 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl |
337a3866 YT |
3056 | idle_timeout=13, in_port=1 actions=drop |
3057 | idle_timeout=16, in_port=2 actions=drop | |
3058 | idle_timeout=19, in_port=3 actions=drop | |
3059 | idle_timeout=22, in_port=4 actions=drop | |
6d56c1f1 K |
3060 | NXST_FLOW reply: |
3061 | ]) | |
3062 | # Sleep and receive on the flow that expires soonest | |
337a3866 | 3063 | ovs-appctl time/warp 5000 |
6d56c1f1 | 3064 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)']) |
337a3866 YT |
3065 | # At this point the table would looks like: |
3066 | # in_port seconds to expire | |
3067 | # 1 13 | |
3068 | # 2 11 | |
3069 | # 3 14 | |
3070 | # 4 17 | |
3071 | ovs-appctl time/warp 2000 | |
6d56c1f1 K |
3072 | # Adding another flow will cause the one that expires soonest to be evicted. |
3073 | AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop]) | |
3074 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
337a3866 YT |
3075 | idle_timeout=19, in_port=3 actions=drop |
3076 | idle_timeout=22, in_port=4 actions=drop | |
6d56c1f1 | 3077 | in_port=5 actions=drop |
efe179e0 | 3078 | n_packets=1, n_bytes=14, idle_timeout=13, in_port=1 actions=drop |
6d56c1f1 K |
3079 | NXST_FLOW reply: |
3080 | ]) | |
3081 | OVS_VSWITCHD_STOP | |
3082 | AT_CLEANUP | |
3083 | ||
9dcd1c00 | 3084 | AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)]) |
80d5aefd | 3085 | OVS_VSWITCHD_START |
6409e008 | 3086 | AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile]) |
80d5aefd BP |
3087 | check_async () { |
3088 | printf '\n\n--- check_async %d ---\n\n\n' $1 | |
3089 | shift | |
3090 | ||
6fc67c4f | 3091 | ovs-appctl -t ovs-ofctl ofctl/barrier |
80d5aefd BP |
3092 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log |
3093 | : > expout | |
3094 | ||
a7349929 | 3095 | # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0) |
7f05e7ab | 3096 | ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234' |
80d5aefd | 3097 | if test X"$1" = X"OFPR_ACTION"; then shift; |
7f05e7ab | 3098 | echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) |
e6d9ab56 | 3099 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" |
80d5aefd BP |
3100 | fi |
3101 | ||
a7349929 | 3102 | # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123) |
7f05e7ab | 3103 | ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234' |
a7349929 | 3104 | if test X"$1" = X"OFPR_NO_MATCH"; then shift; |
7f05e7ab | 3105 | echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered) |
e6d9ab56 | 3106 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" |
a7349929 BP |
3107 | fi |
3108 | ||
3109 | # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0) | |
6dd3c787 | 3110 | ovs-ofctl packet-out br0 "in_port=controller packet=002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00 actions=dec_ttl" |
80d5aefd | 3111 | if test X"$1" = X"OFPR_INVALID_TTL"; then shift; |
7f05e7ab | 3112 | echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered) |
e6d9ab56 | 3113 | 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" |
80d5aefd BP |
3114 | fi |
3115 | ||
3116 | # OFPT_PORT_STATUS, OFPPR_ADD | |
e1b1d06a | 3117 | ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1 |
80d5aefd BP |
3118 | if test X"$1" = X"OFPPR_ADD"; then shift; |
3119 | echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x | |
3120 | config: PORT_DOWN | |
9e1fd49b | 3121 | state: LINK_DOWN |
d02a5f8e | 3122 | speed: 0 Mbps now, 0 Mbps max" |
80d5aefd BP |
3123 | fi |
3124 | ||
3125 | # OFPT_PORT_STATUS, OFPPR_DELETE | |
3126 | ovs-vsctl del-port br0 test | |
3127 | if test X"$1" = X"OFPPR_DELETE"; then shift; | |
3128 | echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x | |
3129 | config: PORT_DOWN | |
9e1fd49b | 3130 | state: LINK_DOWN |
d02a5f8e | 3131 | speed: 0 Mbps now, 0 Mbps max" |
80d5aefd BP |
3132 | fi |
3133 | ||
3134 | # OFPT_FLOW_REMOVED, OFPRR_DELETE | |
3135 | ovs-ofctl add-flow br0 send_flow_rem,actions=drop | |
3136 | ovs-ofctl --strict del-flows br0 '' | |
3137 | if test X"$1" = X"OFPRR_DELETE"; then shift; | |
3138 | echo >>expout "OFPT_FLOW_REMOVED: reason=delete" | |
3139 | fi | |
3140 | AT_FAIL_IF([test X"$1" != X]) | |
3141 | ||
3142 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
fd0aa9ea | 3143 | echo >>expout "OFPT_BARRIER_REPLY:" |
80d5aefd BP |
3144 | |
3145 | AT_CHECK( | |
3146 | [[sed ' | |
3147 | s/ (xid=0x[0-9a-fA-F]*)// | |
3148 | s/ *duration.*// | |
3149 | s/00:0.$/00:0x/' < monitor.log]], | |
3150 | [0], [expout]) | |
3151 | } | |
3152 | ||
3153 | # It's a service connection so initially there should be no async messages. | |
3154 | check_async 1 | |
3155 | ||
99811d07 | 3156 | # Set miss_send_len to 128, turning on packet-ins for our service connection. |
80d5aefd BP |
3157 | ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080 |
3158 | check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE | |
3159 | ||
3160 | # Set miss_send_len to 128 and enable invalid_ttl. | |
3161 | ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080 | |
3162 | check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE | |
3163 | ||
3164 | # Become slave, which should disable everything except port status. | |
3165 | ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002 | |
3166 | check_async 4 OFPPR_ADD OFPPR_DELETE | |
3167 | ||
3168 | # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages. | |
3169 | ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005 | |
3170 | check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE | |
3171 | ||
a7349929 BP |
3172 | # Set controller ID 123. |
3173 | ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b | |
3174 | check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE | |
3175 | ||
3176 | # Restore controller ID 0. | |
3177 | ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000 | |
3178 | ||
80d5aefd BP |
3179 | # Become master. |
3180 | ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001 | |
a7349929 | 3181 | check_async 7 OFPR_ACTION OFPPR_ADD |
80d5aefd | 3182 | |
d9c8c57c | 3183 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
94c33672 | 3184 | OVS_VSWITCHD_STOP |
80d5aefd | 3185 | AT_CLEANUP |
751c7785 | 3186 | |
9dcd1c00 SH |
3187 | AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)]) |
3188 | OVS_VSWITCHD_START | |
6409e008 | 3189 | AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile]) |
9dcd1c00 SH |
3190 | check_async () { |
3191 | printf '\n\n--- check_async %d ---\n\n\n' $1 | |
3192 | INDEX=$1 | |
3193 | shift | |
3194 | ||
3195 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
3196 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
3197 | : > expout | |
3198 | ||
3199 | # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0) | |
3200 | ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234' | |
3201 | if test X"$1" = X"OFPR_ACTION"; then shift; | |
3202 | echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) | |
e6d9ab56 | 3203 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" |
9dcd1c00 SH |
3204 | fi |
3205 | ||
3206 | # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123) | |
3207 | ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234' | |
3208 | if test X"$1" = X"OFPR_NO_MATCH"; then shift; | |
3209 | echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered) | |
e6d9ab56 | 3210 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" |
9dcd1c00 SH |
3211 | fi |
3212 | ||
3213 | # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0) | |
fa8d9001 | 3214 | ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00' |
9dcd1c00 SH |
3215 | if test X"$1" = X"OFPR_INVALID_TTL"; then shift; |
3216 | echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered) | |
e6d9ab56 | 3217 | 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" |
9dcd1c00 SH |
3218 | fi |
3219 | ||
3220 | # OFPT_PORT_STATUS, OFPPR_ADD | |
3221 | ovs-vsctl add-port br0 test -- set Interface test type=dummy | |
3222 | if test X"$1" = X"OFPPR_ADD"; then shift; | |
3223 | echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x | |
3224 | config: PORT_DOWN | |
3225 | state: LINK_DOWN | |
3226 | speed: 0 Mbps now, 0 Mbps max" | |
3227 | fi | |
3228 | ||
3229 | # OFPT_PORT_STATUS, OFPPR_DELETE | |
3230 | ovs-vsctl del-port br0 test | |
3231 | if test X"$1" = X"OFPPR_DELETE"; then shift; | |
3232 | echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x | |
3233 | config: PORT_DOWN | |
3234 | state: LINK_DOWN | |
3235 | speed: 0 Mbps now, 0 Mbps max" | |
3236 | fi | |
3237 | ||
3238 | # OFPT_FLOW_REMOVED, OFPRR_DELETE | |
3239 | ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop | |
3240 | ovs-ofctl -O OpenFlow12 --strict del-flows br0 '' | |
3241 | if test X"$1" = X"OFPRR_DELETE"; then shift; | |
3242 | echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0" | |
3243 | fi | |
3244 | AT_FAIL_IF([test X"$1" != X]) | |
3245 | ||
a6d1a299 | 3246 | sleep 1 |
9dcd1c00 SH |
3247 | |
3248 | AT_CHECK( | |
3249 | [[sed ' | |
3250 | s/ (xid=0x[0-9a-fA-F]*)// | |
3251 | s/ *duration.*// | |
3252 | s/00:0.$/00:0x/' < monitor.log]], | |
3253 | [0], [expout]) | |
3254 | } | |
3255 | ||
3256 | # It's a service connection so initially there should be no async messages. | |
3257 | check_async 1 | |
3258 | ||
3259 | # Set miss_send_len to 128, turning on packet-ins for our service connection. | |
3260 | ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080 | |
3261 | check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE | |
3262 | ||
3263 | # Set miss_send_len to 128 and enable invalid_ttl. | |
3264 | ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080 | |
3265 | check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE | |
3266 | ||
6ea4776b JR |
3267 | # Become slave (OF 1.2), which should disable everything except port status. |
3268 | ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001 | |
9dcd1c00 SH |
3269 | check_async 4 OFPPR_ADD OFPPR_DELETE |
3270 | ||
3271 | # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages. | |
3272 | ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005 | |
3273 | check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE | |
3274 | ||
3275 | # Set controller ID 123. | |
3276 | ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b | |
3277 | check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE | |
3278 | ||
3279 | # Restore controller ID 0. | |
3280 | ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000 | |
3281 | ||
6ea4776b JR |
3282 | # Become master (OF 1.2). |
3283 | ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002 | |
9dcd1c00 SH |
3284 | check_async 7 OFPR_ACTION OFPPR_ADD |
3285 | ||
d9c8c57c | 3286 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
9dcd1c00 SH |
3287 | OVS_VSWITCHD_STOP |
3288 | AT_CLEANUP | |
3289 | ||
b21eb1da JR |
3290 | AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)]) |
3291 | OVS_VSWITCHD_START | |
6409e008 | 3292 | AT_CHECK([ovs-ofctl -O OpenFlow13 -P standard monitor br0 --detach --no-chdir --pidfile]) |
b21eb1da JR |
3293 | check_async () { |
3294 | printf '\n\n--- check_async %d ---\n\n\n' $1 | |
3295 | INDEX=$1 | |
3296 | shift | |
3297 | ||
3298 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
3299 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
3300 | : > expout | |
3301 | ||
3302 | # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0) | |
3303 | ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234' | |
3304 | if test X"$1" = X"OFPR_ACTION"; then shift; | |
3305 | echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) | |
e6d9ab56 | 3306 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" |
b21eb1da JR |
3307 | fi |
3308 | ||
3309 | # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123) | |
3310 | ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234' | |
3311 | if test X"$1" = X"OFPR_NO_MATCH"; then shift; | |
3312 | echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered) | |
e6d9ab56 | 3313 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" |
b21eb1da JR |
3314 | fi |
3315 | ||
3316 | # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0) | |
fa8d9001 | 3317 | ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00' |
b21eb1da JR |
3318 | if test X"$1" = X"OFPR_INVALID_TTL"; then shift; |
3319 | echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered) | |
e6d9ab56 | 3320 | 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" |
b21eb1da JR |
3321 | fi |
3322 | ||
3323 | # OFPT_PORT_STATUS, OFPPR_ADD | |
3324 | ovs-vsctl add-port br0 test -- set Interface test type=dummy | |
3325 | if test X"$1" = X"OFPPR_ADD"; then shift; | |
3326 | echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x | |
3327 | config: PORT_DOWN | |
3328 | state: LINK_DOWN | |
3329 | speed: 0 Mbps now, 0 Mbps max" | |
3330 | fi | |
3331 | ||
3332 | # OFPT_PORT_STATUS, OFPPR_DELETE | |
3333 | ovs-vsctl del-port br0 test | |
3334 | if test X"$1" = X"OFPPR_DELETE"; then shift; | |
3335 | echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x | |
3336 | config: PORT_DOWN | |
3337 | state: LINK_DOWN | |
3338 | speed: 0 Mbps now, 0 Mbps max" | |
3339 | fi | |
3340 | ||
3341 | # OFPT_FLOW_REMOVED, OFPRR_DELETE | |
3342 | ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop | |
3343 | ovs-ofctl -O OpenFlow13 --strict del-flows br0 '' | |
3344 | if test X"$1" = X"OFPRR_DELETE"; then shift; | |
3345 | echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0" | |
3346 | fi | |
cc40d06b SH |
3347 | |
3348 | # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE | |
3349 | ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10 | |
3350 | ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234 | |
3351 | ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234 | |
3352 | if test X"$1" = X"OFPRR_DELETE"; then shift; | |
3353 | echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=gropu_delete table_id=0" | |
3354 | fi | |
3355 | ||
b21eb1da JR |
3356 | AT_FAIL_IF([test X"$1" != X]) |
3357 | ||
3358 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
3359 | echo >>expout "OFPT_BARRIER_REPLY (OF1.3):" | |
3360 | ||
3361 | AT_CHECK( | |
3362 | [[sed ' | |
3363 | s/ (xid=0x[0-9a-fA-F]*)// | |
3364 | s/ *duration.*// | |
3365 | s/00:0.$/00:0x/' < monitor.log]], | |
3366 | [0], [expout]) | |
3367 | } | |
3368 | ||
3369 | # It's a service connection so initially there should be no async messages. | |
3370 | check_async 1 | |
3371 | ||
3372 | # Set miss_send_len to 128, turning on packet-ins for our service connection. | |
3373 | ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080 | |
3374 | check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE | |
3375 | ||
3376 | # Become slave (OF 1.3), which should disable everything except port status. | |
3377 | ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001 | |
3378 | check_async 3 OFPPR_ADD OFPPR_DELETE | |
3379 | ||
3380 | # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages. | |
3381 | ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005 | |
3382 | check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE | |
3383 | ||
3384 | # Set controller ID 123. | |
3385 | ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b | |
3386 | check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE | |
3387 | ||
3388 | # Restore controller ID 0. | |
3389 | ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000 | |
3390 | ||
3391 | # Become master (OF 1.3). | |
3392 | ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002 | |
3393 | check_async 6 OFPR_ACTION OFPPR_ADD | |
3394 | ||
d9c8c57c | 3395 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
b21eb1da JR |
3396 | OVS_VSWITCHD_STOP |
3397 | AT_CLEANUP | |
3398 | ||
98090482 NR |
3399 | AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.4)]) |
3400 | OVS_VSWITCHD_START | |
6409e008 | 3401 | AT_CHECK([ovs-ofctl -O OpenFlow14 -P standard monitor br0 --detach --no-chdir --pidfile]) |
98090482 NR |
3402 | check_async () { |
3403 | printf '\n\n--- check_async %d ---\n\n\n' $1 | |
3404 | INDEX=$1 | |
3405 | shift | |
3406 | ||
3407 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
3408 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
3409 | : > expout | |
3410 | ||
3411 | # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0) | |
3412 | ovs-ofctl -O OpenFlow14 -v packet-out br0 none controller '0001020304050010203040501234' | |
3413 | if test X"$1" = X"OFPR_ACTION"; then shift; | |
3414 | echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) | |
3415 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" | |
3416 | fi | |
3417 | ||
3418 | # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123) | |
3419 | ovs-ofctl -O OpenFlow14 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234' | |
3420 | if test X"$1" = X"OFPR_NO_MATCH"; then shift; | |
3421 | echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered) | |
3422 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" | |
3423 | fi | |
3424 | ||
3425 | # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0) | |
3426 | ovs-ofctl -O OpenFlow14 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00' | |
3427 | if test X"$1" = X"OFPR_INVALID_TTL"; then shift; | |
3428 | echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered) | |
3429 | 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" | |
3430 | fi | |
3431 | ||
3432 | # OFPT_PORT_STATUS, OFPPR_ADD | |
3433 | ovs-vsctl add-port br0 test -- set Interface test type=dummy | |
3434 | if test X"$1" = X"OFPPR_ADD"; then shift; | |
3435 | echo >>expout "OFPT_PORT_STATUS (OF1.4): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x | |
3436 | config: PORT_DOWN | |
3437 | state: LINK_DOWN | |
3438 | speed: 0 Mbps now, 0 Mbps max" | |
3439 | fi | |
3440 | ||
3441 | # OFPT_PORT_STATUS, OFPPR_MODIFY | |
3442 | ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 test up | |
3443 | if test X"$1" = X"OFPPR_MODIFY"; then shift; | |
3444 | echo >>expout "OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x | |
3445 | config: 0 | |
3446 | state: LINK_DOWN | |
3447 | speed: 0 Mbps now, 0 Mbps max | |
3448 | OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x | |
3449 | config: 0 | |
3450 | state: 0 | |
3451 | speed: 0 Mbps now, 0 Mbps max" | |
3452 | fi | |
3453 | ||
3454 | # OFPT_PORT_STATUS, OFPPR_DELETE | |
3455 | ovs-vsctl del-port br0 test | |
3456 | if test X"$1" = X"OFPPR_DELETE"; then shift; | |
3457 | echo >>expout "OFPT_PORT_STATUS (OF1.4): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x | |
3458 | config: 0 | |
3459 | state: 0 | |
3460 | speed: 0 Mbps now, 0 Mbps max" | |
3461 | fi | |
3462 | ||
3463 | # OFPT_FLOW_REMOVED, OFPRR_DELETE | |
3464 | ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=drop | |
3465 | ovs-ofctl -O OpenFlow14 --strict del-flows br0 '' | |
3466 | if test X"$1" = X"OFPRR_DELETE"; then shift; | |
3467 | echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=delete table_id=0" | |
3468 | fi | |
3469 | ||
6c6eedc5 | 3470 | # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE |
98090482 NR |
3471 | ovs-ofctl -O OpenFlow14 add-group br0 group_id=1234,type=all,bucket=output:10 |
3472 | ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=group:1234 | |
3473 | ovs-ofctl -O OpenFlow14 --strict del-groups br0 group_id=1234 | |
3474 | if test X"$1" = X"OFPRR_GROUP_DELETE"; then shift; | |
3475 | echo >>expout "OFPT_FLOW_REMOVED (OF1.4): reason=group_delete table_id=0" | |
3476 | fi | |
3477 | ||
6c6eedc5 SJ |
3478 | # OFPT_TABLE_STATUS, OFPTR_VACANCY_UP |
3479 | if test X"$1" = X"OFPTR_VACANCY_UP"; then shift; | |
3480 | ovs-vsctl -- --id=@t1 create Flow_Table flow-limit=10 -- set bridge br0 flow_tables:1=@t1 | |
3481 | ||
3482 | # Turn on vacancy events, then add flows until we're full. | |
3483 | # With initial vacancy of 100% and vacancy_up of 80%, so that | |
3484 | # vacancy >= vacancy_up, this enables VACANY_DOWN events, so | |
3485 | # we get a single such message when vacancy dips below 20%. | |
3486 | ovs-ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80 | |
3487 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2 | |
3488 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2 | |
3489 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2 | |
3490 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2 | |
3491 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2 | |
3492 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2 | |
3493 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2 | |
3494 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2 | |
3495 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2 | |
3496 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2 | |
3497 | echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_DOWN | |
3498 | table_desc:- | |
3499 | table 1: | |
3500 | eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME | |
3501 | vacancy=on vacancy_down=20% vacancy_up=80% vacancy=10%" | |
3502 | # Then delete flows until we're empty. Sending the | |
3503 | # VACANCY_DOWN message enabled VACANCY_UP events, so we get a | |
3504 | # single such message when vacancy rises above 80%. | |
3505 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1 | |
3506 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2 | |
3507 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3 | |
3508 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4 | |
3509 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5 | |
3510 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6 | |
3511 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7 | |
3512 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8 | |
3513 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9 | |
3514 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10 | |
3515 | echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_UP | |
3516 | table_desc:- | |
3517 | table 1: | |
3518 | eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME | |
3519 | vacancy=on vacancy_down=20% vacancy_up=80% vacancy=90%" | |
3520 | ||
3521 | # Now approach vacancy from the other direction. First | |
3522 | # disable vacancy events. With initial vacancy of 70%, so | |
3523 | # that vacancy < vacancy_up, this enables VACANCY_UP events. | |
3524 | # That means that filling up the table generates no message, | |
3525 | # but deleting all the flows generates VACANCY_UP at the point | |
3526 | # vacancy rises above 80%. | |
3527 | ovs-ofctl -O OpenFlow14 mod-table br0 1 novacancy | |
3528 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2 | |
3529 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2 | |
3530 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2 | |
3531 | ovs-ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80 | |
3532 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2 | |
3533 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2 | |
3534 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2 | |
3535 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2 | |
3536 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2 | |
3537 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2 | |
3538 | ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2 | |
3539 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1 | |
3540 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2 | |
3541 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3 | |
3542 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4 | |
3543 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5 | |
3544 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6 | |
3545 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7 | |
3546 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8 | |
3547 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9 | |
3548 | ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10 | |
3549 | echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_UP | |
3550 | table_desc:- | |
3551 | table 1: | |
3552 | eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME | |
3553 | vacancy=on vacancy_down=20% vacancy_up=80% vacancy=90%" | |
3554 | fi | |
3555 | ||
98090482 NR |
3556 | AT_FAIL_IF([test X"$1" != X]) |
3557 | ||
3558 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
3559 | echo >>expout "OFPT_BARRIER_REPLY (OF1.4):" | |
3560 | ||
3561 | AT_CHECK( | |
3562 | [[sed ' | |
3563 | s/ (xid=0x[0-9a-fA-F]*)// | |
3564 | s/ *duration.*// | |
3565 | s/00:0.$/00:0x/' < monitor.log]], | |
3566 | [0], [expout]) | |
3567 | } | |
3568 | ||
3569 | # It's a service connection so initially there should be no async messages. | |
3570 | check_async 1 | |
3571 | ||
3572 | # Set miss_send_len to 128, turning on packet-ins for our service connection. | |
3573 | ovs-appctl -t ovs-ofctl ofctl/send 0509000c0123456700000080 | |
3574 | check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE | |
3575 | ||
3576 | # Become slave (OF 1.4), which should disable everything except port status. | |
3577 | ovs-appctl -t ovs-ofctl ofctl/send 051800180000000200000003000000000000000000000001 | |
3578 | check_async 3 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE | |
3579 | ||
3580 | # Use OF 1.4 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages. | |
6c6eedc5 SJ |
3581 | ovs-appctl -t ovs-ofctl ofctl/send 051c0040000000020000000800000005000100080000000200020008000000020003000800000005000400080000001c00050008000000050008000800000018 |
3582 | check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE OFPTR_VACANCY_UP | |
98090482 NR |
3583 | |
3584 | # Set controller ID 123. | |
3585 | ovs-appctl -t ovs-ofctl ofctl/send 05040018000000030000232000000014000000000000007b | |
3586 | check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE | |
3587 | ||
3588 | # Restore controller ID 0. | |
3589 | ovs-appctl -t ovs-ofctl ofctl/send 050400180000000300002320000000140000000000000000 | |
3590 | ||
3591 | # Become master (OF 1.4). | |
3592 | ovs-appctl -t ovs-ofctl ofctl/send 051800180000000400000002000000000000000000000002 | |
3593 | check_async 6 OFPR_ACTION OFPPR_ADD OFPPR_MODIFY OFPRR_DELETE | |
3594 | ||
d9c8c57c | 3595 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
98090482 NR |
3596 | OVS_VSWITCHD_STOP |
3597 | AT_CLEANUP | |
3598 | ||
ebeae5db JT |
3599 | AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.5)]) |
3600 | OVS_VSWITCHD_START | |
6409e008 | 3601 | AT_CHECK([ovs-ofctl -O OpenFlow15 -P standard monitor br0 --detach --no-chdir --pidfile]) |
ebeae5db JT |
3602 | check_async () { |
3603 | printf '\n\n--- check_async %d ---\n\n\n' $1 | |
3604 | INDEX=$1 | |
3605 | shift | |
3606 | ||
3607 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
3608 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
3609 | : > expout | |
3610 | ||
3611 | # Other tests are not working with OF 1.5, and message | |
3612 | # format may change, so leave them out. | |
3613 | ||
3614 | # OFPT_PORT_STATUS, OFPPR_ADD | |
3615 | ovs-vsctl add-port br0 test -- set Interface test type=dummy | |
3616 | if test X"$1" = X"OFPPR_ADD"; then shift; | |
3617 | echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x | |
3618 | config: PORT_DOWN | |
3619 | state: LINK_DOWN | |
3620 | speed: 0 Mbps now, 0 Mbps max" | |
3621 | fi | |
3622 | ||
3623 | # OFPT_PORT_STATUS, OFPPR_MODIFY | |
3624 | ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test up | |
3625 | if test X"$1" = X"OFPPR_MODIFY"; then shift; | |
3626 | echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x | |
3627 | config: 0 | |
3628 | state: LINK_DOWN | |
3629 | speed: 0 Mbps now, 0 Mbps max | |
3630 | OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x | |
3631 | config: 0 | |
3632 | state: 0 | |
3633 | speed: 0 Mbps now, 0 Mbps max" | |
3634 | fi | |
3635 | ||
3636 | # OFPT_PORT_STATUS, OFPPR_DELETE | |
3637 | ovs-vsctl del-port br0 test | |
3638 | if test X"$1" = X"OFPPR_DELETE"; then shift; | |
3639 | echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x | |
3640 | config: 0 | |
3641 | state: 0 | |
3642 | speed: 0 Mbps now, 0 Mbps max" | |
3643 | fi | |
3644 | ||
3645 | AT_FAIL_IF([test X"$1" != X]) | |
3646 | ||
3647 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
3648 | echo >>expout "OFPT_BARRIER_REPLY (OF1.5):" | |
3649 | ||
3650 | AT_CHECK( | |
3651 | [[sed ' | |
3652 | s/ (xid=0x[0-9a-fA-F]*)// | |
3653 | s/ *duration.*// | |
3654 | s/00:0.$/00:0x/' < monitor.log]], | |
3655 | [0], [expout]) | |
3656 | } | |
3657 | ||
3658 | # It's a service connection so initially there should be no async messages. | |
3659 | check_async 1 | |
3660 | ||
3661 | # If we don't set this, async messages are not received. | |
3662 | # Set miss_send_len to 128, turning on packet-ins for our service connection. | |
3663 | ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080 | |
3664 | check_async 2 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE | |
3665 | ||
3666 | # Set-async has changed in OF 1.4 and is not yet implemented. | |
3667 | ||
d9c8c57c | 3668 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
ebeae5db JT |
3669 | OVS_VSWITCHD_STOP |
3670 | AT_CLEANUP | |
3671 | ||
6ea4776b JR |
3672 | dnl This test checks that the role request/response messaging works |
3673 | dnl and that generation_id is handled properly. | |
3674 | AT_SETUP([ofproto - controller role (OpenFlow 1.2)]) | |
3675 | OVS_VSWITCHD_START | |
53eb8cb8 | 3676 | on_exit 'kill `cat c1.pid c2.pid`' |
6751a4b4 BP |
3677 | |
3678 | # Start two ovs-ofctl controller processes. | |
3679 | AT_CAPTURE_FILE([monitor1.log]) | |
3680 | AT_CAPTURE_FILE([expout1]) | |
3681 | AT_CAPTURE_FILE([experr1]) | |
3682 | AT_CAPTURE_FILE([monitor2.log]) | |
3683 | AT_CAPTURE_FILE([expout2]) | |
3684 | AT_CAPTURE_FILE([experr2]) | |
3685 | for i in 1 2; do | |
56120500 | 3686 | AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=c$i.pid --unixctl=c$i]) |
6751a4b4 BP |
3687 | ovs-appctl -t `pwd`/c$i ofctl/barrier |
3688 | ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log | |
3689 | : > expout$i | |
3690 | : > experr$i | |
3691 | ||
3692 | # find out current role | |
3693 | ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000 | |
3694 | echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange" | |
3695 | echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal" | |
3696 | done | |
6ea4776b | 3697 | |
6751a4b4 BP |
3698 | # controller 1: Become slave (generation_id is initially undefined, so |
3699 | # 2^63+2 should not be stale) | |
3700 | ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002 | |
3701 | echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810" | |
3702 | echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810" | |
3703 | ||
3704 | # controller 2: Become master. | |
3705 | ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003 | |
3706 | echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811" | |
3707 | echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811" | |
3708 | ||
3709 | # controller 1: Try to become the master using a stale generation ID | |
3710 | ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003 | |
3711 | echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3" | |
3712 | echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE" | |
3713 | echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3" | |
3714 | ||
3715 | # controller 1: Become master using a valid generation ID | |
3716 | ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001 | |
3717 | echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1" | |
3718 | echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1" | |
3719 | ||
3720 | for i in 1 2; do | |
3721 | ovs-appctl -t `pwd`/c$i ofctl/barrier | |
3722 | echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):" | |
3723 | done | |
6ea4776b | 3724 | |
6751a4b4 BP |
3725 | # Check output. |
3726 | for i in 1 2; do | |
3727 | cp expout$i expout | |
8a32aaa5 | 3728 | AT_CHECK([grep -v '^send:' monitor$i.log | strip_xids], [0], [expout]) |
6751a4b4 | 3729 | cp experr$i expout |
8a32aaa5 | 3730 | AT_CHECK([grep '^send:' monitor$i.log | strip_xids], [0], [expout]) |
6751a4b4 BP |
3731 | done |
3732 | OVS_VSWITCHD_STOP | |
3733 | AT_CLEANUP | |
6ea4776b | 3734 | |
6751a4b4 BP |
3735 | dnl This test checks that the role request/response messaging works, |
3736 | dnl that generation_id is handled properly, and that role status update | |
3737 | dnl messages are sent when a controller's role gets changed from master | |
3738 | dnl to slave. | |
3739 | AT_SETUP([ofproto - controller role (OpenFlow 1.4)]) | |
3740 | OVS_VSWITCHD_START | |
53eb8cb8 | 3741 | on_exit 'kill `cat c1.pid c2.pid`' |
6751a4b4 BP |
3742 | |
3743 | # Start two ovs-ofctl controller processes. | |
3744 | AT_CAPTURE_FILE([monitor1.log]) | |
3745 | AT_CAPTURE_FILE([expout1]) | |
3746 | AT_CAPTURE_FILE([experr1]) | |
3747 | AT_CAPTURE_FILE([monitor2.log]) | |
3748 | AT_CAPTURE_FILE([expout2]) | |
3749 | AT_CAPTURE_FILE([experr2]) | |
3750 | for i in 1 2; do | |
56120500 | 3751 | AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=c$i.pid --unixctl=c$i]) |
6751a4b4 BP |
3752 | ovs-appctl -t `pwd`/c$i ofctl/barrier |
3753 | ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log | |
3754 | : > expout$i | |
3755 | : > experr$i | |
3756 | ||
3757 | # find out current role | |
3758 | ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000 | |
3759 | echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange" | |
3760 | echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal" | |
3761 | done | |
6ea4776b | 3762 | |
6751a4b4 BP |
3763 | # controller 1: Become slave (generation_id is initially undefined, so |
3764 | # 2^63+2 should not be stale) | |
3765 | ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002 | |
3766 | echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810" | |
3767 | echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810" | |
3768 | ||
3769 | # controller 2: Become master. | |
3770 | ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003 | |
3771 | echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811" | |
3772 | echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811" | |
3773 | ||
3774 | # controller 1: Try to become the master using a stale generation ID | |
3775 | ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003 | |
3776 | echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3" | |
3777 | echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE" | |
3778 | echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3" | |
3779 | ||
3780 | # controller 1: Become master using a valid generation ID | |
3781 | ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001 | |
3782 | echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1" | |
3783 | echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1" | |
3784 | echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request" | |
3785 | ||
3786 | for i in 1 2; do | |
3787 | ovs-appctl -t `pwd`/c$i ofctl/barrier | |
3788 | echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):" | |
3789 | done | |
6ea4776b | 3790 | |
6751a4b4 BP |
3791 | # Check output. |
3792 | for i in 1 2; do | |
3793 | cp expout$i expout | |
8a32aaa5 | 3794 | AT_CHECK([grep -v '^send:' monitor$i.log | strip_xids], [0], [expout]) |
6751a4b4 | 3795 | cp experr$i expout |
8a32aaa5 | 3796 | AT_CHECK([grep '^send:' monitor$i.log | strip_xids], [0], [expout]) |
6751a4b4 | 3797 | done |
6ea4776b JR |
3798 | OVS_VSWITCHD_STOP |
3799 | AT_CLEANUP | |
3800 | ||
3c35db62 NR |
3801 | dnl This test checks the Group and meter notifications when a group mod |
3802 | dnl command is sent from one controller and the reply is received by | |
3803 | dnl other controllers. | |
3804 | AT_SETUP([ofproto - requestforward (OpenFlow 1.4)]) | |
3805 | OVS_VSWITCHD_START | |
3806 | on_exit 'kill `cat c1.pid c2.pid c3.pid`' | |
3807 | ||
3808 | # Start two ovs-ofctl controller processes. | |
3809 | AT_CAPTURE_FILE([monitor1.log]) | |
3810 | AT_CAPTURE_FILE([expout1]) | |
3811 | AT_CAPTURE_FILE([monitor2.log]) | |
3812 | AT_CAPTURE_FILE([expout2]) | |
3813 | AT_CAPTURE_FILE([monitor3.log]) | |
3814 | AT_CAPTURE_FILE([expout3]) | |
3815 | ||
56120500 BP |
3816 | ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile=c1.pid --unixctl=c1 |
3817 | ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=c2.pid --unixctl=c2 | |
3818 | ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=c3.pid --unixctl=c3 | |
3c35db62 NR |
3819 | |
3820 | check_async () { | |
3821 | for i in 1 3; do | |
3822 | ovs-appctl -t `pwd`/c$i ofctl/barrier | |
3823 | ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log | |
3824 | : > expout$i | |
3825 | done | |
3826 | ||
3827 | printf '\n\n--- check_async %d ---\n\n\n' $1 | |
3828 | INDEX=$1 | |
3829 | shift | |
3830 | ||
3831 | # OFPGC_ADD | |
63eded98 | 3832 | ovs-appctl -t `pwd`/c2 ofctl/send "050f0020000000020000000000000001 00100000 ffffffffffffffff 00000000" |
3c35db62 NR |
3833 | if test X"$1" = X"OFPGC_ADD"; then shift; |
3834 | echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4): | |
63eded98 | 3835 | ADD group_id=1,type=all,bucket=actions=drop" |
3c35db62 | 3836 | echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod |
63eded98 | 3837 | ADD group_id=1,type=all,bucket=bucket_id:0,actions=drop" |
3c35db62 | 3838 | echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod |
63eded98 | 3839 | ADD group_id=1,type=all,bucket=actions=drop" |
3c35db62 NR |
3840 | fi |
3841 | ||
3842 | # OFPGC_MODIFY | |
63eded98 | 3843 | ovs-appctl -t `pwd`/c2 ofctl/send "050f0020000000020001010000000001 00100000 ffffffffffffffff 00000000" |
3c35db62 NR |
3844 | if test X"$1" = X"OFPGC_MODIFY"; then shift; |
3845 | echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4): | |
63eded98 | 3846 | MOD group_id=1,type=select,bucket=weight:0,actions=drop" |
3c35db62 | 3847 | echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod |
63eded98 | 3848 | MOD group_id=1,type=select,bucket=bucket_id:0,weight:0,actions=drop" |
3c35db62 | 3849 | echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod |
63eded98 | 3850 | MOD group_id=1,type=select,bucket=weight:0,actions=drop" |
3c35db62 NR |
3851 | fi |
3852 | ||
3853 | ovs-appctl -t `pwd`/c1 ofctl/barrier | |
3854 | echo >>expout1 "OFPT_BARRIER_REPLY (OF1.5):" | |
3855 | ovs-appctl -t `pwd`/c2 ofctl/barrier | |
3856 | echo >>expout2 "OFPT_BARRIER_REPLY (OF1.4):" | |
3857 | ovs-appctl -t `pwd`/c3 ofctl/barrier | |
3858 | echo >>expout3 "OFPT_BARRIER_REPLY (OF1.4):" | |
3859 | ||
3860 | # Check output. | |
3861 | for i in 1 3; do | |
3862 | cp expout$i expout | |
3863 | AT_CHECK( | |
3864 | [[sed ' | |
3865 | s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]], | |
3866 | [0], [expout]) | |
3867 | done | |
3868 | } | |
3869 | ||
3870 | # controller 1: Become slave | |
3871 | ovs-appctl -t `pwd`/c1 ofctl/send 061800180000000300000003000000008000000000000002 | |
3872 | ||
3873 | # controller 2: Become master | |
3874 | ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003 | |
3875 | ||
3876 | # controller 1: Become slave | |
3877 | ovs-appctl -t `pwd`/c3 ofctl/send 051800180000000300000003000000008000000000000004 | |
3878 | ||
3879 | # controller 1: Enabled requestforward using set Asynchronous message | |
3880 | ovs-appctl -t `pwd`/c1 ofctl/send 061c00280000000200000008000000050002000800000002000400080000001a000a000800000003 | |
3881 | ||
3882 | # controller 2: Enabled requestforward using set Asynchronous message | |
3883 | ovs-appctl -t `pwd`/c2 ofctl/send 051c002800000002000100080000000200030008000000050005000800000005000b000800000003 | |
3884 | ||
3885 | # controller 1: Enabled requestforward using set Asynchronous message | |
3886 | ovs-appctl -t `pwd`/c3 ofctl/send 051c00280000000200000008000000050002000800000002000400080000001a000a000800000003 | |
3887 | check_async 1 OFPGC_ADD OFPGC_MODIFY | |
3888 | ||
3889 | OVS_VSWITCHD_STOP | |
3890 | AT_CLEANUP | |
3891 | ||
751c7785 BP |
3892 | dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as |
3893 | dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some | |
3894 | dnl controllers despite the spec) as meaning a packet that was generated | |
3895 | dnl by the controller. | |
9dcd1c00 | 3896 | AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)]) |
751c7785 | 3897 | OVS_VSWITCHD_START |
ca5792f0 | 3898 | add_of_ports br0 1 |
751c7785 BP |
3899 | |
3900 | # Start a monitor listening for packet-ins. | |
6409e008 | 3901 | AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile]) |
751c7785 BP |
3902 | ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080 |
3903 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
3904 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
3905 | AT_CAPTURE_FILE([monitor.log]) | |
3906 | ||
3907 | # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port. | |
6dd3c787 JR |
3908 | AT_CHECK([ovs-ofctl packet-out br0 "in_port=none packet=0001020304050010203040501234 actions=controller,1"]) |
3909 | AT_CHECK([ovs-ofctl packet-out br0 "in_port=controller packet=0001020304050010203040505678 actions=controller,1"]) | |
751c7785 BP |
3910 | |
3911 | # Stop the monitor and check its output. | |
3912 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 3913 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
751c7785 | 3914 | |
586ddea5 BP |
3915 | ovs-ofctl dump-ports br0 |
3916 | ||
751c7785 | 3917 | AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl |
7f05e7ab | 3918 | OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) |
e6d9ab56 | 3919 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 |
751c7785 | 3920 | OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) |
e6d9ab56 | 3921 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678 |
969fc56c JS |
3922 | OFPT_BARRIER_REPLY: |
3923 | ]) | |
3924 | ||
3925 | OVS_VSWITCHD_STOP | |
3926 | AT_CLEANUP | |
3927 | ||
9dcd1c00 SH |
3928 | dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as |
3929 | dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some | |
3930 | dnl controllers despite the spec) as meaning a packet that was generated | |
3931 | dnl by the controller. | |
3932 | AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)]) | |
3933 | OVS_VSWITCHD_START | |
3934 | ||
3935 | # Start a monitor listening for packet-ins. | |
6409e008 | 3936 | AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile]) |
9dcd1c00 SH |
3937 | ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080 |
3938 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
3939 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
3940 | AT_CAPTURE_FILE([monitor.log]) | |
3941 | ||
3942 | # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port. | |
3943 | AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234']) | |
3944 | AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678']) | |
3945 | ||
3946 | # Stop the monitor and check its output. | |
3947 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 3948 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
9dcd1c00 SH |
3949 | |
3950 | AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl | |
3951 | OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) | |
e6d9ab56 | 3952 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 |
9dcd1c00 | 3953 | OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) |
e6d9ab56 | 3954 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678 |
9dcd1c00 SH |
3955 | OFPT_BARRIER_REPLY (OF1.2): |
3956 | ]) | |
3957 | ||
3958 | OVS_VSWITCHD_STOP | |
3959 | AT_CLEANUP | |
3960 | ||
4d197ebb BP |
3961 | dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as |
3962 | dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some | |
3963 | dnl controllers despite the spec) as meaning a packet that was generated | |
3964 | dnl by the controller. | |
3965 | AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)]) | |
3966 | OVS_VSWITCHD_START | |
3967 | ||
3968 | # Start a monitor listening for packet-ins. | |
6409e008 | 3969 | AT_CHECK([ovs-ofctl -O OpenFlow11 -P standard monitor br0 --detach --no-chdir --pidfile]) |
4d197ebb BP |
3970 | ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080 |
3971 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
3972 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
3973 | AT_CAPTURE_FILE([monitor.log]) | |
3974 | ||
6dd3c787 JR |
3975 | # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER as in_port. |
3976 | AT_CHECK([ovs-appctl -t ovs-ofctl ofctl/packet-out "in_port=none, packet=0001020304050010203040501234 actions=controller"]) | |
3977 | AT_CHECK([ovs-appctl -t ovs-ofctl ofctl/packet-out "in_port=controller packet=0001020304050010203040505678 actions=controller"]) | |
4d197ebb BP |
3978 | |
3979 | # Stop the monitor and check its output. | |
3980 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 3981 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
4d197ebb | 3982 | |
6dd3c787 JR |
3983 | AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)// |
3984 | /PACKET_OUT/d' monitor.log], [0], [dnl | |
4d197ebb | 3985 | OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) |
e6d9ab56 | 3986 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 |
4d197ebb | 3987 | OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) |
e6d9ab56 | 3988 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678 |
4d197ebb BP |
3989 | OFPT_BARRIER_REPLY (OF1.1): |
3990 | ]) | |
3991 | ||
3992 | OVS_VSWITCHD_STOP | |
3993 | AT_CLEANUP | |
3994 | ||
bdcad671 BP |
3995 | dnl This test checks that metadata and userdata are encoded in NXT_PACKET_IN2. |
3996 | AT_SETUP([ofproto - packet-out with metadata and userdata (NXT_PACKET_IN2)]) | |
6409e008 BP |
3997 | OVS_VSWITCHD_START |
3998 | ||
3999 | # Start a monitor listening for packet-ins. | |
4000 | AT_CHECK([ovs-ofctl -P nxt_packet_in2 monitor br0 --detach --no-chdir --pidfile]) | |
4001 | ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080 | |
4002 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4003 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
4004 | AT_CAPTURE_FILE([monitor.log]) | |
4005 | ||
4006 | # Send a packet-out with a load action to set some metadata, and forward to controller | |
6dd3c787 | 4007 | AT_CHECK([ovs-ofctl packet-out br0 "in_port=controller packet=0001020304050010203040501234 actions=load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]),load(0xaa->NXM_NX_PKT_MARK[[]]),controller(userdata=01.02.03.04.05)"]) |
6409e008 BP |
4008 | |
4009 | # Stop the monitor and check its output. | |
4010 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 4011 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
6409e008 BP |
4012 | |
4013 | AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl | |
4014 | NXT_PACKET_IN2: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered) | |
bdcad671 | 4015 | userdata=01.02.03.04.05 |
6409e008 BP |
4016 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 |
4017 | OFPT_BARRIER_REPLY: | |
4018 | ]) | |
4019 | ||
4020 | OVS_VSWITCHD_STOP | |
4021 | AT_CLEANUP | |
4022 | ||
969fc56c JS |
4023 | dnl This test checks that metadata is encoded in packet_in structures, |
4024 | dnl supported by NXAST. | |
4025 | AT_SETUP([ofproto - packet-out with metadata (NXM)]) | |
4026 | OVS_VSWITCHD_START | |
4027 | ||
4028 | # Start a monitor listening for packet-ins. | |
6409e008 | 4029 | AT_CHECK([ovs-ofctl -P nxt_packet_in monitor br0 --detach --no-chdir --pidfile]) |
969fc56c JS |
4030 | ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080 |
4031 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4032 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
4033 | AT_CAPTURE_FILE([monitor.log]) | |
4034 | ||
4035 | # Send a packet-out with a load action to set some metadata, and forward to controller | |
6dd3c787 | 4036 | AT_CHECK([ovs-ofctl packet-out br0 "in_port=controller packet=0001020304050010203040501234 actions=load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]),load(0xaa->NXM_NX_PKT_MARK[[]]),controller"]) |
969fc56c JS |
4037 | |
4038 | # Stop the monitor and check its output. | |
4039 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 4040 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
969fc56c JS |
4041 | |
4042 | AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl | |
50dcbd8e | 4043 | NXT_PACKET_IN: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered) |
e6d9ab56 | 4044 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 |
751c7785 BP |
4045 | OFPT_BARRIER_REPLY: |
4046 | ]) | |
4047 | ||
4048 | OVS_VSWITCHD_STOP | |
4049 | AT_CLEANUP | |
2b07c8b1 | 4050 | |
9dcd1c00 SH |
4051 | dnl This test checks that metadata is encoded in packet_in structures, |
4052 | dnl supported by NXAST. | |
4053 | AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)]) | |
4054 | OVS_VSWITCHD_START | |
4055 | ||
4056 | # Start a monitor listening for packet-ins. | |
6409e008 | 4057 | AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile]) |
9dcd1c00 SH |
4058 | ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080 |
4059 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4060 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
4061 | AT_CAPTURE_FILE([monitor.log]) | |
4062 | ||
277876e9 JT |
4063 | # Send a packet-out with a set-field action to set some metadata, and forward to controller |
4064 | AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234']) | |
9dcd1c00 SH |
4065 | |
4066 | # Stop the monitor and check its output. | |
4067 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 4068 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
9dcd1c00 SH |
4069 | |
4070 | AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl | |
50dcbd8e | 4071 | OFPT_PACKET_IN (OF1.2): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=ANY (via action) data_len=14 (unbuffered) |
e6d9ab56 | 4072 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 |
0ad90c84 JR |
4073 | OFPT_BARRIER_REPLY (OF1.2): |
4074 | ]) | |
4075 | ||
4076 | OVS_VSWITCHD_STOP | |
4077 | AT_CLEANUP | |
4078 | ||
743c159b JT |
4079 | dnl This test checks that metadata is encoded in packet_in structures, |
4080 | dnl supported by NXAST. | |
4081 | AT_SETUP([ofproto - packet-out with metadata and dual set_field (OpenFlow 1.3)]) | |
4082 | OVS_VSWITCHD_START | |
4083 | ||
4084 | # Start a monitor listening for packet-ins. | |
6409e008 | 4085 | AT_CHECK([ovs-ofctl -O OpenFlow13 -P standard monitor br0 --detach --no-chdir --pidfile]) |
743c159b JT |
4086 | ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080 |
4087 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4088 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
4089 | AT_CAPTURE_FILE([monitor.log]) | |
4090 | ||
4091 | # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller | |
4092 | AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, set_field:0x6b->metadata, controller' '0001020304050010203040501234']) | |
4093 | ||
4094 | # Stop the monitor and check its output. | |
4095 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 4096 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
743c159b JT |
4097 | |
4098 | AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl | |
50dcbd8e | 4099 | OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0x6b,in_port=ANY (via action) data_len=14 (unbuffered) |
e6d9ab56 | 4100 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 |
743c159b JT |
4101 | OFPT_BARRIER_REPLY (OF1.3): |
4102 | ]) | |
4103 | ||
4104 | OVS_VSWITCHD_STOP | |
4105 | AT_CLEANUP | |
4106 | ||
0ad90c84 JR |
4107 | dnl This test checks that tunnel metadata is encoded in packet_in structures. |
4108 | AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)]) | |
4109 | OVS_VSWITCHD_START | |
4110 | ||
4111 | # Start a monitor listening for packet-ins. | |
6409e008 | 4112 | AT_CHECK([ovs-ofctl -O OpenFlow12 -P standard monitor br0 --detach --no-chdir --pidfile]) |
0ad90c84 JR |
4113 | ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080 |
4114 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4115 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
4116 | AT_CAPTURE_FILE([monitor.log]) | |
4117 | ||
4118 | # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller | |
4119 | 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']) | |
4120 | ||
4121 | # Stop the monitor and check its output. | |
4122 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 4123 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
0ad90c84 JR |
4124 | |
4125 | AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl | |
50dcbd8e | 4126 | 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) |
e6d9ab56 | 4127 | vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 |
9dcd1c00 SH |
4128 | OFPT_BARRIER_REPLY (OF1.2): |
4129 | ]) | |
4130 | ||
4131 | OVS_VSWITCHD_STOP | |
4132 | AT_CLEANUP | |
4133 | ||
1637ebb2 SH |
4134 | m4_divert_push([PREPARE_TESTS]) |
4135 | # Sorts groups of lines that start with a space, without moving them | |
4136 | # past the nearest line that does not start with a space. | |
4137 | multiline_sort () { | |
4138 | ${PERL} -e ' | |
4139 | use warnings; | |
4140 | use strict; | |
4141 | my @buffer = (); | |
4142 | while (<STDIN>) { | |
4143 | if (/^ /) { | |
4144 | push(@buffer, $_); | |
4145 | } else { | |
4146 | print $_ foreach sort(@buffer); | |
4147 | print $_; | |
4148 | @buffer = (); | |
4149 | } | |
4150 | } | |
4151 | print $_ foreach sort(@buffer); | |
4152 | ' | |
4153 | } | |
4154 | m4_divert_pop([PREPARE_TESTS]) | |
4155 | ||
2b07c8b1 BP |
4156 | AT_SETUP([ofproto - flow monitoring]) |
4157 | AT_KEYWORDS([monitor]) | |
4158 | OVS_VSWITCHD_START | |
4159 | ||
4160 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1 | |
4161 | ||
4162 | # Start a monitor watching the flow table and check the initial reply. | |
4163 | ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1 | |
4164 | AT_CAPTURE_FILE([monitor.log]) | |
4165 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4166 | AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0], | |
4167 | [NXST_FLOW_MONITOR reply: | |
4168 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1 | |
4169 | OFPT_BARRIER_REPLY: | |
4170 | ]) | |
4171 | ||
4172 | # Add, delete, and modify some flows and check the updates. | |
4173 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
4174 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2 | |
4175 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5 | |
95a1c4ca SH |
4176 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6 |
4177 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7 | |
4178 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8 | |
4179 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9 | |
4180 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10 | |
4181 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11 | |
4182 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12 | |
4183 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13 | |
4184 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14 | |
4185 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15 | |
4186 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16 | |
4187 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17 | |
4188 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18 | |
4189 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19 | |
4190 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20 | |
4191 | ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21 | |
4192 | ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22 | |
4193 | ovs-ofctl add-flow br0 in_port=0,actions=output:23 | |
ee088a75 | 4194 | ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3 |
2b07c8b1 BP |
4195 | ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3 |
4196 | ovs-ofctl del-flows br0 dl_vlan=123 | |
4197 | ovs-ofctl del-flows br0 | |
4198 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
1637ebb2 | 4199 | AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0], |
2b07c8b1 BP |
4200 | [NXST_FLOW_MONITOR reply (xid=0x0): |
4201 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2 | |
4202 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4203 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5 | |
95a1c4ca SH |
4204 | NXST_FLOW_MONITOR reply (xid=0x0): |
4205 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6 | |
4206 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4207 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7 | |
4208 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4209 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8 | |
4210 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4211 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9 | |
4212 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4213 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10 | |
4214 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4215 | event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11 | |
4216 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4217 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12 | |
4218 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4219 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13 | |
4220 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4221 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14 | |
4222 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4223 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15 | |
4224 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4225 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16 | |
4226 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4227 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17 | |
4228 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4229 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18 | |
4230 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4231 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19 | |
4232 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4233 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20 | |
4234 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4235 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21 | |
4236 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4237 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22 | |
4238 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4239 | event=ADDED table=0 cookie=0 in_port=0 actions=output:23 | |
ee088a75 SH |
4240 | NXST_FLOW_MONITOR reply (xid=0x0): |
4241 | event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3 | |
4242 | event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3 | |
4243 | event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3 | |
2b07c8b1 BP |
4244 | NXST_FLOW_MONITOR reply (xid=0x0): |
4245 | event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3 | |
95a1c4ca SH |
4246 | event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3 |
4247 | event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3 | |
2b07c8b1 BP |
4248 | NXST_FLOW_MONITOR reply (xid=0x0): |
4249 | event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3 | |
95a1c4ca SH |
4250 | event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3 |
4251 | event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3 | |
2b07c8b1 | 4252 | NXST_FLOW_MONITOR reply (xid=0x0): |
32cd83a2 | 4253 | event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23 |
95a1c4ca | 4254 | event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20 |
32cd83a2 BP |
4255 | event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18 |
4256 | event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19 | |
2b07c8b1 | 4257 | event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2 |
95a1c4ca | 4258 | event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14 |
32cd83a2 | 4259 | event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12 |
95a1c4ca | 4260 | event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13 |
32cd83a2 BP |
4261 | event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21 |
4262 | event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22 | |
95a1c4ca | 4263 | event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11 |
2b07c8b1 BP |
4264 | OFPT_BARRIER_REPLY: |
4265 | ]) | |
4266 | ||
200d6ac4 SH |
4267 | # Check that our own changes are reported as full updates. |
4268 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
4269 | ovs-ofctl add-flow br0 in_port=1,actions=output:2 | |
4270 | ovs-ofctl add-flow br0 in_port=2,actions=output:1 | |
4271 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4272 | ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000 | |
4273 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4274 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply: | |
4275 | ]) | |
4276 | AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0], | |
4277 | [NXST_FLOW_MONITOR reply (xid=0x0): | |
4278 | event=ADDED table=0 cookie=0 in_port=1 actions=output:2 | |
4279 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4280 | event=ADDED table=0 cookie=0 in_port=2 actions=output:1 | |
4281 | OFPT_BARRIER_REPLY: | |
4282 | send: OFPT_FLOW_MOD: DEL priority=0 actions=drop | |
4283 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4284 | event=DELETED reason=delete table=0 cookie=0 in_port=1 actions=output:2 | |
4285 | event=DELETED reason=delete table=0 cookie=0 in_port=2 actions=output:1 | |
4286 | OFPT_BARRIER_REPLY: | |
4287 | ]) | |
4288 | ||
d9c8c57c | 4289 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
200d6ac4 SH |
4290 | OVS_VSWITCHD_STOP |
4291 | AT_CLEANUP | |
4292 | ||
4293 | AT_SETUP([ofproto - flow monitoring with !own]) | |
4294 | AT_KEYWORDS([monitor]) | |
4295 | OVS_VSWITCHD_START | |
4296 | ||
4297 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1 | |
4298 | ||
4299 | # Start a monitor watching the flow table and check the initial reply. | |
4300 | ovs-ofctl monitor br0 watch:\!own --detach --no-chdir --pidfile >monitor.log 2>&1 | |
4301 | AT_CAPTURE_FILE([monitor.log]) | |
4302 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4303 | AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0], | |
4304 | [NXST_FLOW_MONITOR reply: | |
4305 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1 | |
4306 | OFPT_BARRIER_REPLY: | |
4307 | ]) | |
4308 | ||
2b07c8b1 BP |
4309 | # Check that our own changes are reported as abbreviations. |
4310 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
4311 | ovs-ofctl add-flow br0 in_port=1,actions=output:2 | |
4312 | ovs-ofctl add-flow br0 in_port=2,actions=output:1 | |
90d721f0 | 4313 | ovs-appctl -t ovs-ofctl ofctl/barrier |
2b07c8b1 BP |
4314 | ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000 |
4315 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4316 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply: | |
4317 | ]) | |
4318 | AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0], | |
4319 | [NXST_FLOW_MONITOR reply (xid=0x0): | |
4320 | event=ADDED table=0 cookie=0 in_port=1 actions=output:2 | |
4321 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4322 | event=ADDED table=0 cookie=0 in_port=2 actions=output:1 | |
90d721f0 | 4323 | OFPT_BARRIER_REPLY: |
2b07c8b1 BP |
4324 | send: OFPT_FLOW_MOD: DEL priority=0 actions=drop |
4325 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4326 | event=ABBREV xid=0x12345678 | |
cdbdeeda SH |
4327 | OFPT_BARRIER_REPLY: |
4328 | ]) | |
4329 | ||
d9c8c57c | 4330 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
cdbdeeda SH |
4331 | OVS_VSWITCHD_STOP |
4332 | AT_CLEANUP | |
4333 | ||
4334 | AT_SETUP([ofproto - flow monitoring with out_port]) | |
4335 | AT_KEYWORDS([monitor]) | |
4336 | OVS_VSWITCHD_START | |
4337 | ||
4338 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=121,actions=output:1 | |
4339 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=122,actions=output:1 | |
4340 | ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:2 | |
4341 | ||
4342 | # Start a monitor watching the flow table and check the initial reply. | |
4343 | ovs-ofctl monitor br0 watch:out_port=2 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
4344 | AT_CAPTURE_FILE([monitor.log]) | |
4345 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4346 | AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0], | |
4347 | [NXST_FLOW_MONITOR reply: | |
4348 | event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2 | |
4349 | OFPT_BARRIER_REPLY: | |
4350 | ]) | |
4351 | ||
4352 | ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log | |
4353 | ||
4354 | # Add, modify flows and check the updates. | |
4355 | ovs-ofctl mod-flows br0 dl_vlan=121,actions=drop | |
4356 | ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1,output:2 | |
4357 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4358 | ||
4359 | ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:1,output:2 | |
4360 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4361 | ||
4362 | ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1 | |
4363 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4364 | ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:2 | |
4365 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4366 | ||
4367 | AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0], | |
4368 | [NXST_FLOW_MONITOR reply (xid=0x0): | |
4369 | event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1,output:2 | |
4370 | OFPT_BARRIER_REPLY: | |
4371 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4372 | event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1,output:2 | |
4373 | OFPT_BARRIER_REPLY: | |
4374 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4375 | event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1 | |
4376 | OFPT_BARRIER_REPLY: | |
4377 | NXST_FLOW_MONITOR reply (xid=0x0): | |
4378 | event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2 | |
2b07c8b1 BP |
4379 | OFPT_BARRIER_REPLY: |
4380 | ]) | |
4381 | ||
d9c8c57c | 4382 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
2b07c8b1 BP |
4383 | OVS_VSWITCHD_STOP |
4384 | AT_CLEANUP | |
4385 | ||
4386 | AT_SETUP([ofproto - flow monitoring pause and resume]) | |
4387 | AT_KEYWORDS([monitor]) | |
4388 | ||
46a80050 EM |
4389 | # The maximum socket receive buffer size is important for this test, which |
4390 | # tests behavior when the receive buffer overflows. | |
4391 | if test -e /proc/sys/net/core/rmem_max; then | |
4392 | # Linux | |
4393 | rmem_max=`cat /proc/sys/net/core/rmem_max` | |
4394 | elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then | |
f3326eeb | 4395 | : # FreeBSD, NetBSD |
46a80050 EM |
4396 | else |
4397 | # Don't know how to get maximum socket receive buffer on this OS | |
4398 | AT_SKIP_IF([:]) | |
4399 | fi | |
2b07c8b1 BP |
4400 | # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB |
4401 | # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c). | |
2b07c8b1 BP |
4402 | queue_size=`expr $rmem_max + 128 \* 1024` |
4403 | echo rmem_max=$rmem_max queue_size=$queue_size | |
4404 | ||
21aa35c3 BP |
4405 | # If there's too much queuing skip the test to avoid timing out. |
4406 | AT_SKIP_IF([test $rmem_max -gt 1048576]) | |
4407 | ||
2b07c8b1 BP |
4408 | # Each flow update message takes up at least 48 bytes of space in queues |
4409 | # and in practice more than that. | |
4410 | n_msgs=`expr $queue_size / 48` | |
4411 | echo n_msgs=$n_msgs | |
4412 | ||
4413 | OVS_VSWITCHD_START | |
4414 | ||
4415 | # Start a monitor watching the flow table, then make it block. | |
53eb8cb8 | 4416 | on_exit 'kill `cat ovs-ofctl.pid`' |
2b07c8b1 BP |
4417 | ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1 |
4418 | AT_CAPTURE_FILE([monitor.log]) | |
4419 | ovs-appctl -t ovs-ofctl ofctl/block | |
4420 | ||
4421 | # Add $n_msgs flows. | |
4422 | (echo "in_port=2,actions=output:2" | |
5c6d0628 | 4423 | ${PERL} -e ' |
2b07c8b1 BP |
4424 | for ($i = 0; $i < '$n_msgs'; $i++) { |
4425 | print "cookie=1,reg1=$i,actions=drop\n"; | |
4426 | } | |
4427 | ') > flows.txt | |
4428 | AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) | |
79b8c36c BP |
4429 | # Check that multipart flow dumps work properly: |
4430 | AT_CHECK([ovs-ofctl diff-flows br0 flows.txt]) | |
2b07c8b1 BP |
4431 | AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop]) |
4432 | AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2]) | |
4433 | AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1]) | |
4434 | ||
4435 | ovs-appctl -t ovs-ofctl ofctl/unblock | |
c4821629 YT |
4436 | |
4437 | # Wait for the connection resumed. | |
4438 | # A barrier doesn't work for this purpose. | |
4439 | # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html | |
4440 | # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html | |
4441 | OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log]) | |
2b07c8b1 | 4442 | |
d9c8c57c | 4443 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
2b07c8b1 BP |
4444 | |
4445 | # Check that the flow monitor reported the same number of flows | |
4446 | # added and deleted, but fewer than we actually added and deleted. | |
4447 | adds=`grep -c 'ADDED.*reg1=' monitor.log` | |
4448 | deletes=`grep -c 'DELETED.*reg1=' monitor.log` | |
4449 | echo adds=$adds deletes=$deletes | |
4450 | AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs]) | |
4451 | AT_CHECK([test $adds = $deletes]) | |
4452 | ||
d0ab8a1a BP |
4453 | # Check that the flow monitor reported everything in the expected order: |
4454 | # | |
4455 | # event=ADDED table=0 cookie=0x1 reg1=0x22 | |
4456 | # ... | |
4457 | # NXT_FLOW_MONITOR_PAUSED: | |
4458 | # ... | |
4459 | # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22 | |
4460 | # ... | |
4461 | # event=ADDED table=0 cookie=0x3 in_port=1 | |
4462 | # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2 | |
4463 | # NXT_FLOW_MONITOR_RESUMED: | |
4464 | # | |
4465 | # except that, between the PAUSED and RESUMED, the order of the ADDED | |
4466 | # and MODIFIED lines lines depends on hash order, that is, it varies | |
4467 | # as we change the hash function or change architecture. Therefore, | |
4468 | # we use a couple of tests below to accept both orders. | |
2b07c8b1 | 4469 | AT_CHECK([ofctl_strip < monitor.log | sed -n -e ' |
46a80050 | 4470 | /reg1=0x22$/p |
2b07c8b1 BP |
4471 | /cookie=0x[[23]]/p |
4472 | /NXT_FLOW_MONITOR_PAUSED:/p | |
4473 | /NXT_FLOW_MONITOR_RESUMED:/p | |
d0ab8a1a BP |
4474 | ' > monitor.log.subset]) |
4475 | AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl | |
4476 | event=ADDED table=0 cookie=0x1 reg1=0x22 | |
2b07c8b1 BP |
4477 | NXT_FLOW_MONITOR_PAUSED: |
4478 | event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22 | |
4479 | event=ADDED table=0 cookie=0x3 in_port=1 | |
d0ab8a1a BP |
4480 | NXT_FLOW_MONITOR_RESUMED: |
4481 | ]) | |
4482 | AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl | |
4483 | NXT_FLOW_MONITOR_PAUSED: | |
4484 | event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22 | |
2b07c8b1 BP |
4485 | event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2 |
4486 | NXT_FLOW_MONITOR_RESUMED: | |
4487 | ]) | |
4488 | ||
4489 | OVS_VSWITCHD_STOP | |
4490 | AT_CLEANUP | |
45156451 AC |
4491 | |
4492 | AT_SETUP([ofproto - event filtering (OpenFlow 1.3)]) | |
4493 | AT_KEYWORDS([monitor]) | |
4494 | OVS_VSWITCHD_START | |
4495 | ||
4496 | # Start a monitor, use the required protocol version | |
4497 | ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
4498 | AT_CAPTURE_FILE([monitor.log]) | |
4499 | ||
4500 | # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a) | |
4501 | ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a | |
4502 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
4503 | ||
4504 | # Check default setting | |
4505 | read -r -d '' expected <<'EOF' | |
4506 | EOF | |
4507 | ||
4508 | AT_CHECK([ofctl_strip < monitor.log], [], [dnl | |
4509 | send: OFPT_GET_ASYNC_REQUEST (OF1.3): | |
4510 | OFPT_GET_ASYNC_REPLY (OF1.3): | |
4511 | master: | |
4512 | PACKET_IN: no_match action | |
4513 | PORT_STATUS: add delete modify | |
4514 | FLOW_REMOVED: idle hard delete | |
904e5202 BP |
4515 | ROLE_STATUS: (off) |
4516 | TABLE_STATUS: (off) | |
4517 | REQUESTFORWARD: (off) | |
45156451 AC |
4518 | |
4519 | slave: | |
4520 | PACKET_IN: (off) | |
4521 | PORT_STATUS: add delete modify | |
4522 | FLOW_REMOVED: (off) | |
904e5202 BP |
4523 | ROLE_STATUS: (off) |
4524 | TABLE_STATUS: (off) | |
4525 | REQUESTFORWARD: (off) | |
45156451 AC |
4526 | OFPT_BARRIER_REPLY (OF1.3): |
4527 | ]) | |
4528 | ||
4529 | OVS_VSWITCHD_STOP | |
4530 | AT_CLEANUP | |
4abb8608 BP |
4531 | |
4532 | AT_SETUP([ofproto - ofport_request]) | |
4533 | OVS_VSWITCHD_START | |
ca5792f0 | 4534 | add_of_ports br0 1 2 3 |
4abb8608 BP |
4535 | |
4536 | set_and_check_specific_ofports () { | |
4537 | ovs-vsctl set Interface p1 ofport_request="$1" -- \ | |
4538 | set Interface p2 ofport_request="$2" -- \ | |
4539 | set Interface p3 ofport_request="$3" | |
4540 | ofports=`ovs-vsctl get Interface p1 ofport -- \ | |
4541 | get Interface p2 ofport -- \ | |
4542 | get Interface p3 ofport` | |
4543 | AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3 | |
4544 | ]) | |
4545 | } | |
4546 | for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do | |
4547 | for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do | |
4548 | echo ----------------------------------------------------------- | |
4549 | echo "Check changing port numbers from $pre to $post" | |
d08d51b9 JS |
4550 | set_and_check_specific_ofports $pre |
4551 | set_and_check_specific_ofports $post | |
4abb8608 BP |
4552 | done |
4553 | done | |
4554 | ||
4555 | ovs-vsctl del-port p3 | |
4556 | ||
4557 | set_and_check_poorly_specified_ofports () { | |
4558 | ovs-vsctl set Interface p1 ofport_request="$1" -- \ | |
4559 | set Interface p2 ofport_request="$2" | |
4560 | p1=`ovs-vsctl get Interface p1 ofport` | |
4561 | p2=`ovs-vsctl get Interface p2 ofport` | |
4562 | echo $p1 $p2 | |
4563 | ||
4564 | AT_CHECK([test "$p1" != "$p2"]) | |
4565 | if test "$1" = "$2" && test "$1" != '[[]]'; then | |
4566 | # One port number must be the requested one. | |
4567 | AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"]) | |
4568 | # The other port number must be different (already tested above). | |
4569 | else | |
641c6188 YT |
4570 | AT_CHECK([test "$1" = '[[]]' || test "$p1" = "$1"]) |
4571 | AT_CHECK([test "$2" = '[[]]' || test "$p2" = "$2"]) | |
4abb8608 BP |
4572 | fi |
4573 | } | |
4574 | for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \ | |
4575 | '1 1' '2 2'; do | |
4576 | for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \ | |
4577 | '1 1' '2 2'; do | |
4578 | echo ----------------------------------------------------------- | |
4579 | echo "Check changing port numbers from $pre to $post" | |
4580 | set_and_check_poorly_specified_ofports $pre | |
4581 | set_and_check_poorly_specified_ofports $post | |
4582 | done | |
4583 | done | |
4584 | OVS_VSWITCHD_STOP | |
4585 | AT_CLEANUP | |
777af88d AC |
4586 | |
4587 | ||
06d4d4b6 | 4588 | AT_SETUP([ofproto - bundle open (OpenFlow 1.4)]) |
777af88d AC |
4589 | AT_KEYWORDS([monitor]) |
4590 | OVS_VSWITCHD_START | |
4591 | ||
4592 | # Start a monitor, use the required protocol version | |
4593 | ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
4594 | AT_CAPTURE_FILE([monitor.log]) | |
4595 | ||
4596 | # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a) | |
1f42be1c | 4597 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02" |
777af88d | 4598 | ovs-appctl -t ovs-ofctl ofctl/barrier |
d9c8c57c | 4599 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
777af88d AC |
4600 | |
4601 | AT_CHECK([ofctl_strip < monitor.log], [], [dnl | |
4602 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4603 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered |
777af88d AC |
4604 | OFPT_BUNDLE_CONTROL (OF1.4): |
4605 | bundle_id=0x1 type=OPEN_REPLY flags=0 | |
4606 | OFPT_BARRIER_REPLY (OF1.4): | |
4607 | ]) | |
4608 | ||
4609 | OVS_VSWITCHD_STOP | |
4610 | AT_CLEANUP | |
4611 | ||
06d4d4b6 | 4612 | AT_SETUP([ofproto - bundle double open (OpenFlow 1.4)]) |
777af88d AC |
4613 | AT_KEYWORDS([monitor]) |
4614 | OVS_VSWITCHD_START | |
4615 | ||
4616 | # Start a monitor, use the required protocol version | |
4617 | ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
4618 | AT_CAPTURE_FILE([monitor.log]) | |
4619 | ||
4620 | # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a) | |
1f42be1c | 4621 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02" |
777af88d | 4622 | ovs-appctl -t ovs-ofctl ofctl/barrier |
1f42be1c | 4623 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02" |
777af88d | 4624 | ovs-appctl -t ovs-ofctl ofctl/barrier |
d9c8c57c | 4625 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
777af88d AC |
4626 | |
4627 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
4628 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4629 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered |
777af88d AC |
4630 | OFPT_BUNDLE_CONTROL (OF1.4): |
4631 | bundle_id=0x1 type=OPEN_REPLY flags=0 | |
4632 | OFPT_BARRIER_REPLY (OF1.4): | |
4633 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4634 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered |
777af88d AC |
4635 | OFPT_ERROR (OF1.4): OFPBFC_BAD_ID |
4636 | OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4637 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered |
777af88d AC |
4638 | OFPT_BARRIER_REPLY (OF1.4): |
4639 | ]) | |
4640 | ||
4641 | OVS_VSWITCHD_STOP | |
4642 | AT_CLEANUP | |
4643 | ||
4644 | AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)]) | |
4645 | AT_KEYWORDS([monitor]) | |
4646 | OVS_VSWITCHD_START | |
4647 | ||
4648 | # Start a monitor, use the required protocol version | |
4649 | ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
4650 | AT_CAPTURE_FILE([monitor.log]) | |
4651 | ||
1f42be1c | 4652 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02" |
777af88d | 4653 | ovs-appctl -t ovs-ofctl ofctl/barrier |
d9c8c57c | 4654 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
777af88d AC |
4655 | |
4656 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
4657 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4658 | bundle_id=0x1 type=CLOSE_REQUEST flags=ordered |
777af88d AC |
4659 | OFPT_ERROR (OF1.4): OFPBFC_BAD_ID |
4660 | OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4661 | bundle_id=0x1 type=CLOSE_REQUEST flags=ordered |
777af88d AC |
4662 | OFPT_BARRIER_REPLY (OF1.4): |
4663 | ]) | |
4664 | ||
4665 | OVS_VSWITCHD_STOP | |
4666 | AT_CLEANUP | |
4667 | ||
4668 | AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)]) | |
4669 | AT_KEYWORDS([monitor]) | |
4670 | OVS_VSWITCHD_START | |
4671 | ||
4672 | # Start a monitor, use the required protocol version | |
4673 | ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
4674 | AT_CAPTURE_FILE([monitor.log]) | |
4675 | ||
4676 | # Open, Close, Close | |
1f42be1c | 4677 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02" |
777af88d | 4678 | ovs-appctl -t ovs-ofctl ofctl/barrier |
1f42be1c | 4679 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02" |
777af88d | 4680 | ovs-appctl -t ovs-ofctl ofctl/barrier |
1f42be1c | 4681 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02" |
777af88d | 4682 | ovs-appctl -t ovs-ofctl ofctl/barrier |
d9c8c57c | 4683 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
777af88d AC |
4684 | |
4685 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
4686 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4687 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered |
777af88d AC |
4688 | OFPT_BUNDLE_CONTROL (OF1.4): |
4689 | bundle_id=0x1 type=OPEN_REPLY flags=0 | |
4690 | OFPT_BARRIER_REPLY (OF1.4): | |
4691 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4692 | bundle_id=0x1 type=CLOSE_REQUEST flags=ordered |
777af88d AC |
4693 | OFPT_BUNDLE_CONTROL (OF1.4): |
4694 | bundle_id=0x1 type=CLOSE_REPLY flags=0 | |
4695 | OFPT_BARRIER_REPLY (OF1.4): | |
4696 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4697 | bundle_id=0x1 type=CLOSE_REQUEST flags=ordered |
777af88d AC |
4698 | OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED |
4699 | OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4700 | bundle_id=0x1 type=CLOSE_REQUEST flags=ordered |
777af88d AC |
4701 | OFPT_BARRIER_REPLY (OF1.4): |
4702 | ]) | |
4703 | ||
4704 | OVS_VSWITCHD_STOP | |
4705 | AT_CLEANUP | |
4706 | ||
4707 | AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)]) | |
4708 | AT_KEYWORDS([monitor]) | |
4709 | OVS_VSWITCHD_START | |
4710 | ||
4711 | # Start a monitor, use the required protocol version | |
4712 | ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
4713 | AT_CAPTURE_FILE([monitor.log]) | |
4714 | ||
68030e16 | 4715 | # Open, Close |
1f42be1c | 4716 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02" |
777af88d | 4717 | ovs-appctl -t ovs-ofctl ofctl/barrier |
1f42be1c | 4718 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01" |
777af88d | 4719 | ovs-appctl -t ovs-ofctl ofctl/barrier |
d9c8c57c | 4720 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
777af88d AC |
4721 | |
4722 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
4723 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4724 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered |
777af88d AC |
4725 | OFPT_BUNDLE_CONTROL (OF1.4): |
4726 | bundle_id=0x1 type=OPEN_REPLY flags=0 | |
4727 | OFPT_BARRIER_REPLY (OF1.4): | |
4728 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4729 | bundle_id=0x1 type=CLOSE_REQUEST flags=atomic |
777af88d AC |
4730 | OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS |
4731 | OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4732 | bundle_id=0x1 type=CLOSE_REQUEST flags=atomic |
777af88d AC |
4733 | OFPT_BARRIER_REPLY (OF1.4): |
4734 | ]) | |
4735 | ||
4736 | OVS_VSWITCHD_STOP | |
4737 | AT_CLEANUP | |
4738 | ||
4739 | AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)]) | |
4740 | AT_KEYWORDS([monitor]) | |
4741 | OVS_VSWITCHD_START | |
4742 | ||
4743 | # Start a monitor, use the required protocol version | |
4744 | ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
4745 | AT_CAPTURE_FILE([monitor.log]) | |
4746 | ||
68030e16 | 4747 | # Commit |
1f42be1c | 4748 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02" |
777af88d | 4749 | ovs-appctl -t ovs-ofctl ofctl/barrier |
d9c8c57c | 4750 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
777af88d AC |
4751 | |
4752 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
4753 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4754 | bundle_id=0x1 type=COMMIT_REQUEST flags=ordered |
777af88d AC |
4755 | OFPT_ERROR (OF1.4): OFPBFC_BAD_ID |
4756 | OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4757 | bundle_id=0x1 type=COMMIT_REQUEST flags=ordered |
777af88d AC |
4758 | OFPT_BARRIER_REPLY (OF1.4): |
4759 | ]) | |
4760 | ||
4761 | OVS_VSWITCHD_STOP | |
4762 | AT_CLEANUP | |
4763 | ||
4764 | AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)]) | |
4765 | AT_KEYWORDS([monitor]) | |
4766 | OVS_VSWITCHD_START | |
4767 | ||
4768 | # Start a monitor, use the required protocol version | |
4769 | ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
4770 | AT_CAPTURE_FILE([monitor.log]) | |
4771 | ||
68030e16 | 4772 | # Open, Commit |
1f42be1c | 4773 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02" |
777af88d | 4774 | ovs-appctl -t ovs-ofctl ofctl/barrier |
1f42be1c | 4775 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01" |
777af88d | 4776 | ovs-appctl -t ovs-ofctl ofctl/barrier |
d9c8c57c | 4777 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
777af88d AC |
4778 | |
4779 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
4780 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4781 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered |
777af88d AC |
4782 | OFPT_BUNDLE_CONTROL (OF1.4): |
4783 | bundle_id=0x1 type=OPEN_REPLY flags=0 | |
4784 | OFPT_BARRIER_REPLY (OF1.4): | |
4785 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4786 | bundle_id=0x1 type=COMMIT_REQUEST flags=atomic |
777af88d AC |
4787 | OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS |
4788 | OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4789 | bundle_id=0x1 type=COMMIT_REQUEST flags=atomic |
777af88d AC |
4790 | OFPT_BARRIER_REPLY (OF1.4): |
4791 | ]) | |
4792 | ||
4793 | OVS_VSWITCHD_STOP | |
4794 | AT_CLEANUP | |
4795 | ||
4796 | AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)]) | |
4797 | AT_KEYWORDS([monitor]) | |
4798 | OVS_VSWITCHD_START | |
4799 | ||
4800 | # Start a monitor, use the required protocol version | |
4801 | ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
4802 | AT_CAPTURE_FILE([monitor.log]) | |
4803 | ||
68030e16 | 4804 | # Discard |
1f42be1c | 4805 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 02" |
777af88d | 4806 | ovs-appctl -t ovs-ofctl ofctl/barrier |
d9c8c57c | 4807 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
777af88d AC |
4808 | |
4809 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
4810 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4811 | bundle_id=0x1 type=DISCARD_REQUEST flags=ordered |
777af88d AC |
4812 | OFPT_ERROR (OF1.4): OFPBFC_BAD_ID |
4813 | OFPT_BUNDLE_CONTROL (OF1.4): | |
1f42be1c | 4814 | bundle_id=0x1 type=DISCARD_REQUEST flags=ordered |
777af88d AC |
4815 | OFPT_BARRIER_REPLY (OF1.4): |
4816 | ]) | |
4817 | ||
4818 | OVS_VSWITCHD_STOP | |
4819 | AT_CLEANUP | |
db5076ee JR |
4820 | |
4821 | ||
4822 | AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.4)]) | |
db5076ee JR |
4823 | OVS_VSWITCHD_START |
4824 | ||
4825 | AT_CHECK([ovs-appctl vlog/set vconn:dbg]) | |
4826 | ||
4827 | AT_CHECK([ovs-ofctl del-flows br0]) | |
4828 | ||
4829 | AT_DATA([flows.txt], [dnl | |
4830 | add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1 | |
4831 | add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2 | |
4832 | add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3 | |
4833 | add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4 | |
4834 | delete | |
4835 | add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5 | |
4836 | add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6 | |
4837 | add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7 | |
4838 | delete in_port=2 dl_src=00:88:99:aa:bb:cc | |
4839 | ]) | |
4840 | ||
4841 | AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) | |
4842 | ||
4843 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
4844 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5 | |
4845 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6 | |
4846 | NXST_FLOW reply: | |
4847 | ]) | |
4848 | ||
4849 | AT_DATA([flows.txt], [dnl | |
4850 | modify actions=drop | |
4851 | modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7 | |
4852 | ]) | |
4853 | ||
4854 | AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) | |
4855 | ||
4856 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
4857 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
4858 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7 | |
4859 | NXST_FLOW reply: | |
4860 | ]) | |
4861 | ||
4862 | # Adding an existing flow acts as a modify, and delete_strict also works. | |
4863 | AT_DATA([flows.txt], [dnl | |
4864 | add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8 | |
4865 | delete_strict in_port=2 dl_src=00:66:77:88:99:aa | |
4866 | add in_port=2 dl_src=00:66:77:88:99:aa actions=drop | |
4867 | ]) | |
4868 | ||
4869 | AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) | |
4870 | ||
4871 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
4872 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8 | |
4873 | in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
4874 | NXST_FLOW reply: | |
4875 | ]) | |
4876 | ||
4877 | dnl Check logs for OpenFlow trace | |
4878 | # Prevent race. | |
38b0b29f | 4879 | OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3]) |
12e2ba2e | 4880 | AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl |
b79d45a1 BP |
4881 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
4882 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
db5076ee JR |
4883 | vconn|DBG|unix: received: OFPT_HELLO: |
4884 | version bitmap: 0x01 | |
b79d45a1 | 4885 | vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01) |
db5076ee JR |
4886 | vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop |
4887 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST: | |
4888 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: | |
b79d45a1 BP |
4889 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
4890 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
db5076ee | 4891 | vconn|DBG|unix: received: OFPT_HELLO (OF1.4): |
5f8c05ad | 4892 | version bitmap: 0x05 |
b79d45a1 | 4893 | vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x07 and earlier, peer supports version 0x05) |
db5076ee | 4894 | vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): |
39c94593 | 4895 | bundle_id=0 type=OPEN_REQUEST flags=atomic ordered |
db5076ee JR |
4896 | vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): |
4897 | bundle_id=0 type=OPEN_REPLY flags=0 | |
4898 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4899 | bundle_id=0 flags=atomic ordered |
db5076ee JR |
4900 | OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1 |
4901 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4902 | bundle_id=0 flags=atomic ordered |
db5076ee JR |
4903 | OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2 |
4904 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4905 | bundle_id=0 flags=atomic ordered |
db5076ee JR |
4906 | OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3 |
4907 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4908 | bundle_id=0 flags=atomic ordered |
db5076ee JR |
4909 | OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:4 |
4910 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4911 | bundle_id=0 flags=atomic ordered |
db5076ee JR |
4912 | OFPT_FLOW_MOD (OF1.4): DEL table:255 actions=drop |
4913 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4914 | bundle_id=0 flags=atomic ordered |
db5076ee JR |
4915 | OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:5 |
4916 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4917 | bundle_id=0 flags=atomic ordered |
db5076ee JR |
4918 | OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:6 |
4919 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4920 | bundle_id=0 flags=atomic ordered |
db5076ee JR |
4921 | OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7 |
4922 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4923 | bundle_id=0 flags=atomic ordered |
db5076ee | 4924 | OFPT_FLOW_MOD (OF1.4): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop |
506c1ddb JR |
4925 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4): |
4926 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4): | |
db5076ee | 4927 | vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): |
39c94593 | 4928 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered |
db5076ee JR |
4929 | vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): |
4930 | bundle_id=0 type=COMMIT_REPLY flags=0 | |
b79d45a1 BP |
4931 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
4932 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
db5076ee JR |
4933 | vconn|DBG|unix: received: OFPT_HELLO: |
4934 | version bitmap: 0x01 | |
b79d45a1 | 4935 | vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01) |
db5076ee JR |
4936 | vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm |
4937 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST: | |
4938 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: | |
4939 | vconn|DBG|unix: received: NXST_FLOW request: | |
4940 | vconn|DBG|unix: sent (Success): NXST_FLOW reply: | |
4941 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5 | |
4942 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6 | |
b79d45a1 BP |
4943 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
4944 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
db5076ee | 4945 | vconn|DBG|unix: received: OFPT_HELLO (OF1.4): |
5f8c05ad | 4946 | version bitmap: 0x05 |
b79d45a1 | 4947 | vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x07 and earlier, peer supports version 0x05) |
db5076ee | 4948 | vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): |
39c94593 | 4949 | bundle_id=0 type=OPEN_REQUEST flags=atomic ordered |
db5076ee JR |
4950 | vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): |
4951 | bundle_id=0 type=OPEN_REPLY flags=0 | |
4952 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4953 | bundle_id=0 flags=atomic ordered |
db5076ee JR |
4954 | OFPT_FLOW_MOD (OF1.4): MOD actions=drop |
4955 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4956 | bundle_id=0 flags=atomic ordered |
db5076ee | 4957 | OFPT_FLOW_MOD (OF1.4): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7 |
506c1ddb JR |
4958 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4): |
4959 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4): | |
db5076ee | 4960 | vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): |
39c94593 | 4961 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered |
db5076ee JR |
4962 | vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): |
4963 | bundle_id=0 type=COMMIT_REPLY flags=0 | |
b79d45a1 BP |
4964 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
4965 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
db5076ee JR |
4966 | vconn|DBG|unix: received: OFPT_HELLO: |
4967 | version bitmap: 0x01 | |
b79d45a1 | 4968 | vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01) |
db5076ee JR |
4969 | vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm |
4970 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST: | |
4971 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: | |
4972 | vconn|DBG|unix: received: NXST_FLOW request: | |
4973 | vconn|DBG|unix: sent (Success): NXST_FLOW reply: | |
4974 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
4975 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7 | |
b79d45a1 BP |
4976 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
4977 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
db5076ee | 4978 | vconn|DBG|unix: received: OFPT_HELLO (OF1.4): |
5f8c05ad | 4979 | version bitmap: 0x05 |
b79d45a1 | 4980 | vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x07 and earlier, peer supports version 0x05) |
db5076ee | 4981 | vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): |
39c94593 | 4982 | bundle_id=0 type=OPEN_REQUEST flags=atomic ordered |
db5076ee JR |
4983 | vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): |
4984 | bundle_id=0 type=OPEN_REPLY flags=0 | |
4985 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4986 | bundle_id=0 flags=atomic ordered |
db5076ee JR |
4987 | OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8 |
4988 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4989 | bundle_id=0 flags=atomic ordered |
db5076ee JR |
4990 | OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop |
4991 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 4992 | bundle_id=0 flags=atomic ordered |
db5076ee | 4993 | OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop |
506c1ddb JR |
4994 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4): |
4995 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4): | |
db5076ee | 4996 | vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): |
39c94593 | 4997 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered |
db5076ee JR |
4998 | vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): |
4999 | bundle_id=0 type=COMMIT_REPLY flags=0 | |
b79d45a1 BP |
5000 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
5001 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
db5076ee JR |
5002 | vconn|DBG|unix: received: OFPT_HELLO: |
5003 | version bitmap: 0x01 | |
b79d45a1 | 5004 | vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01) |
db5076ee JR |
5005 | vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm |
5006 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST: | |
5007 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: | |
5008 | vconn|DBG|unix: received: NXST_FLOW request: | |
5009 | vconn|DBG|unix: sent (Success): NXST_FLOW reply: | |
5010 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8 | |
5011 | in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
5012 | ]) | |
5013 | ||
0c78eebe JR |
5014 | AT_CHECK([grep " flow_mods in the last " ovs-vswitchd.log | sed -e 's/^.*connmgr|INFO|//'], [0], [dnl |
5015 | br0<->unix: 1 flow_mods in the last 0 s (1 deletes) | |
5016 | br0<->unix: 9 flow_mods in the last 0 s (7 adds, 2 deletes) | |
5017 | br0<->unix: 2 flow_mods in the last 0 s (2 modifications) | |
5018 | br0<->unix: 3 flow_mods in the last 0 s (2 adds, 1 deletes) | |
5019 | ]) | |
5020 | ||
db5076ee JR |
5021 | OVS_VSWITCHD_STOP |
5022 | AT_CLEANUP | |
5023 | ||
5024 | ||
5025 | AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.4)]) | |
db5076ee JR |
5026 | OVS_VSWITCHD_START |
5027 | ||
5028 | AT_CHECK([ovs-ofctl del-flows br0]) | |
5029 | ||
5030 | ovs-ofctl add-flows br0 - <<EOF | |
5031 | idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=11 | |
5032 | idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=22 | |
5033 | idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=33 | |
5034 | EOF | |
5035 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
5036 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11 | |
5037 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22 | |
5038 | idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33 | |
5039 | NXST_FLOW reply: | |
5040 | ]) | |
5041 | ||
5042 | # last line uses illegal table number (OVS internal table) | |
5043 | AT_DATA([flows.txt], [dnl | |
5044 | add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1 | |
5045 | add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2 | |
5046 | add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3 | |
5047 | modify idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4 | |
5048 | delete | |
5049 | add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5 | |
5050 | add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6 | |
5051 | add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7 | |
5052 | delete in_port=2 dl_src=00:88:99:aa:bb:cc | |
5053 | add table=254 actions=drop | |
5054 | ]) | |
5055 | ||
506c1ddb | 5056 | AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt 2>&1 | sed '/talking to/,$d'], |
b0065993 | 5057 | [0], [dnl |
506c1ddb | 5058 | Error OFPBRC_EPERM for: OFPT_FLOW_MOD (OF1.4) (xid=0xb): ADD table:254 actions=drop |
db5076ee JR |
5059 | ]) |
5060 | ||
5061 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
5062 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11 | |
5063 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22 | |
5064 | idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33 | |
5065 | NXST_FLOW reply: | |
5066 | ]) | |
5067 | ||
5068 | OVS_VSWITCHD_STOP | |
5069 | AT_CLEANUP | |
51bb26fa JR |
5070 | |
5071 | ||
5072 | AT_SETUP([ofproto - bundle timeout (OpenFlow 1.4)]) | |
5073 | AT_KEYWORDS([monitor]) | |
5074 | OVS_VSWITCHD_START | |
5075 | ||
5076 | # Start a monitor, use the required protocol version | |
5077 | ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
5078 | AT_CAPTURE_FILE([monitor.log]) | |
5079 | ||
5080 | ovs-appctl time/stop | |
5081 | ||
5082 | # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (01) | |
5083 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 01 00 00 00 01 00 00 00 03" | |
5084 | ovs-appctl time/warp 8000 | |
5085 | # Send a bundle flow mod, it should keep the bundle alive. | |
5086 | ovs-appctl -t ovs-ofctl ofctl/send "05 22 00 a0 00 00 00 02 00 00 00 01 00 00 00 03 \ | |
5087 | 05 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \ | |
5088 | 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \ | |
5089 | ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \ | |
5090 | 00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \ | |
5091 | 50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \ | |
5092 | 80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \ | |
5093 | 00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \ | |
5094 | 00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \ | |
5095 | 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \ | |
5096 | " | |
5097 | ovs-appctl time/warp 8000 | |
5098 | # Send a bundle close, it should keep the bundle alive. | |
5099 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 03 00 00 00 01 00 02 00 03" | |
5100 | ovs-appctl time/warp 11000 | |
5101 | # Make sure that timeouts are processed after the expiry | |
5102 | ovs-appctl time/warp 1000 | |
5103 | # Send a Commit, but too late. | |
5104 | ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 04 00 00 00 01 00 04 00 03" | |
5105 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
5106 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) | |
5107 | ||
5108 | AT_CHECK([ofctl_strip < monitor.log], [], [dnl | |
5109 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
5110 | bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered | |
5111 | OFPT_BUNDLE_CONTROL (OF1.4): | |
5112 | bundle_id=0x1 type=OPEN_REPLY flags=0 | |
5113 | send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
5114 | bundle_id=0x1 flags=atomic ordered | |
5115 | OFPT_FLOW_MOD (OF1.4): ADD table:1 priority=65535,arp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2 actions=output:3 | |
5116 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
5117 | bundle_id=0x1 type=CLOSE_REQUEST flags=atomic ordered | |
5118 | OFPT_BUNDLE_CONTROL (OF1.4): | |
5119 | bundle_id=0x1 type=CLOSE_REPLY flags=0 | |
5120 | OFPT_ERROR (OF1.4): OFPBFC_TIMEOUT | |
5121 | OFPT_BUNDLE_CONTROL (OF1.4): | |
5122 | bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered | |
5123 | send: OFPT_BUNDLE_CONTROL (OF1.4): | |
5124 | bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered | |
5125 | OFPT_ERROR (OF1.4): OFPBFC_BAD_ID | |
5126 | OFPT_BUNDLE_CONTROL (OF1.4): | |
5127 | bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered | |
5128 | OFPT_BARRIER_REPLY (OF1.4): | |
5129 | ]) | |
5130 | ||
5131 | OVS_VSWITCHD_STOP | |
5132 | AT_CLEANUP | |
06d4d4b6 JR |
5133 | |
5134 | ||
5135 | AT_SETUP([ofproto - bundle open (OpenFlow 1.3)]) | |
5136 | AT_KEYWORDS([monitor]) | |
5137 | OVS_VSWITCHD_START | |
5138 | ||
5139 | # Start a monitor, use the required protocol version | |
5140 | ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
5141 | AT_CAPTURE_FILE([monitor.log]) | |
5142 | ||
5143 | # Send an OpenFlow13 message (04), OFPT_EXPERIMENTER (04), length (0018), | |
5144 | # xid (0000000a), ONF_EXPERIMENTER_ID (4F4E4600), | |
5145 | # ONFT_BUNDLE_CONTROL (2300 = 0x08FC), bundle id (00000001), | |
5146 | # message type (0000), and flags (0002) | |
5147 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 00 00 02" | |
5148 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 5149 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
06d4d4b6 JR |
5150 | |
5151 | AT_CHECK([ofctl_strip < monitor.log], [], [dnl | |
5152 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5153 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered | |
5154 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5155 | bundle_id=0x1 type=OPEN_REPLY flags=0 | |
5156 | OFPT_BARRIER_REPLY (OF1.3): | |
5157 | ]) | |
5158 | ||
5159 | OVS_VSWITCHD_STOP | |
5160 | AT_CLEANUP | |
5161 | ||
5162 | AT_SETUP([ofproto - bundle double open (OpenFlow 1.3)]) | |
5163 | AT_KEYWORDS([monitor]) | |
5164 | OVS_VSWITCHD_START | |
5165 | ||
5166 | # Start a monitor, use the required protocol version | |
5167 | ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
5168 | AT_CAPTURE_FILE([monitor.log]) | |
5169 | ||
5170 | # Send twice an OpenFlow13 message (04), OFPT_EXPERIMENTER (04), length (0018), | |
5171 | # xid (0000000a), ONF_EXPERIMENTER_ID (4F4E4600), | |
5172 | # ONFT_BUNDLE_CONTROL (2300 = 0x08FC), bundle id (00000001), | |
5173 | # message type (0000), and flags (0002) | |
5174 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 00 00 02" | |
5175 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
5176 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 00 00 02" | |
5177 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 5178 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
06d4d4b6 JR |
5179 | |
5180 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
5181 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5182 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered | |
5183 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5184 | bundle_id=0x1 type=OPEN_REPLY flags=0 | |
5185 | OFPT_BARRIER_REPLY (OF1.3): | |
5186 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5187 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered | |
5188 | OFPT_ERROR (OF1.3): OFPBFC_BAD_ID | |
5189 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5190 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered | |
5191 | OFPT_BARRIER_REPLY (OF1.3): | |
5192 | ]) | |
5193 | ||
5194 | OVS_VSWITCHD_STOP | |
5195 | AT_CLEANUP | |
5196 | ||
5197 | AT_SETUP([ofproto - bundle close without open (OpenFlow 1.3)]) | |
5198 | AT_KEYWORDS([monitor]) | |
5199 | OVS_VSWITCHD_START | |
5200 | ||
5201 | # Start a monitor, use the required protocol version | |
5202 | ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
5203 | AT_CAPTURE_FILE([monitor.log]) | |
5204 | ||
5205 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 02 00 02" | |
5206 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 5207 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
06d4d4b6 JR |
5208 | |
5209 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
5210 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5211 | bundle_id=0x1 type=CLOSE_REQUEST flags=ordered | |
5212 | OFPT_ERROR (OF1.3): OFPBFC_BAD_ID | |
5213 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5214 | bundle_id=0x1 type=CLOSE_REQUEST flags=ordered | |
5215 | OFPT_BARRIER_REPLY (OF1.3): | |
5216 | ]) | |
5217 | ||
5218 | OVS_VSWITCHD_STOP | |
5219 | AT_CLEANUP | |
5220 | ||
5221 | AT_SETUP([ofproto - bundle double close (OpenFlow 1.3)]) | |
5222 | AT_KEYWORDS([monitor]) | |
5223 | OVS_VSWITCHD_START | |
5224 | ||
5225 | # Start a monitor, use the required protocol version | |
5226 | ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
5227 | AT_CAPTURE_FILE([monitor.log]) | |
5228 | ||
5229 | # Open, Close, Close | |
5230 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 00 00 02" | |
5231 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
5232 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 02 00 02" | |
5233 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
5234 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 02 00 02" | |
5235 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 5236 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
06d4d4b6 JR |
5237 | |
5238 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
5239 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5240 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered | |
5241 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5242 | bundle_id=0x1 type=OPEN_REPLY flags=0 | |
5243 | OFPT_BARRIER_REPLY (OF1.3): | |
5244 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5245 | bundle_id=0x1 type=CLOSE_REQUEST flags=ordered | |
5246 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5247 | bundle_id=0x1 type=CLOSE_REPLY flags=0 | |
5248 | OFPT_BARRIER_REPLY (OF1.3): | |
5249 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5250 | bundle_id=0x1 type=CLOSE_REQUEST flags=ordered | |
5251 | OFPT_ERROR (OF1.3): OFPBFC_BUNDLE_CLOSED | |
5252 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5253 | bundle_id=0x1 type=CLOSE_REQUEST flags=ordered | |
5254 | OFPT_BARRIER_REPLY (OF1.3): | |
5255 | ]) | |
5256 | ||
5257 | OVS_VSWITCHD_STOP | |
5258 | AT_CLEANUP | |
5259 | ||
5260 | AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.3)]) | |
5261 | AT_KEYWORDS([monitor]) | |
5262 | OVS_VSWITCHD_START | |
5263 | ||
5264 | # Start a monitor, use the required protocol version | |
5265 | ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
5266 | AT_CAPTURE_FILE([monitor.log]) | |
5267 | ||
5268 | # Open, Close | |
5269 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 00 00 02" | |
5270 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
5271 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 02 00 01" | |
5272 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 5273 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
06d4d4b6 JR |
5274 | |
5275 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
5276 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5277 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered | |
5278 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5279 | bundle_id=0x1 type=OPEN_REPLY flags=0 | |
5280 | OFPT_BARRIER_REPLY (OF1.3): | |
5281 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5282 | bundle_id=0x1 type=CLOSE_REQUEST flags=atomic | |
5283 | OFPT_ERROR (OF1.3): OFPBFC_BAD_FLAGS | |
5284 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5285 | bundle_id=0x1 type=CLOSE_REQUEST flags=atomic | |
5286 | OFPT_BARRIER_REPLY (OF1.3): | |
5287 | ]) | |
5288 | ||
5289 | OVS_VSWITCHD_STOP | |
5290 | AT_CLEANUP | |
5291 | ||
5292 | AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.3)]) | |
5293 | AT_KEYWORDS([monitor]) | |
5294 | OVS_VSWITCHD_START | |
5295 | ||
5296 | # Start a monitor, use the required protocol version | |
5297 | ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
5298 | AT_CAPTURE_FILE([monitor.log]) | |
5299 | ||
5300 | # Commit | |
5301 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 04 00 02" | |
5302 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 5303 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
06d4d4b6 JR |
5304 | |
5305 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
5306 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5307 | bundle_id=0x1 type=COMMIT_REQUEST flags=ordered | |
5308 | OFPT_ERROR (OF1.3): OFPBFC_BAD_ID | |
5309 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5310 | bundle_id=0x1 type=COMMIT_REQUEST flags=ordered | |
5311 | OFPT_BARRIER_REPLY (OF1.3): | |
5312 | ]) | |
5313 | ||
5314 | OVS_VSWITCHD_STOP | |
5315 | AT_CLEANUP | |
5316 | ||
5317 | AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.3)]) | |
5318 | AT_KEYWORDS([monitor]) | |
5319 | OVS_VSWITCHD_START | |
5320 | ||
5321 | # Start a monitor, use the required protocol version | |
5322 | ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
5323 | AT_CAPTURE_FILE([monitor.log]) | |
5324 | ||
5325 | # Open, Commit | |
5326 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 00 00 02" | |
5327 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
5328 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 04 00 01" | |
5329 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 5330 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
06d4d4b6 JR |
5331 | |
5332 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
5333 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5334 | bundle_id=0x1 type=OPEN_REQUEST flags=ordered | |
5335 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5336 | bundle_id=0x1 type=OPEN_REPLY flags=0 | |
5337 | OFPT_BARRIER_REPLY (OF1.3): | |
5338 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5339 | bundle_id=0x1 type=COMMIT_REQUEST flags=atomic | |
5340 | OFPT_ERROR (OF1.3): OFPBFC_BAD_FLAGS | |
5341 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5342 | bundle_id=0x1 type=COMMIT_REQUEST flags=atomic | |
5343 | OFPT_BARRIER_REPLY (OF1.3): | |
5344 | ]) | |
5345 | ||
5346 | OVS_VSWITCHD_STOP | |
5347 | AT_CLEANUP | |
5348 | ||
5349 | AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.3)]) | |
5350 | AT_KEYWORDS([monitor]) | |
5351 | OVS_VSWITCHD_START | |
5352 | ||
5353 | # Start a monitor, use the required protocol version | |
5354 | ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 | |
5355 | AT_CAPTURE_FILE([monitor.log]) | |
5356 | ||
5357 | # Discard | |
5358 | ovs-appctl -t ovs-ofctl ofctl/send "04 04 00 18 00 00 00 0a 4F 4E 46 00 00 00 08 FC 00 00 00 01 00 06 00 02" | |
5359 | ovs-appctl -t ovs-ofctl ofctl/barrier | |
d9c8c57c | 5360 | OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) |
06d4d4b6 JR |
5361 | |
5362 | AT_CHECK([ofctl_strip < monitor.log], [0], [dnl | |
5363 | send: ONFT_BUNDLE_CONTROL (OF1.3): | |
5364 | bundle_id=0x1 type=DISCARD_REQUEST flags=ordered | |
5365 | OFPT_ERROR (OF1.3): OFPBFC_BAD_ID | |
5366 | ONFT_BUNDLE_CONTROL (OF1.3): | |
5367 | bundle_id=0x1 type=DISCARD_REQUEST flags=ordered | |
5368 | OFPT_BARRIER_REPLY (OF1.3): | |
5369 | ]) | |
5370 | ||
5371 | OVS_VSWITCHD_STOP | |
5372 | AT_CLEANUP | |
5373 | ||
5374 | ||
5375 | AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.3)]) | |
06d4d4b6 JR |
5376 | OVS_VSWITCHD_START |
5377 | ||
5378 | AT_CHECK([ovs-appctl vlog/set vconn:dbg]) | |
5379 | ||
5380 | AT_CHECK([ovs-ofctl del-flows br0]) | |
5381 | ||
5382 | AT_DATA([flows.txt], [dnl | |
5383 | add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1 | |
5384 | add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2 | |
5385 | add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3 | |
5386 | add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4 | |
5387 | delete | |
5388 | add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5 | |
5389 | add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6 | |
5390 | add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7 | |
5391 | delete in_port=2 dl_src=00:88:99:aa:bb:cc | |
5392 | ]) | |
5393 | ||
5394 | AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle add-flows br0 flows.txt]) | |
5395 | ||
5396 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
5397 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5 | |
5398 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6 | |
5399 | NXST_FLOW reply: | |
5400 | ]) | |
5401 | ||
5402 | AT_DATA([flows.txt], [dnl | |
5403 | modify actions=drop | |
5404 | modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7 | |
5405 | ]) | |
5406 | ||
5407 | AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle add-flows br0 flows.txt]) | |
5408 | ||
5409 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
5410 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
5411 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7 | |
5412 | NXST_FLOW reply: | |
5413 | ]) | |
5414 | ||
5415 | # Adding an existing flow acts as a modify, and delete_strict also works. | |
5416 | AT_DATA([flows.txt], [dnl | |
5417 | add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8 | |
5418 | delete_strict in_port=2 dl_src=00:66:77:88:99:aa | |
5419 | add in_port=2 dl_src=00:66:77:88:99:aa actions=drop | |
5420 | ]) | |
5421 | ||
5422 | AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle add-flows br0 flows.txt]) | |
5423 | ||
5424 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
5425 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8 | |
5426 | in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
5427 | NXST_FLOW reply: | |
5428 | ]) | |
5429 | ||
5430 | dnl Check logs for OpenFlow trace | |
5431 | # Prevent race. | |
5432 | OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3]) | |
5433 | AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl | |
b79d45a1 BP |
5434 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
5435 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
06d4d4b6 JR |
5436 | vconn|DBG|unix: received: OFPT_HELLO: |
5437 | version bitmap: 0x01 | |
b79d45a1 | 5438 | vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01) |
06d4d4b6 JR |
5439 | vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop |
5440 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST: | |
5441 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: | |
b79d45a1 BP |
5442 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
5443 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
06d4d4b6 JR |
5444 | vconn|DBG|unix: received: OFPT_HELLO (OF1.3): |
5445 | version bitmap: 0x04 | |
b79d45a1 | 5446 | vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x07 and earlier, peer supports version 0x04) |
06d4d4b6 JR |
5447 | vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3): |
5448 | bundle_id=0 type=OPEN_REQUEST flags=atomic ordered | |
5449 | vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3): | |
5450 | bundle_id=0 type=OPEN_REPLY flags=0 | |
5451 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5452 | bundle_id=0 flags=atomic ordered | |
5453 | OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1 | |
5454 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5455 | bundle_id=0 flags=atomic ordered | |
5456 | OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2 | |
5457 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5458 | bundle_id=0 flags=atomic ordered | |
5459 | OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3 | |
5460 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5461 | bundle_id=0 flags=atomic ordered | |
5462 | OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:4 | |
5463 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5464 | bundle_id=0 flags=atomic ordered | |
5465 | OFPT_FLOW_MOD (OF1.3): DEL table:255 actions=drop | |
5466 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5467 | bundle_id=0 flags=atomic ordered | |
5468 | OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:5 | |
5469 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5470 | bundle_id=0 flags=atomic ordered | |
5471 | OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:6 | |
5472 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5473 | bundle_id=0 flags=atomic ordered | |
5474 | OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7 | |
5475 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5476 | bundle_id=0 flags=atomic ordered | |
5477 | OFPT_FLOW_MOD (OF1.3): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop | |
506c1ddb JR |
5478 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.3): |
5479 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.3): | |
06d4d4b6 JR |
5480 | vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3): |
5481 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered | |
5482 | vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3): | |
5483 | bundle_id=0 type=COMMIT_REPLY flags=0 | |
b79d45a1 BP |
5484 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
5485 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
06d4d4b6 JR |
5486 | vconn|DBG|unix: received: OFPT_HELLO: |
5487 | version bitmap: 0x01 | |
b79d45a1 | 5488 | vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01) |
06d4d4b6 JR |
5489 | vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm |
5490 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST: | |
5491 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: | |
5492 | vconn|DBG|unix: received: NXST_FLOW request: | |
5493 | vconn|DBG|unix: sent (Success): NXST_FLOW reply: | |
5494 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5 | |
5495 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6 | |
b79d45a1 BP |
5496 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
5497 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
06d4d4b6 JR |
5498 | vconn|DBG|unix: received: OFPT_HELLO (OF1.3): |
5499 | version bitmap: 0x04 | |
b79d45a1 | 5500 | vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x07 and earlier, peer supports version 0x04) |
06d4d4b6 JR |
5501 | vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3): |
5502 | bundle_id=0 type=OPEN_REQUEST flags=atomic ordered | |
5503 | vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3): | |
5504 | bundle_id=0 type=OPEN_REPLY flags=0 | |
5505 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5506 | bundle_id=0 flags=atomic ordered | |
5507 | OFPT_FLOW_MOD (OF1.3): MOD actions=drop | |
5508 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5509 | bundle_id=0 flags=atomic ordered | |
5510 | OFPT_FLOW_MOD (OF1.3): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7 | |
506c1ddb JR |
5511 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.3): |
5512 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.3): | |
06d4d4b6 JR |
5513 | vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3): |
5514 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered | |
5515 | vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3): | |
5516 | bundle_id=0 type=COMMIT_REPLY flags=0 | |
b79d45a1 BP |
5517 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
5518 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
06d4d4b6 JR |
5519 | vconn|DBG|unix: received: OFPT_HELLO: |
5520 | version bitmap: 0x01 | |
b79d45a1 | 5521 | vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01) |
06d4d4b6 JR |
5522 | vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm |
5523 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST: | |
5524 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: | |
5525 | vconn|DBG|unix: received: NXST_FLOW request: | |
5526 | vconn|DBG|unix: sent (Success): NXST_FLOW reply: | |
5527 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
5528 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7 | |
b79d45a1 BP |
5529 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
5530 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
06d4d4b6 JR |
5531 | vconn|DBG|unix: received: OFPT_HELLO (OF1.3): |
5532 | version bitmap: 0x04 | |
b79d45a1 | 5533 | vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x07 and earlier, peer supports version 0x04) |
06d4d4b6 JR |
5534 | vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3): |
5535 | bundle_id=0 type=OPEN_REQUEST flags=atomic ordered | |
5536 | vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3): | |
5537 | bundle_id=0 type=OPEN_REPLY flags=0 | |
5538 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5539 | bundle_id=0 flags=atomic ordered | |
5540 | OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8 | |
5541 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5542 | bundle_id=0 flags=atomic ordered | |
5543 | OFPT_FLOW_MOD (OF1.3): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
5544 | vconn|DBG|unix: received: ONFT_BUNDLE_ADD_MESSAGE (OF1.3): | |
5545 | bundle_id=0 flags=atomic ordered | |
5546 | OFPT_FLOW_MOD (OF1.3): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
506c1ddb JR |
5547 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.3): |
5548 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.3): | |
06d4d4b6 JR |
5549 | vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3): |
5550 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered | |
5551 | vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3): | |
5552 | bundle_id=0 type=COMMIT_REPLY flags=0 | |
b79d45a1 BP |
5553 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6): |
5554 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 | |
06d4d4b6 JR |
5555 | vconn|DBG|unix: received: OFPT_HELLO: |
5556 | version bitmap: 0x01 | |
b79d45a1 | 5557 | vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01) |
06d4d4b6 JR |
5558 | vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm |
5559 | vconn|DBG|unix: received: OFPT_BARRIER_REQUEST: | |
5560 | vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: | |
5561 | vconn|DBG|unix: received: NXST_FLOW request: | |
5562 | vconn|DBG|unix: sent (Success): NXST_FLOW reply: | |
5563 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8 | |
5564 | in_port=2,dl_src=00:66:77:88:99:aa actions=drop | |
5565 | ]) | |
5566 | ||
5567 | OVS_VSWITCHD_STOP | |
5568 | AT_CLEANUP | |
5569 | ||
5570 | ||
506c1ddb | 5571 | AT_SETUP([ofproto - failing bundle add message (OpenFlow 1.3)]) |
06d4d4b6 JR |
5572 | OVS_VSWITCHD_START |
5573 | ||
5574 | AT_CHECK([ovs-ofctl del-flows br0]) | |
5575 | ||
5576 | ovs-ofctl add-flows br0 - <<EOF | |
5577 | idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=11 | |
5578 | idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=22 | |
5579 | idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=33 | |
5580 | EOF | |
5581 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
5582 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11 | |
5583 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22 | |
5584 | idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33 | |
5585 | NXST_FLOW reply: | |
5586 | ]) | |
5587 | ||
5588 | # last line uses illegal table number (OVS internal table) | |
5589 | AT_DATA([flows.txt], [dnl | |
5590 | add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1 | |
5591 | add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2 | |
5592 | add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3 | |
5593 | modify idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4 | |
5594 | delete | |
5595 | add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5 | |
5596 | add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6 | |
5597 | add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7 | |
5598 | delete in_port=2 dl_src=00:88:99:aa:bb:cc | |
5599 | add table=254 actions=drop | |
5600 | ]) | |
5601 | ||
506c1ddb | 5602 | AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle add-flows br0 flows.txt 2>&1 | sed '/talking to/,$d'], |
06d4d4b6 | 5603 | [0], [dnl |
506c1ddb | 5604 | Error OFPBRC_EPERM for: OFPT_FLOW_MOD (OF1.3) (xid=0xb): ADD table:254 actions=drop |
06d4d4b6 JR |
5605 | ]) |
5606 | ||
5607 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
5608 | idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11 | |
5609 | idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22 | |
5610 | idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33 | |
5611 | NXST_FLOW reply: | |
5612 | ]) | |
5613 | ||
5614 | OVS_VSWITCHD_STOP | |
5615 | AT_CLEANUP | |
25070e04 JR |
5616 | |
5617 | ||
5618 | AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.3)]) | |
25070e04 JR |
5619 | OVS_VSWITCHD_START |
5620 | ||
5621 | AT_CHECK([ovs-ofctl del-flows br0]) | |
5622 | ||
5623 | # Invalid group numbers are detected at commit time | |
5624 | AT_DATA([flows.txt], [dnl | |
5625 | add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=group:1 | |
5626 | add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=group:2 | |
5627 | add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=group:3 | |
5628 | ]) | |
5629 | ||
5630 | AT_CHECK([ovs-ofctl -O OpenFlow13 --bundle add-flows br0 flows.txt 2>&1 | sed '/talking to/,$d'], | |
5631 | [0], [dnl | |
5632 | Error OFPBAC_BAD_OUT_GROUP for: OFPT_FLOW_MOD (OF1.3) (xid=0x2): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=group:1 | |
5633 | Error OFPBFC_MSG_FAILED for: ONFT_BUNDLE_CONTROL (OF1.3) (xid=0x7): | |
5634 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered | |
5635 | ]) | |
5636 | ||
5637 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl | |
5638 | NXST_FLOW reply: | |
5639 | ]) | |
5640 | ||
5641 | OVS_VSWITCHD_STOP | |
5642 | AT_CLEANUP |