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