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