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