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