]> git.proxmox.com Git - mirror_ovs.git/blame - tests/ofproto.at
flow: Enable matching on new field 'pkt_mark'.
[mirror_ovs.git] / tests / ofproto.at
CommitLineData
a2cb9dfd
BP
1AT_BANNER([ofproto])
2
a2cb9dfd 3AT_SETUP([ofproto - echo request])
023e1e0a 4OVS_VSWITCHD_START
ea523221 5AT_CHECK([ovs-ofctl -vwarn probe br0])
023e1e0a 6OVS_VSWITCHD_STOP
a2cb9dfd
BP
7AT_CLEANUP
8
9AT_SETUP([ofproto - feature request, config request])
023e1e0a 10OVS_VSWITCHD_START
ea523221 11AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
640c7c94 12AT_CHECK([STRIP_XIDS stdout], [0], [dnl
9e1fd49b 13OFPT_FEATURES_REPLY: dpid:fedcba9876543210
c2f0373a 14n_tables:254, n_buffers:256
9e1fd49b
BP
15capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
16actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
0ab14c8e 17 LOCAL(br0): addr:aa:55:aa:55:00:00
bef071a5
JP
18 config: 0
19 state: 0
d02a5f8e 20 speed: 0 Mbps now, 0 Mbps max
3b62feba 21OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
a2cb9dfd 22])
023e1e0a 23OVS_VSWITCHD_STOP
81816a5f
JP
24AT_CLEANUP
25
26AT_SETUP([ofproto - set OpenFlow port number])
27OVS_VSWITCHD_START(
28 [add-port br0 p1 -- set Interface p1 type=dummy --\
29 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=99])
30AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
e44768b7
JP
31AT_CHECK([[sed '
32s/ (xid=0x[0-9a-fA-F]*)//
33s/00:0.$/00:0x/' < stdout]],
34 [0], [dnl
81816a5f 35OFPT_FEATURES_REPLY: dpid:fedcba9876543210
c2f0373a 36n_tables:254, n_buffers:256
81816a5f
JP
37capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
38actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
e44768b7 39 1(p1): addr:aa:55:aa:55:00:0x
81816a5f
JP
40 config: PORT_DOWN
41 state: LINK_DOWN
d02a5f8e 42 speed: 0 Mbps now, 0 Mbps max
e44768b7 43 99(p2): addr:aa:55:aa:55:00:0x
81816a5f
JP
44 config: PORT_DOWN
45 state: LINK_DOWN
d02a5f8e 46 speed: 0 Mbps now, 0 Mbps max
e44768b7 47 LOCAL(br0): addr:aa:55:aa:55:00:0x
bef071a5
JP
48 config: 0
49 state: 0
d02a5f8e 50 speed: 0 Mbps now, 0 Mbps max
81816a5f
JP
51OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
52])
e44768b7 53
81816a5f 54OVS_VSWITCHD_STOP
a2cb9dfd
BP
55AT_CLEANUP
56
eaa6eb2a
BP
57dnl This is really bare-bones.
58dnl It at least checks request and reply serialization and deserialization.
9dcd1c00 59AT_SETUP([ofproto - port stats - (OpenFlow 1.0)])
023e1e0a 60OVS_VSWITCHD_START
ea523221 61AT_CHECK([ovs-ofctl -vwarn dump-ports br0], [0], [stdout])
eaa6eb2a
BP
62AT_CHECK([STRIP_XIDS stdout], [0], [dnl
63OFPST_PORT reply: 1 ports
e1db42d6 64 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
eaa6eb2a
BP
65 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
66])
023e1e0a 67OVS_VSWITCHD_STOP
eaa6eb2a
BP
68AT_CLEANUP
69
9dcd1c00
SH
70AT_SETUP([ofproto - port stats - (OpenFlow 1.2)])
71OVS_VSWITCHD_START
72AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports br0], [0], [stdout])
73AT_CHECK([STRIP_XIDS stdout], [0], [dnl
74OFPST_PORT reply (OF1.2): 1 ports
e1db42d6 75 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
9dcd1c00
SH
76 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
77])
78OVS_VSWITCHD_STOP
79AT_CLEANUP
80
2be393ed
JP
81dnl This is really bare-bones.
82dnl It at least checks request and reply serialization and deserialization.
9dcd1c00 83AT_SETUP([ofproto - port-desc stats (OpenFlow 1.0)])
2be393ed
JP
84OVS_VSWITCHD_START
85AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], [stdout])
86AT_CHECK([STRIP_XIDS stdout], [0], [dnl
87OFPST_PORT_DESC reply:
88 LOCAL(br0): addr:aa:55:aa:55:00:00
bef071a5
JP
89 config: 0
90 state: 0
d02a5f8e 91 speed: 0 Mbps now, 0 Mbps max
2be393ed
JP
92])
93OVS_VSWITCHD_STOP
94AT_CLEANUP
95
eaa6eb2a
BP
96dnl This is really bare-bones.
97dnl It at least checks request and reply serialization and deserialization.
9dcd1c00
SH
98AT_SETUP([ofproto - port-desc stats (OpenFlow 1.2)])
99OVS_VSWITCHD_START
100AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc br0], [0], [stdout])
101AT_CHECK([STRIP_XIDS stdout], [0], [dnl
102OFPST_PORT_DESC reply (OF1.2):
103 LOCAL(br0): addr:aa:55:aa:55:00:00
104 config: 0
105 state: 0
106 speed: 0 Mbps now, 0 Mbps max
107])
108OVS_VSWITCHD_STOP
109AT_CLEANUP
110
111dnl This is really bare-bones.
112dnl It at least checks request and reply serialization and deserialization.
113AT_SETUP([ofproto - queue stats - (OpenFlow 1.0)])
023e1e0a 114OVS_VSWITCHD_START
ea523221 115AT_CHECK([ovs-ofctl -vwarn queue-stats br0], [0], [stdout])
eaa6eb2a
BP
116AT_CHECK([STRIP_XIDS stdout], [0], [dnl
117OFPST_QUEUE reply: 0 queues
118])
7f05e7ab 119AT_CHECK([ovs-ofctl -vwarn queue-stats br0 ANY 5], [0],
53514387 120 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_QUEUE
7f05e7ab 121OFPST_QUEUE request (xid=0x2):port=ANY queue=5
0414d158
BP
122])
123AT_CHECK([ovs-ofctl -vwarn queue-stats br0 10], [0],
53514387
SH
124 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT
125OFPST_QUEUE request (xid=0x2):port=10 queue=ALL
0414d158 126])
023e1e0a 127OVS_VSWITCHD_STOP
eaa6eb2a
BP
128AT_CLEANUP
129
9dcd1c00
SH
130AT_SETUP([ofproto - queue stats - (OpenFlow 1.2)])
131OVS_VSWITCHD_START
132AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0], [0], [stdout])
133AT_CHECK([STRIP_XIDS stdout], [0], [dnl
134OFPST_QUEUE reply (OF1.2): 0 queues
135])
136AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 ALL 5], [0],
137 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_QUEUE
138OFPST_QUEUE request (OF1.2) (xid=0x2):port=ANY queue=5
139])
140AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 10], [0],
141 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_PORT
142OFPST_QUEUE request (OF1.2) (xid=0x2):port=10 queue=ALL
143])
144OVS_VSWITCHD_STOP
145AT_CLEANUP
146
147AT_SETUP([ofproto - mod-port (OpenFlow 1.0)])
023e1e0a 148OVS_VSWITCHD_START
a2cb9dfd
BP
149for command_config_state in \
150 'up 0 0' \
0ab14c8e
BP
151 'noflood NO_FLOOD 0' \
152 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
28124950
BP
153 'flood PORT_DOWN LINK_DOWN' \
154 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
155 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
156 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
157 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
158 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
159 'up NO_RECV 0' \
160 'receive 0 0'
a2cb9dfd
BP
161do
162 set $command_config_state
0ab14c8e 163 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
ea523221
BP
164 AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
165 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
640c7c94 166 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
9e1fd49b 167OFPT_FEATURES_REPLY: dpid:fedcba9876543210
c2f0373a 168n_tables:254, n_buffers:256
9e1fd49b
BP
169capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
170actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
0ab14c8e
BP
171 LOCAL(br0): addr:aa:55:aa:55:00:00
172 config: $config
173 state: $state
d02a5f8e 174 speed: 0 Mbps now, 0 Mbps max
3b62feba 175OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
a2cb9dfd
BP
176])
177done
023e1e0a 178OVS_VSWITCHD_STOP
a2cb9dfd 179AT_CLEANUP
640c7c94 180
9dcd1c00
SH
181AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
182OVS_VSWITCHD_START
183for command_config_state in \
184 'up 0 0' \
185 'down PORT_DOWN LINK_DOWN' \
186 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
187 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
188 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
189 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
190 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
191 'up NO_RECV 0' \
192 'receive 0 0'
193do
194 set $command_config_state
195 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
196 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
197 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout])
198 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
199OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210
200n_tables:254, n_buffers:256
201capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS
202 LOCAL(br0): addr:aa:55:aa:55:00:00
203 config: $config
204 state: $state
205 speed: 0 Mbps now, 0 Mbps max
206OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0
207])
208done
209OVS_VSWITCHD_STOP
210AT_CLEANUP
211
c168dcc8 212AT_SETUP([ofproto - basic flow_mod commands (NXM)])
023e1e0a 213OVS_VSWITCHD_START
ef0ce8ae 214AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
640c7c94 215])
c6100d92
BP
216AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -])
217AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
218AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3])
ef0ce8ae 219AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92
BP
220 in_port=1 actions=output:2
221 in_port=2 actions=output:1
222 table=1, in_port=4 actions=output:3
0721c073 223NXST_FLOW reply:
640c7c94 224])
0697b5c3 225AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
c168dcc8
BP
226NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
227])
640c7c94 228AT_CHECK([ovs-ofctl del-flows br0])
ef0ce8ae 229AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
640c7c94 230])
023e1e0a 231OVS_VSWITCHD_STOP
640c7c94 232AT_CLEANUP
c168dcc8
BP
233
234AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
023e1e0a 235OVS_VSWITCHD_START
ef0ce8ae 236AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
c168dcc8 237])
c6100d92
BP
238AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -])
239AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2])
240AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3])
ef0ce8ae 241AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92
BP
242 in_port=1 actions=output:2
243 in_port=2 actions=output:1
244 table=1, in_port=4 actions=output:3
c168dcc8
BP
245OFPST_FLOW reply:
246])
0697b5c3 247AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
c168dcc8
BP
248OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
249])
250AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
ef0ce8ae 251AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
c168dcc8 252])
023e1e0a 253OVS_VSWITCHD_STOP
c168dcc8 254AT_CLEANUP
e729e793 255
75fa58f8
BP
256AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)])
257OVS_VSWITCHD_START
258AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
259])
260AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -])
261AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2])
262AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3])
263AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
264 in_port=1 actions=output:2
265 in_port=2 actions=output:1
266 table=1, in_port=4 actions=output:3
267OFPST_FLOW reply (OF1.1):
268])
269AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
270OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2
271])
272AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
273AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
274])
275OVS_VSWITCHD_STOP
276AT_CLEANUP
277
f5c45121
SH
278AT_SETUP([ofproto - set-field flow_mod commands (NXM)])
279OVS_VSWITCHD_START
280AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop])
281AT_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])
282AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
283 table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]]
284NXST_FLOW reply:
285])
286OVS_VSWITCHD_STOP
287AT_CLEANUP
288
9dcd1c00 289AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)])
e729e793 290OVS_VSWITCHD_START
9dcd1c00 291AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
e729e793 292])
9dcd1c00
SH
293AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -])
294AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2])
295AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3])
296AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
297 in_port=1 actions=output:2
298 in_port=2 actions=output:1
299 table=1, in_port=4 actions=output:3
300OFPST_FLOW reply (OF1.2):
e729e793 301])
9dcd1c00
SH
302AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
303AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
e729e793
JP
304])
305OVS_VSWITCHD_STOP
306AT_CLEANUP
307
9dcd1c00 308AT_SETUP([ofproto - dump flows with cookie])
e729e793 309OVS_VSWITCHD_START
c6100d92
BP
310AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
311AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
312AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
ef0ce8ae 313AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92
BP
314 cookie=0x1, in_port=1 actions=output:1
315 cookie=0x2, in_port=2 actions=output:1
316 cookie=0x3, in_port=3 actions=output:1
e729e793
JP
317NXST_FLOW reply:
318])
319AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
320NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
321])
9dcd1c00 322AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl
c6100d92 323 cookie=0x3, in_port=3 actions=output:1
e729e793
JP
324NXST_FLOW reply:
325])
9dcd1c00
SH
326AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | STRIP_XIDS], [0], [dnl
327NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
e729e793
JP
328])
329OVS_VSWITCHD_STOP
330AT_CLEANUP
331
623e1caf
JP
332AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)])
333OVS_VSWITCHD_START
c6100d92 334AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1])
623e1caf 335AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92 336 cookie=0x1, in_port=1 actions=output:1
623e1caf
JP
337OFPST_FLOW reply:
338])
339
c6100d92 340AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1])
623e1caf 341AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92 342 cookie=0x2, in_port=1 actions=output:1
623e1caf
JP
343OFPST_FLOW reply:
344])
345OVS_VSWITCHD_STOP
346AT_CLEANUP
347
348AT_SETUP([ofproto - mod flow with cookie change (NXM)])
349OVS_VSWITCHD_START
c6100d92 350AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1])
623e1caf 351AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92 352 cookie=0x1, in_port=1 actions=output:1
623e1caf
JP
353NXST_FLOW reply:
354])
355
c6100d92 356AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1])
623e1caf 357AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92 358 cookie=0x2, in_port=1 actions=output:1
623e1caf
JP
359NXST_FLOW reply:
360])
361OVS_VSWITCHD_STOP
362AT_CLEANUP
363
75fa58f8
BP
364AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)])
365OVS_VSWITCHD_START
366AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
367AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
368 cookie=0x1, in_port=1 actions=output:1
369OFPST_FLOW reply (OF1.1):
370])
371AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1])
372AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
373 cookie=0x1, in_port=1 actions=output:1
374OFPST_FLOW reply (OF1.1):
375])
376OVS_VSWITCHD_STOP
377AT_CLEANUP
378
9dcd1c00 379dnl The OpenFlow 1.2 spec states that the cookie may not be modified
2df3b874 380AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)])
9dcd1c00
SH
381OVS_VSWITCHD_START
382AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
383AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
384 cookie=0x1, in_port=1 actions=output:1
385OFPST_FLOW reply (OF1.2):
386])
387
388AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1])
389AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
390 cookie=0x1, in_port=1 actions=output:1
391OFPST_FLOW reply (OF1.2):
392])
393OVS_VSWITCHD_STOP
394AT_CLEANUP
395
396AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)])
623e1caf 397OVS_VSWITCHD_START
c6100d92
BP
398AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
399AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
400AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
623e1caf 401AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92
BP
402 cookie=0x1, in_port=1 actions=output:1
403 cookie=0x1, in_port=2 actions=output:1
404 cookie=0x2, in_port=3 actions=output:1
623e1caf
JP
405NXST_FLOW reply:
406])
407
408AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4])
409AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
410 cookie=0x1, in_port=1 actions=output:4
411 cookie=0x1, in_port=2 actions=output:4
c6100d92 412 cookie=0x2, in_port=3 actions=output:1
623e1caf
JP
413NXST_FLOW reply:
414])
415OVS_VSWITCHD_STOP
416AT_CLEANUP
417
75fa58f8
BP
418AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)])
419OVS_VSWITCHD_START
420AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
421AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1])
422AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1])
423AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
424 cookie=0x1, in_port=1 actions=output:1
425 cookie=0x1, in_port=2 actions=output:1
426 cookie=0x2, in_port=3 actions=output:1
427OFPST_FLOW reply (OF1.1):
428])
429
430AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4])
431AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
432 cookie=0x1, in_port=1 actions=output:4
433 cookie=0x1, in_port=2 actions=output:4
434 cookie=0x2, in_port=3 actions=output:1
435OFPST_FLOW reply (OF1.1):
436])
437OVS_VSWITCHD_STOP
438AT_CLEANUP
439
9dcd1c00
SH
440AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)])
441OVS_VSWITCHD_START
442AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
443AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1])
444AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1])
445AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
446 cookie=0x1, in_port=1 actions=output:1
447 cookie=0x1, in_port=2 actions=output:1
448 cookie=0x2, in_port=3 actions=output:1
449OFPST_FLOW reply (OF1.2):
450])
451
452AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4])
453AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
454 cookie=0x1, in_port=1 actions=output:4
455 cookie=0x1, in_port=2 actions=output:4
456 cookie=0x2, in_port=3 actions=output:1
457OFPST_FLOW reply (OF1.2):
458])
459OVS_VSWITCHD_STOP
460AT_CLEANUP
461
462dnl The OpenFlow 1.2 spec states that the cookie may not be modified
623e1caf
JP
463AT_SETUP([ofproto - mod flows based on cookie mask with cookie change])
464OVS_VSWITCHD_START
c6100d92
BP
465AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
466AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
467AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
623e1caf 468AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92
BP
469 cookie=0x1, in_port=1 actions=output:1
470 cookie=0x1, in_port=2 actions=output:1
471 cookie=0x2, in_port=3 actions=output:1
623e1caf
JP
472NXST_FLOW reply:
473])
474
475AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4])
476AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92 477 cookie=0x2, in_port=3 actions=output:1
623e1caf
JP
478 cookie=0x4, in_port=1 actions=output:4
479 cookie=0x4, in_port=2 actions=output:4
480NXST_FLOW reply:
481])
482OVS_VSWITCHD_STOP
483AT_CLEANUP
484
490020fe 485AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM])
623e1caf 486OVS_VSWITCHD_START
c6100d92 487AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1])
623e1caf 488AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92 489 in_port=1 actions=output:1
623e1caf
JP
490NXST_FLOW reply:
491])
492OVS_VSWITCHD_STOP
493AT_CLEANUP
494
75fa58f8
BP
495AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1])
496OVS_VSWITCHD_START
497AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1])
498AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
499 in_port=1 actions=output:1
500OFPST_FLOW reply (OF1.1):
501])
502OVS_VSWITCHD_STOP
503AT_CLEANUP
504
490020fe
BP
505AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2])
506OVS_VSWITCHD_START
507AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1])
508AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
509OFPST_FLOW reply (OF1.2):
510])
511OVS_VSWITCHD_STOP
512AT_CLEANUP
513
514AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM])
623e1caf 515OVS_VSWITCHD_START
c6100d92 516AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1])
623e1caf
JP
517AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
518NXST_FLOW reply:
519])
520OVS_VSWITCHD_STOP
521AT_CLEANUP
522
75fa58f8
BP
523AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1])
524OVS_VSWITCHD_START
525AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1])
526AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
527OFPST_FLOW reply (OF1.1):
528])
529OVS_VSWITCHD_STOP
530AT_CLEANUP
531
490020fe
BP
532AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2])
533OVS_VSWITCHD_START
534AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1])
535AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
536OFPST_FLOW reply (OF1.2):
537])
538OVS_VSWITCHD_STOP
539AT_CLEANUP
540
623e1caf
JP
541AT_SETUP([ofproto - del flows with cookies])
542OVS_VSWITCHD_START
c6100d92
BP
543AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
544AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
545AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
623e1caf 546AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92
BP
547 cookie=0x1, in_port=1 actions=output:1
548 cookie=0x2, in_port=2 actions=output:1
549 cookie=0x3, in_port=3 actions=output:1
623e1caf
JP
550NXST_FLOW reply:
551])
552
553AT_CHECK([ovs-ofctl del-flows br0])
554AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
555NXST_FLOW reply:
556])
557OVS_VSWITCHD_STOP
558AT_CLEANUP
559
560AT_SETUP([ofproto - del flows based on cookie])
e729e793 561OVS_VSWITCHD_START
c6100d92
BP
562AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
563AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
564AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
ef0ce8ae 565AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92
BP
566 cookie=0x1, in_port=1 actions=output:1
567 cookie=0x2, in_port=2 actions=output:1
568 cookie=0x3, in_port=3 actions=output:1
e729e793
JP
569NXST_FLOW reply:
570])
80d5aefd 571
623e1caf 572AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1])
ef0ce8ae 573AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92
BP
574 cookie=0x1, in_port=1 actions=output:1
575 cookie=0x2, in_port=2 actions=output:1
e729e793
JP
576NXST_FLOW reply:
577])
578OVS_VSWITCHD_STOP
579AT_CLEANUP
580
623e1caf 581AT_SETUP([ofproto - del flows based on cookie mask])
e729e793 582OVS_VSWITCHD_START
c6100d92
BP
583AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
584AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
585AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
ef0ce8ae 586AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92
BP
587 cookie=0x1, in_port=1 actions=output:1
588 cookie=0x2, in_port=2 actions=output:1
589 cookie=0x3, in_port=3 actions=output:1
e729e793
JP
590NXST_FLOW reply:
591])
592AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
ef0ce8ae 593AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
c6100d92 594 cookie=0x2, in_port=2 actions=output:1
e729e793
JP
595NXST_FLOW reply:
596])
597OVS_VSWITCHD_STOP
598AT_CLEANUP
254750ce 599
9dcd1c00 600AT_SETUP([ofproto - del flows based on table id (NXM)])
c90cfeaf
SH
601OVS_VSWITCHD_START
602AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
603AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
604AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
605 cookie=0x1, in_port=1 actions=output:1
606 cookie=0x2, table=1, in_port=2 actions=output:1
607NXST_FLOW reply:
608])
609AT_CHECK([ovs-ofctl del-flows br0 table=0])
610AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
611 cookie=0x2, table=1, in_port=2 actions=output:1
612NXST_FLOW reply:
613])
614AT_CHECK([ovs-ofctl del-flows br0 table=1])
615AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
616NXST_FLOW reply:
617])
618AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
619AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
620AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
621 cookie=0x1, in_port=1 actions=output:1
622 cookie=0x2, table=1, in_port=2 actions=output:1
623NXST_FLOW reply:
624])
625AT_CHECK([ovs-ofctl del-flows br0])
626AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
627NXST_FLOW reply:
628])
629OVS_VSWITCHD_STOP
630AT_CLEANUP
631
75fa58f8
BP
632AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)])
633OVS_VSWITCHD_START
634AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
635AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
636AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
637 cookie=0x1, in_port=1 actions=output:1
638 cookie=0x2, table=1, in_port=2 actions=output:1
639OFPST_FLOW reply (OF1.1):
640])
641AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0])
642AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
643 cookie=0x2, table=1, in_port=2 actions=output:1
644OFPST_FLOW reply (OF1.1):
645])
646AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1])
647AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
648OFPST_FLOW reply (OF1.1):
649])
650AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
651AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
652AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
653 cookie=0x1, in_port=1 actions=output:1
654 cookie=0x2, table=1, in_port=2 actions=output:1
655OFPST_FLOW reply (OF1.1):
656])
657AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
658AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
659OFPST_FLOW reply (OF1.1):
660])
661OVS_VSWITCHD_STOP
662AT_CLEANUP
663
9dcd1c00
SH
664AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)])
665OVS_VSWITCHD_START
666AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
667AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
668AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
669 cookie=0x1, in_port=1 actions=output:1
670 cookie=0x2, table=1, in_port=2 actions=output:1
671OFPST_FLOW reply (OF1.2):
672])
673AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0])
674AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
675 cookie=0x2, table=1, in_port=2 actions=output:1
676OFPST_FLOW reply (OF1.2):
677])
678AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1])
679AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
680OFPST_FLOW reply (OF1.2):
681])
682AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
683AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
684AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
685 cookie=0x1, in_port=1 actions=output:1
686 cookie=0x2, table=1, in_port=2 actions=output:1
687OFPST_FLOW reply (OF1.2):
688])
689AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
690AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
691OFPST_FLOW reply (OF1.2):
692])
693OVS_VSWITCHD_STOP
694AT_CLEANUP
695
696AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)])
254750ce
BP
697OVS_VSWITCHD_START
698# Check the default configuration.
c2f0373a 699(echo "OFPST_TABLE reply (xid=0x2): 254 tables
254750ce
BP
700 0: classifier: wild=0x3fffff, max=1000000, active=0
701 lookup=0, matched=0"
702 x=1
c57b2226 703 while test $x -lt 254; do
254750ce
BP
704 printf " %d: %-8s: wild=0x3fffff, max=1000000, active=0
705 lookup=0, matched=0
706" $x table$x
707 x=`expr $x + 1`
c2f0373a 708 done) > expout
254750ce
BP
709AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
710# Change the configuration.
711AT_CHECK(
712 [ovs-vsctl \
713 -- --id=@t0 create Flow_Table name=main \
714 -- --id=@t1 create Flow_Table flow-limit=1024 \
715 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
5c6d0628 716 | ${PERL} $srcdir/uuidfilt.pl],
254750ce
BP
717 [0], [<0>
718<1>
719])
720# Check that the configuration was updated.
721mv expout orig-expout
c2f0373a 722(echo "OFPST_TABLE reply (xid=0x2): 254 tables
254750ce
BP
723 0: main : wild=0x3fffff, max=1000000, active=0
724 lookup=0, matched=0
725 1: table1 : wild=0x3fffff, max= 1024, active=0
726 lookup=0, matched=0"
727 tail -n +6 orig-expout) > expout
728AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
729OVS_VSWITCHD_STOP
730AT_CLEANUP
731
9dcd1c00
SH
732AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)])
733OVS_VSWITCHD_START
734# Check the default configuration.
735(mid="wild=0xffffffffff, max=1000000,"
736 tail="
737 lookup=0, matched=0
738 match=0xffffffffff, instructions=0x00000007, config=0x00000003
739 write_actions=0x00000000, apply_actions=0x00000000
740 write_setfields=0x000000ffffffffff
741 apply_setfields=0x000000ffffffffff
742 metadata_match=0xffffffffffffffff
743 metadata_write=0xffffffffffffffff"
744 echo "OFPST_TABLE reply (OF1.2) (xid=0x2): 254 tables
745 0: classifier: $mid active=0$tail"
746 x=1
747 while test $x -lt 254; do
748 printf " %d: %-8s: $mid active=0$tail
749" $x table$x
750 x=`expr $x + 1`
751 done) > expout
752AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
753# Change the configuration.
754AT_CHECK(
755 [ovs-vsctl \
756 -- --id=@t0 create Flow_Table name=main \
757 -- --id=@t1 create Flow_Table flow-limit=1024 \
758 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
5c6d0628 759 | ${PERL} $srcdir/uuidfilt.pl],
9dcd1c00
SH
760 [0], [<0>
761<1>
762])
763# Check that the configuration was updated.
764mv expout orig-expout
765(echo "OFPST_TABLE reply (OF1.2) (xid=0x2): 254 tables
766 0: main : wild=0xffffffffff, max=1000000, active=0"
767 tail -n +3 orig-expout | head -7
768 echo " 1: table1 : wild=0xffffffffff, max= 1024, active=0"
769 tail -n +11 orig-expout) > expout
770AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
771OVS_VSWITCHD_STOP
772AT_CLEANUP
773
774AT_SETUP([ofproto - hard limits on flow table size (OpenFLow 1.0)])
254750ce
BP
775OVS_VSWITCHD_START
776# Configure a maximum of 4 flows.
777AT_CHECK(
778 [ovs-vsctl \
779 -- --id=@t0 create Flow_Table flow-limit=4 \
780 -- set bridge br0 flow_tables:0=@t0 \
5c6d0628 781 | ${PERL} $srcdir/uuidfilt.pl],
254750ce
BP
782 [0], [<0>
783])
784# Add 4 flows.
785for in_port in 1 2 3 4; do
786 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
787done
788AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
789 in_port=1 actions=drop
790 in_port=2 actions=drop
791 in_port=3 actions=drop
792 in_port=4 actions=drop
793NXST_FLOW reply:
794])
795# Adding another flow will be refused.
796AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
27527aa0 797AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
be2b69d1 798 [OFPT_ERROR: OFPFMFC_TABLE_FULL
254750ce
BP
799])
800# Also a mod-flow that would add a flow will be refused.
801AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
27527aa0 802AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
be2b69d1 803 [OFPT_ERROR: OFPFMFC_TABLE_FULL
254750ce
BP
804])
805# Replacing or modifying an existing flow is allowed.
806AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
807AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
808AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
809 in_port=1 actions=drop
810 in_port=2 actions=drop
811 in_port=3 actions=output:1
812 in_port=4 actions=NORMAL
813NXST_FLOW reply:
814])
815OVS_VSWITCHD_STOP
816AT_CLEANUP
817
9dcd1c00
SH
818AT_SETUP([ofproto - hard limits on flow table size (OpenFLow 1.2)])
819OVS_VSWITCHD_START
820# Configure a maximum of 4 flows.
821AT_CHECK(
822 [ovs-vsctl \
823 -- --id=@t0 create Flow_Table flow-limit=4 \
824 -- set bridge br0 flow_tables:0=@t0 \
5c6d0628 825 | ${PERL} $srcdir/uuidfilt.pl],
9dcd1c00
SH
826 [0], [<0>
827])
828# Add 4 flows.
829for in_port in 1 2 3 4; do
830 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
831done
832AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
833 in_port=1 actions=drop
834 in_port=2 actions=drop
835 in_port=3 actions=drop
836 in_port=4 actions=drop
837OFPST_FLOW reply (OF1.2):
838])
839# Adding another flow will be refused.
840AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
841AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
842 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
843])
844# Replacing or modifying an existing flow is allowed.
845AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
846AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
847AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
848 in_port=1 actions=drop
849 in_port=2 actions=drop
850 in_port=3 actions=output:1
851 in_port=4 actions=NORMAL
852OFPST_FLOW reply (OF1.2):
853])
854OVS_VSWITCHD_STOP
855AT_CLEANUP
856
857AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
254750ce
BP
858OVS_VSWITCHD_START
859# Configure a maximum of 4 flows.
860AT_CHECK(
861 [ovs-vsctl \
862 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
863 -- set bridge br0 flow_tables:0=@t0 \
5c6d0628 864 | ${PERL} $srcdir/uuidfilt.pl],
254750ce
BP
865 [0], [<0>
866])
867# Add 4 flows.
868for in_port in 4 3 2 1; do
869 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
870done
871AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
b9718b7b
BP
872 idle_timeout=10, in_port=1 actions=drop
873 idle_timeout=20, in_port=2 actions=drop
874 idle_timeout=30, in_port=3 actions=drop
875 idle_timeout=40, in_port=4 actions=drop
254750ce
BP
876NXST_FLOW reply:
877])
878# Adding another flow will cause the one that expires soonest to be evicted.
879AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
880AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
b9718b7b
BP
881 idle_timeout=20, in_port=2 actions=drop
882 idle_timeout=30, in_port=3 actions=drop
883 idle_timeout=40, in_port=4 actions=drop
254750ce
BP
884 in_port=5 actions=drop
885NXST_FLOW reply:
886])
887# A mod-flow that adds a flow also causes eviction, but replacing or
888# modifying an existing flow doesn't.
889AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
890AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
891AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
892AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
b9718b7b 893 idle_timeout=30, in_port=3 actions=output:1
254750ce
BP
894 in_port=4 actions=NORMAL
895 in_port=5 actions=drop
896 in_port=6 actions=drop
897NXST_FLOW reply:
898])
899# Flows with no timeouts at all cannot be evicted.
900AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
901AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
27527aa0 902AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
be2b69d1 903 [OFPT_ERROR: OFPFMFC_TABLE_FULL
254750ce
BP
904])
905AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
906 in_port=4 actions=NORMAL
907 in_port=5 actions=drop
908 in_port=6 actions=drop
909 in_port=7 actions=NORMAL
910NXST_FLOW reply:
911])
912OVS_VSWITCHD_STOP
913AT_CLEANUP
914
9dcd1c00
SH
915AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
916OVS_VSWITCHD_START
917# Configure a maximum of 4 flows.
918AT_CHECK(
919 [ovs-vsctl \
920 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
921 -- set bridge br0 flow_tables:0=@t0 \
5c6d0628 922 | ${PERL} $srcdir/uuidfilt.pl],
9dcd1c00
SH
923 [0], [<0>
924])
925# Add 4 flows.
926for in_port in 4 3 2 1; do
927 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
928done
929AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
930 idle_timeout=10, in_port=1 actions=drop
931 idle_timeout=20, in_port=2 actions=drop
932 idle_timeout=30, in_port=3 actions=drop
933 idle_timeout=40, in_port=4 actions=drop
934OFPST_FLOW reply (OF1.2):
935])
936# Adding another flow will cause the one that expires soonest to be evicted.
937AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
938AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
939 idle_timeout=20, in_port=2 actions=drop
940 idle_timeout=30, in_port=3 actions=drop
941 idle_timeout=40, in_port=4 actions=drop
942 in_port=5 actions=drop
943OFPST_FLOW reply (OF1.2):
944])
945# In Open Flow 1.2 a mod-flow does not ever add a flow and thus
946# has no effect on eviction
947AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
948AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
949AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
950AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
951 idle_timeout=20, in_port=2 actions=drop
952 idle_timeout=30, in_port=3 actions=output:1
953 in_port=4 actions=NORMAL
954 in_port=5 actions=drop
955OFPST_FLOW reply (OF1.2):
956])
957# Flows with no timeouts at all cannot be evicted.
958AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
959AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
960AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
961AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
962 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
963])
964AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
965 in_port=4 actions=NORMAL
966 in_port=5 actions=drop
967 in_port=6 actions=drop
968 in_port=7 actions=NORMAL
969OFPST_FLOW reply (OF1.2):
970])
971OVS_VSWITCHD_STOP
972AT_CLEANUP
973
974AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
254750ce
BP
975OVS_VSWITCHD_START
976# Configure a maximum of 4 flows.
977AT_CHECK(
978 [ovs-vsctl \
979 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
980 overflow-policy=evict \
981 groups='"NXM_OF_IN_PORT[[]]"' \
982 -- set bridge br0 flow_tables:0=@t0 \
5c6d0628 983 | ${PERL} $srcdir/uuidfilt.pl],
254750ce
BP
984 [0], [<0>
985])
986# Add 4 flows.
987ovs-ofctl add-flows br0 - <<EOF
988idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
989idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
990idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
991idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
992EOF
993AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
b9718b7b
BP
994 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
995 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
996 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
997 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
254750ce
BP
998NXST_FLOW reply:
999])
1000# Adding another flow will cause the one that expires soonest within
1001# the largest group (those with in_port=1) to be evicted. In this
1002# case this is not the same as the one that expires soonest overall
1003# (which is what makes the test interesting):
1004AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1005AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
b9718b7b
BP
1006 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1007 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1008 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
254750ce
BP
1009 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1010NXST_FLOW reply:
1011])
1012# Enlarge the flow limit, change the eviction policy back to strictly
1013# based on expiration, and and add some flows.
1014AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1015ovs-ofctl add-flows br0 - <<EOF
1016idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1017idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1018idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1019EOF
1020AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
b9718b7b
BP
1021 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1022 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1023 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1024 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1025 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1026 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
254750ce
BP
1027 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1028NXST_FLOW reply:
1029])
1030# Adding another flow will cause the one that expires soonest overall
1031# to be evicted.
1032AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
1033AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
b9718b7b
BP
1034 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1035 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1036 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1037 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1038 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1039 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
254750ce
BP
1040 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1041NXST_FLOW reply:
1042])
1043# Reducing the flow limit also causes the flows that expire soonest
1044# overall to be evicted.
1045AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1046AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
b9718b7b
BP
1047 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1048 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1049 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
254750ce
BP
1050 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1051NXST_FLOW reply:
1052])
1053OVS_VSWITCHD_STOP
1054AT_CLEANUP
80d5aefd 1055
9dcd1c00
SH
1056AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
1057OVS_VSWITCHD_START
1058# Configure a maximum of 4 flows.
1059AT_CHECK(
1060 [ovs-vsctl \
1061 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1062 overflow-policy=evict \
1063 groups='"NXM_OF_IN_PORT[[]]"' \
1064 -- set bridge br0 flow_tables:0=@t0 \
5c6d0628 1065 | ${PERL} $srcdir/uuidfilt.pl],
9dcd1c00
SH
1066 [0], [<0>
1067])
1068# Add 4 flows.
1069ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1070idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1071idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1072idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1073idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1074EOF
1075AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1076 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1077 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1078 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1079 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1080OFPST_FLOW reply (OF1.2):
1081])
1082# Adding another flow will cause the one that expires soonest within
1083# the largest group (those with in_port=1) to be evicted. In this
1084# case this is not the same as the one that expires soonest overall
1085# (which is what makes the test interesting):
1086AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1087AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1088 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1089 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1090 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1091 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1092OFPST_FLOW reply (OF1.2):
1093])
1094# Enlarge the flow limit, change the eviction policy back to strictly
1095# based on expiration, and and add some flows.
1096AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1097ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1098idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1099idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1100idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1101EOF
1102AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1103 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1104 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1105 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1106 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1107 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1108 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1109 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1110OFPST_FLOW reply (OF1.2):
1111])
1112# Adding another flow will cause the one that expires soonest overall
1113# to be evicted.
1114AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
1115AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1116 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1117 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1118 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1119 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1120 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1121 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1122 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1123OFPST_FLOW reply (OF1.2):
1124])
1125# Reducing the flow limit also causes the flows that expire soonest
1126# overall to be evicted.
1127AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1128AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1129 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1130 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1131 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1132 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1133OFPST_FLOW reply (OF1.2):
1134])
1135OVS_VSWITCHD_STOP
1136AT_CLEANUP
1137
1138AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
80d5aefd
BP
1139OVS_VSWITCHD_START
1140AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
1141check_async () {
1142 printf '\n\n--- check_async %d ---\n\n\n' $1
1143 shift
1144
6fc67c4f 1145 ovs-appctl -t ovs-ofctl ofctl/barrier
80d5aefd
BP
1146 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1147 : > expout
1148
a7349929 1149 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
7f05e7ab 1150 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
80d5aefd 1151 if test X"$1" = X"OFPR_ACTION"; then shift;
7f05e7ab 1152 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3f78c3cc 1153metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
80d5aefd
BP
1154 fi
1155
a7349929 1156 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
7f05e7ab 1157 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
a7349929 1158 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
7f05e7ab 1159 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
3f78c3cc 1160metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
a7349929
BP
1161 fi
1162
1163 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
7f05e7ab 1164 ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
80d5aefd 1165 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
7f05e7ab 1166 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
3f78c3cc 1167udp,metadata=0,in_port=0,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
1168 fi
1169
1170 # OFPT_PORT_STATUS, OFPPR_ADD
e1b1d06a 1171 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
80d5aefd
BP
1172 if test X"$1" = X"OFPPR_ADD"; then shift;
1173 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
1174 config: PORT_DOWN
9e1fd49b 1175 state: LINK_DOWN
d02a5f8e 1176 speed: 0 Mbps now, 0 Mbps max"
80d5aefd
BP
1177 fi
1178
1179 # OFPT_PORT_STATUS, OFPPR_DELETE
1180 ovs-vsctl del-port br0 test
1181 if test X"$1" = X"OFPPR_DELETE"; then shift;
1182 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
1183 config: PORT_DOWN
9e1fd49b 1184 state: LINK_DOWN
d02a5f8e 1185 speed: 0 Mbps now, 0 Mbps max"
80d5aefd
BP
1186 fi
1187
1188 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1189 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
1190 ovs-ofctl --strict del-flows br0 ''
1191 if test X"$1" = X"OFPRR_DELETE"; then shift;
1192 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
1193 fi
1194 AT_FAIL_IF([test X"$1" != X])
1195
1196 ovs-appctl -t ovs-ofctl ofctl/barrier
fd0aa9ea 1197 echo >>expout "OFPT_BARRIER_REPLY:"
80d5aefd
BP
1198
1199 AT_CHECK(
1200 [[sed '
1201s/ (xid=0x[0-9a-fA-F]*)//
1202s/ *duration.*//
1203s/00:0.$/00:0x/' < monitor.log]],
1204 [0], [expout])
1205}
1206
1207# It's a service connection so initially there should be no async messages.
1208check_async 1
1209
99811d07 1210# Set miss_send_len to 128, turning on packet-ins for our service connection.
80d5aefd
BP
1211ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
1212check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1213
1214# Set miss_send_len to 128 and enable invalid_ttl.
1215ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
1216check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1217
1218# Become slave, which should disable everything except port status.
1219ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
1220check_async 4 OFPPR_ADD OFPPR_DELETE
1221
1222# Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
1223ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
1224check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1225
a7349929
BP
1226# Set controller ID 123.
1227ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
1228check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1229
1230# Restore controller ID 0.
1231ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
1232
80d5aefd
BP
1233# Become master.
1234ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
a7349929 1235check_async 7 OFPR_ACTION OFPPR_ADD
80d5aefd
BP
1236
1237ovs-appctl -t ovs-ofctl exit
94c33672 1238OVS_VSWITCHD_STOP
80d5aefd 1239AT_CLEANUP
751c7785 1240
9dcd1c00
SH
1241AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
1242OVS_VSWITCHD_START
1243AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
1244check_async () {
1245 printf '\n\n--- check_async %d ---\n\n\n' $1
1246 INDEX=$1
1247 shift
1248
1249 ovs-appctl -t ovs-ofctl ofctl/barrier
1250 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1251 : > expout
1252
1253 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1254 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
1255 if test X"$1" = X"OFPR_ACTION"; then shift;
1256 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
1257metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1258 fi
1259
1260 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1261 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1262 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1263 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
1264metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1265 fi
1266
1267 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1268 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1269 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1270 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
1271udp,metadata=0,in_port=0,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"
1272 fi
1273
1274 # OFPT_PORT_STATUS, OFPPR_ADD
1275 ovs-vsctl add-port br0 test -- set Interface test type=dummy
1276 if test X"$1" = X"OFPPR_ADD"; then shift;
1277 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1278 config: PORT_DOWN
1279 state: LINK_DOWN
1280 speed: 0 Mbps now, 0 Mbps max"
1281 fi
1282
1283 # OFPT_PORT_STATUS, OFPPR_DELETE
1284 ovs-vsctl del-port br0 test
1285 if test X"$1" = X"OFPPR_DELETE"; then shift;
1286 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1287 config: PORT_DOWN
1288 state: LINK_DOWN
1289 speed: 0 Mbps now, 0 Mbps max"
1290 fi
1291
1292 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1293 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
1294 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
1295 if test X"$1" = X"OFPRR_DELETE"; then shift;
1296 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
1297 fi
1298 AT_FAIL_IF([test X"$1" != X])
1299
1300 ovs-appctl -t ovs-ofctl ofctl/barrier
1301 echo >>expout "OFPT_BARRIER_REPLY (OF1.2):"
1302
1303 AT_CHECK(
1304 [[sed '
1305s/ (xid=0x[0-9a-fA-F]*)//
1306s/ *duration.*//
1307s/00:0.$/00:0x/' < monitor.log]],
1308 [0], [expout])
1309}
1310
1311# It's a service connection so initially there should be no async messages.
1312check_async 1
1313
1314# Set miss_send_len to 128, turning on packet-ins for our service connection.
1315ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
1316check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1317
1318# Set miss_send_len to 128 and enable invalid_ttl.
1319ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
1320check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1321
6ea4776b
JR
1322# Become slave (OF 1.2), which should disable everything except port status.
1323ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
9dcd1c00
SH
1324check_async 4 OFPPR_ADD OFPPR_DELETE
1325
1326# Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
1327ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
1328check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1329
1330# Set controller ID 123.
1331ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
1332check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1333
1334# Restore controller ID 0.
1335ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
1336
6ea4776b
JR
1337# Become master (OF 1.2).
1338ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
9dcd1c00
SH
1339check_async 7 OFPR_ACTION OFPPR_ADD
1340
1341ovs-appctl -t ovs-ofctl exit
1342OVS_VSWITCHD_STOP
1343AT_CLEANUP
1344
b21eb1da
JR
1345AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
1346OVS_VSWITCHD_START
1347AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
1348check_async () {
1349 printf '\n\n--- check_async %d ---\n\n\n' $1
1350 INDEX=$1
1351 shift
1352
1353 ovs-appctl -t ovs-ofctl ofctl/barrier
1354 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1355 : > expout
1356
1357 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1358 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
1359 if test X"$1" = X"OFPR_ACTION"; then shift;
1360 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
1361metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1362 fi
1363
1364 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1365 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1366 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1367 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
1368metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1369 fi
1370
1371 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1372 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1373 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1374 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
1375udp,metadata=0,in_port=0,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"
1376 fi
1377
1378 # OFPT_PORT_STATUS, OFPPR_ADD
1379 ovs-vsctl add-port br0 test -- set Interface test type=dummy
1380 if test X"$1" = X"OFPPR_ADD"; then shift;
1381 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1382 config: PORT_DOWN
1383 state: LINK_DOWN
1384 speed: 0 Mbps now, 0 Mbps max"
1385 fi
1386
1387 # OFPT_PORT_STATUS, OFPPR_DELETE
1388 ovs-vsctl del-port br0 test
1389 if test X"$1" = X"OFPPR_DELETE"; then shift;
1390 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1391 config: PORT_DOWN
1392 state: LINK_DOWN
1393 speed: 0 Mbps now, 0 Mbps max"
1394 fi
1395
1396 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1397 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
1398 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
1399 if test X"$1" = X"OFPRR_DELETE"; then shift;
1400 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
1401 fi
1402 AT_FAIL_IF([test X"$1" != X])
1403
1404 ovs-appctl -t ovs-ofctl ofctl/barrier
1405 echo >>expout "OFPT_BARRIER_REPLY (OF1.3):"
1406
1407 AT_CHECK(
1408 [[sed '
1409s/ (xid=0x[0-9a-fA-F]*)//
1410s/ *duration.*//
1411s/00:0.$/00:0x/' < monitor.log]],
1412 [0], [expout])
1413}
1414
1415# It's a service connection so initially there should be no async messages.
1416check_async 1
1417
1418# Set miss_send_len to 128, turning on packet-ins for our service connection.
1419ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
1420check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1421
1422# Become slave (OF 1.3), which should disable everything except port status.
1423ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
1424check_async 3 OFPPR_ADD OFPPR_DELETE
1425
1426# Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
1427ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005
1428check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1429
1430# Set controller ID 123.
1431ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
1432check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1433
1434# Restore controller ID 0.
1435ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
1436
1437# Become master (OF 1.3).
1438ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
1439check_async 6 OFPR_ACTION OFPPR_ADD
1440
1441ovs-appctl -t ovs-ofctl exit
1442OVS_VSWITCHD_STOP
1443AT_CLEANUP
1444
6ea4776b
JR
1445dnl This test checks that the role request/response messaging works
1446dnl and that generation_id is handled properly.
1447AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
1448OVS_VSWITCHD_START
1449AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
1450
1451ovs-appctl -t ovs-ofctl ofctl/barrier
1452ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1453: > expout
1454
1455# find out current role
1456ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000000000000000000000000000000
1457echo >>expout "send: OFPT_ROLE_REQUEST (OF1.2) (xid=0x2): role=nochange"
1458echo >>expout "OFPT_ROLE_REPLY (OF1.2) (xid=0x2): role=equal"
1459
1460# Become slave (generation_id is initially undefined, so 2^63+2 should not be stale)
1461ovs-appctl -t ovs-ofctl ofctl/send 031800180000000300000003000000008000000000000002
1462echo >>expout "send: OFPT_ROLE_REQUEST (OF1.2) (xid=0x3): role=slave generation_id=9223372036854775810"
147cc9d3 1463echo >>expout "OFPT_ROLE_REPLY (OF1.2) (xid=0x3): role=slave generation_id=9223372036854775810"
6ea4776b
JR
1464
1465# Try to become the master using a stale generation ID
1466ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
1467echo >>expout "send: OFPT_ROLE_REQUEST (OF1.2) (xid=0x4): role=master generation_id=2"
1468echo >>expout "OFPT_ERROR (OF1.2) (xid=0x4): OFPRRFC_STALE"
1469echo >>expout "OFPT_ROLE_REQUEST (OF1.2) (xid=0x4): role=master generation_id=2"
1470
1471# Become master using a valid generation ID
1472ovs-appctl -t ovs-ofctl ofctl/send 031800180000000500000002000000000000000000000001
1473echo >>expout "send: OFPT_ROLE_REQUEST (OF1.2) (xid=0x5): role=master generation_id=1"
147cc9d3 1474echo >>expout "OFPT_ROLE_REPLY (OF1.2) (xid=0x5): role=master generation_id=1"
6ea4776b
JR
1475ovs-appctl -t ovs-ofctl ofctl/barrier
1476echo >>expout "OFPT_BARRIER_REPLY (OF1.2) (xid=0x3):"
1477
1478AT_CHECK([cat monitor.log], [0], [expout])
1479
1480ovs-appctl -t ovs-ofctl exit
1481OVS_VSWITCHD_STOP
1482AT_CLEANUP
1483
751c7785
BP
1484dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
1485dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
1486dnl controllers despite the spec) as meaning a packet that was generated
1487dnl by the controller.
9dcd1c00 1488AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
751c7785 1489OVS_VSWITCHD_START
586ddea5 1490ADD_OF_PORTS([br0], [1])
751c7785
BP
1491
1492# Start a monitor listening for packet-ins.
1493AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
1494ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
1495ovs-appctl -t ovs-ofctl ofctl/barrier
1496ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1497AT_CAPTURE_FILE([monitor.log])
1498
1499# Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
586ddea5
BP
1500AT_CHECK([ovs-ofctl packet-out br0 none controller,1 '0001020304050010203040501234'])
1501AT_CHECK([ovs-ofctl packet-out br0 controller controller,1 '0001020304050010203040505678'])
751c7785
BP
1502
1503# Stop the monitor and check its output.
1504ovs-appctl -t ovs-ofctl ofctl/barrier
1505ovs-appctl -t ovs-ofctl exit
1506
586ddea5
BP
1507ovs-ofctl dump-ports br0
1508
751c7785 1509AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
7f05e7ab 1510OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
3f78c3cc 1511metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
751c7785 1512OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
3f78c3cc 1513metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
969fc56c
JS
1514OFPT_BARRIER_REPLY:
1515])
1516
1517OVS_VSWITCHD_STOP
1518AT_CLEANUP
1519
9dcd1c00
SH
1520dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
1521dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
1522dnl controllers despite the spec) as meaning a packet that was generated
1523dnl by the controller.
1524AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
1525OVS_VSWITCHD_START
1526
1527# Start a monitor listening for packet-ins.
1528AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
1529ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
1530ovs-appctl -t ovs-ofctl ofctl/barrier
1531ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1532AT_CAPTURE_FILE([monitor.log])
1533
1534# Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
1535AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
1536AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
1537
1538# Stop the monitor and check its output.
1539ovs-appctl -t ovs-ofctl ofctl/barrier
1540ovs-appctl -t ovs-ofctl exit
1541
1542AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
1543OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
1544metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
1545OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
1546metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
1547OFPT_BARRIER_REPLY (OF1.2):
1548])
1549
1550OVS_VSWITCHD_STOP
1551AT_CLEANUP
1552
969fc56c
JS
1553dnl This test checks that metadata is encoded in packet_in structures,
1554dnl supported by NXAST.
1555AT_SETUP([ofproto - packet-out with metadata (NXM)])
1556OVS_VSWITCHD_START
1557
1558# Start a monitor listening for packet-ins.
1559AT_CHECK([ovs-ofctl -P nxm monitor br0 --detach --no-chdir --pidfile])
1560ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
1561ovs-appctl -t ovs-ofctl ofctl/barrier
1562ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1563AT_CAPTURE_FILE([monitor.log])
1564
1565# Send a packet-out with a load action to set some metadata, and forward to controller
ac923e91 1566AT_CHECK([ovs-ofctl packet-out br0 controller 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), load(0xaa->NXM_NX_PKT_MARK[[]]), controller' '0001020304050010203040501234'])
969fc56c
JS
1567
1568# Stop the monitor and check its output.
1569ovs-appctl -t ovs-ofctl ofctl/barrier
1570ovs-appctl -t ovs-ofctl exit
1571
1572AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
ac923e91 1573NXT_PACKET_IN: total_len=14 in_port=CONTROLLER metadata=0xfafafafa5a5a5a5a pkt_mark=0xaa (via action) data_len=14 (unbuffered)
3f78c3cc 1574metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
751c7785
BP
1575OFPT_BARRIER_REPLY:
1576])
1577
1578OVS_VSWITCHD_STOP
1579AT_CLEANUP
2b07c8b1 1580
9dcd1c00
SH
1581dnl This test checks that metadata is encoded in packet_in structures,
1582dnl supported by NXAST.
1583AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
1584OVS_VSWITCHD_START
1585
1586# Start a monitor listening for packet-ins.
1587AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
1588ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
1589ovs-appctl -t ovs-ofctl ofctl/barrier
1590ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1591AT_CAPTURE_FILE([monitor.log])
1592
1593# Send a packet-out with a load action to set some metadata, and forward to controller
1594AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), controller' '0001020304050010203040501234'])
1595
1596# Stop the monitor and check its output.
1597ovs-appctl -t ovs-ofctl ofctl/barrier
1598ovs-appctl -t ovs-ofctl exit
1599
1600AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
1601OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY metadata=0xfafafafa5a5a5a5a (via action) data_len=14 (unbuffered)
0ad90c84
JR
1602metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
1603OFPT_BARRIER_REPLY (OF1.2):
1604])
1605
1606OVS_VSWITCHD_STOP
1607AT_CLEANUP
1608
1609dnl This test checks that tunnel metadata is encoded in packet_in structures.
1610AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
1611OVS_VSWITCHD_START
1612
1613# Start a monitor listening for packet-ins.
1614AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
1615ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
1616ovs-appctl -t ovs-ofctl ofctl/barrier
1617ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1618AT_CAPTURE_FILE([monitor.log])
1619
1620# Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
1621AT_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'])
1622
1623# Stop the monitor and check its output.
1624ovs-appctl -t ovs-ofctl ofctl/barrier
1625ovs-appctl -t ovs-ofctl exit
1626
1627AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
1628OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY tun_id=0x1020304 tun_src=127.0.0.1 tun_dst=192.168.0.1 (via action) data_len=14 (unbuffered)
9dcd1c00
SH
1629metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
1630OFPT_BARRIER_REPLY (OF1.2):
1631])
1632
1633OVS_VSWITCHD_STOP
1634AT_CLEANUP
1635
2b07c8b1
BP
1636AT_SETUP([ofproto - flow monitoring])
1637AT_KEYWORDS([monitor])
1638OVS_VSWITCHD_START
1639
1640ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
1641
1642# Start a monitor watching the flow table and check the initial reply.
1643ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
1644AT_CAPTURE_FILE([monitor.log])
1645ovs-appctl -t ovs-ofctl ofctl/barrier
1646AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
1647 [NXST_FLOW_MONITOR reply:
1648 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
1649OFPT_BARRIER_REPLY:
1650])
1651
1652# Add, delete, and modify some flows and check the updates.
1653ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1654ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
1655ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
95a1c4ca
SH
1656ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
1657ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
1658ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
1659ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
1660ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
1661ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
1662ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
1663ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
1664ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
1665ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
1666ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
1667ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
1668ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
1669ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
1670ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
1671ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
1672ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
1673ovs-ofctl add-flow br0 in_port=0,actions=output:23
2b07c8b1
BP
1674ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
1675ovs-ofctl del-flows br0 dl_vlan=123
1676ovs-ofctl del-flows br0
1677ovs-appctl -t ovs-ofctl ofctl/barrier
32cd83a2
BP
1678sort='
1679 # Sorts groups of lines that start with a space, without moving them
1680 # past the nearest line that does not start with a space.
1681 use warnings;
1682 use strict;
1683 my @buffer = ();
1684 while (<STDIN>) {
1685 if (/^ /) {
1686 push(@buffer, $_);
1687 } else {
1688 print $_ foreach sort(@buffer);
1689 print $_;
1690 @buffer = ();
1691 }
1692 }
1693 print $_ foreach sort(@buffer);
1694'
5c6d0628 1695AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | ${PERL} -e "$sort"], [0],
2b07c8b1
BP
1696[NXST_FLOW_MONITOR reply (xid=0x0):
1697 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
1698NXST_FLOW_MONITOR reply (xid=0x0):
1699 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
95a1c4ca
SH
1700NXST_FLOW_MONITOR reply (xid=0x0):
1701 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
1702NXST_FLOW_MONITOR reply (xid=0x0):
1703 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
1704NXST_FLOW_MONITOR reply (xid=0x0):
1705 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
1706NXST_FLOW_MONITOR reply (xid=0x0):
1707 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
1708NXST_FLOW_MONITOR reply (xid=0x0):
1709 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
1710NXST_FLOW_MONITOR reply (xid=0x0):
1711 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
1712NXST_FLOW_MONITOR reply (xid=0x0):
1713 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
1714NXST_FLOW_MONITOR reply (xid=0x0):
1715 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
1716NXST_FLOW_MONITOR reply (xid=0x0):
1717 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
1718NXST_FLOW_MONITOR reply (xid=0x0):
1719 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
1720NXST_FLOW_MONITOR reply (xid=0x0):
1721 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
1722NXST_FLOW_MONITOR reply (xid=0x0):
1723 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
1724NXST_FLOW_MONITOR reply (xid=0x0):
1725 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
1726NXST_FLOW_MONITOR reply (xid=0x0):
1727 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
1728NXST_FLOW_MONITOR reply (xid=0x0):
1729 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
1730NXST_FLOW_MONITOR reply (xid=0x0):
1731 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
1732NXST_FLOW_MONITOR reply (xid=0x0):
1733 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
1734NXST_FLOW_MONITOR reply (xid=0x0):
1735 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
2b07c8b1
BP
1736NXST_FLOW_MONITOR reply (xid=0x0):
1737 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
95a1c4ca
SH
1738 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
1739 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2b07c8b1
BP
1740NXST_FLOW_MONITOR reply (xid=0x0):
1741 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
95a1c4ca
SH
1742 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
1743 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2b07c8b1 1744NXST_FLOW_MONITOR reply (xid=0x0):
32cd83a2 1745 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
95a1c4ca 1746 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
32cd83a2
BP
1747 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
1748 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2b07c8b1 1749 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
95a1c4ca 1750 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
32cd83a2 1751 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
95a1c4ca 1752 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
32cd83a2
BP
1753 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
1754 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
95a1c4ca 1755 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2b07c8b1
BP
1756OFPT_BARRIER_REPLY:
1757])
1758
1759# Check that our own changes are reported as abbreviations.
1760ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1761ovs-ofctl add-flow br0 in_port=1,actions=output:2
1762ovs-ofctl add-flow br0 in_port=2,actions=output:1
90d721f0 1763ovs-appctl -t ovs-ofctl ofctl/barrier
2b07c8b1
BP
1764ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
1765ovs-appctl -t ovs-ofctl ofctl/barrier
1766AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
1767])
1768AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
1769[NXST_FLOW_MONITOR reply (xid=0x0):
1770 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
1771NXST_FLOW_MONITOR reply (xid=0x0):
1772 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
90d721f0 1773OFPT_BARRIER_REPLY:
2b07c8b1
BP
1774send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
1775NXST_FLOW_MONITOR reply (xid=0x0):
1776 event=ABBREV xid=0x12345678
1777OFPT_BARRIER_REPLY:
1778])
1779
1780ovs-appctl -t ovs-ofctl exit
1781OVS_VSWITCHD_STOP
1782AT_CLEANUP
1783
1784AT_SETUP([ofproto - flow monitoring pause and resume])
1785AT_KEYWORDS([monitor])
1786
46a80050
EM
1787# The maximum socket receive buffer size is important for this test, which
1788# tests behavior when the receive buffer overflows.
1789if test -e /proc/sys/net/core/rmem_max; then
1790 # Linux
1791 rmem_max=`cat /proc/sys/net/core/rmem_max`
1792elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
f3326eeb 1793 : # FreeBSD, NetBSD
46a80050
EM
1794else
1795 # Don't know how to get maximum socket receive buffer on this OS
1796 AT_SKIP_IF([:])
1797fi
2b07c8b1
BP
1798# Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
1799# in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
2b07c8b1
BP
1800queue_size=`expr $rmem_max + 128 \* 1024`
1801echo rmem_max=$rmem_max queue_size=$queue_size
1802
1803# Each flow update message takes up at least 48 bytes of space in queues
1804# and in practice more than that.
1805n_msgs=`expr $queue_size / 48`
1806echo n_msgs=$n_msgs
1807
1808OVS_VSWITCHD_START
1809
1810# Start a monitor watching the flow table, then make it block.
0b7140bb 1811ON_EXIT([kill `cat ovs-ofctl.pid`])
2b07c8b1
BP
1812ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
1813AT_CAPTURE_FILE([monitor.log])
1814ovs-appctl -t ovs-ofctl ofctl/block
1815
1816# Add $n_msgs flows.
1817(echo "in_port=2,actions=output:2"
5c6d0628 1818${PERL} -e '
2b07c8b1
BP
1819 for ($i = 0; $i < '$n_msgs'; $i++) {
1820 print "cookie=1,reg1=$i,actions=drop\n";
1821 }
1822') > flows.txt
1823AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
79b8c36c
BP
1824# Check that multipart flow dumps work properly:
1825AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
2b07c8b1
BP
1826AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
1827AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
1828AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
1829
1830ovs-appctl -t ovs-ofctl ofctl/unblock
1831ovs-appctl -t ovs-ofctl ofctl/barrier
1832
1833ovs-appctl -t ovs-ofctl exit
1834
1835# Check that the flow monitor reported the same number of flows
1836# added and deleted, but fewer than we actually added and deleted.
1837adds=`grep -c 'ADDED.*reg1=' monitor.log`
1838deletes=`grep -c 'DELETED.*reg1=' monitor.log`
1839echo adds=$adds deletes=$deletes
1840AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
1841AT_CHECK([test $adds = $deletes])
1842
d0ab8a1a
BP
1843# Check that the flow monitor reported everything in the expected order:
1844#
1845# event=ADDED table=0 cookie=0x1 reg1=0x22
1846# ...
1847# NXT_FLOW_MONITOR_PAUSED:
1848# ...
1849# event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
1850# ...
1851# event=ADDED table=0 cookie=0x3 in_port=1
1852# event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
1853# NXT_FLOW_MONITOR_RESUMED:
1854#
1855# except that, between the PAUSED and RESUMED, the order of the ADDED
1856# and MODIFIED lines lines depends on hash order, that is, it varies
1857# as we change the hash function or change architecture. Therefore,
1858# we use a couple of tests below to accept both orders.
2b07c8b1 1859AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
46a80050 1860/reg1=0x22$/p
2b07c8b1
BP
1861/cookie=0x[[23]]/p
1862/NXT_FLOW_MONITOR_PAUSED:/p
1863/NXT_FLOW_MONITOR_RESUMED:/p
d0ab8a1a
BP
1864' > monitor.log.subset])
1865AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
1866 event=ADDED table=0 cookie=0x1 reg1=0x22
2b07c8b1
BP
1867NXT_FLOW_MONITOR_PAUSED:
1868 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
1869 event=ADDED table=0 cookie=0x3 in_port=1
d0ab8a1a
BP
1870NXT_FLOW_MONITOR_RESUMED:
1871])
1872AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
1873NXT_FLOW_MONITOR_PAUSED:
1874 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2b07c8b1
BP
1875 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
1876NXT_FLOW_MONITOR_RESUMED:
1877])
1878
1879OVS_VSWITCHD_STOP
1880AT_CLEANUP