3 AT_SETUP([lacp - config])
6 set Port p1 lacp=active --\
7 set Interface p1 type=dummy ])
9 AT_CHECK([ovs-appctl lacp/show], [0], [dnl
11 status: active negotiated
12 sys_id: aa:55:aa:55:00:00
17 slave: p1: expired attached
22 actor sys_id: aa:55:aa:55:00:00
23 actor sys_priority: 65535
25 actor port_priority: 65535
27 actor state: activity synchronized collecting distributing expired
29 partner sys_id: 00:00:00:00:00:00
30 partner sys_priority: 0
32 partner port_priority: 0
34 partner state: timeout
36 AT_CHECK([ovs-appctl bond/show])
40 AT_SETUP([lacp - multi port config])
41 OVS_VSWITCHD_START([dnl
42 add-bond br0 bond p1 p2 --\
43 set Port bond lacp=active bond-mode=active-backup \
44 other_config:lacp-time="fast" \
45 other_config:lacp-system-id=11:22:33:44:55:66 \
46 other_config:lacp-system-priority=54321 --\
47 set Interface p1 type=dummy \
48 other_config:lacp-port-id=11 \
49 other_config:lacp-port-priority=111 \
50 other_config:lacp-aggregation-key=3333 --\
51 set Interface p2 type=dummy \
52 other_config:lacp-port-id=22 \
53 other_config:lacp-port-priority=222 \
54 other_config:lacp-aggregation-key=3333 ])
56 AT_CHECK([ovs-appctl lacp/show], [0], [stdout])
57 AT_CHECK([sed -e 's/aggregation key:.*/aggregation key: <omitted>/' < stdout], [0], [dnl
59 status: active negotiated
60 sys_id: 11:22:33:44:55:66
62 aggregation key: <omitted>
65 slave: p1: expired attached
70 actor sys_id: 11:22:33:44:55:66
71 actor sys_priority: 54321
73 actor port_priority: 111
75 actor state: activity timeout aggregation synchronized collecting distributing expired
77 partner sys_id: 00:00:00:00:00:00
78 partner sys_priority: 0
80 partner port_priority: 0
82 partner state: timeout
84 slave: p2: expired attached
89 actor sys_id: 11:22:33:44:55:66
90 actor sys_priority: 54321
92 actor port_priority: 222
94 actor state: activity timeout aggregation synchronized collecting distributing expired
96 partner sys_id: 00:00:00:00:00:00
97 partner sys_priority: 0
99 partner port_priority: 0
101 partner state: timeout
103 AT_CHECK([ovs-appctl bond/show], [0], [dnl
105 bond_mode: active-backup
109 lacp_status: negotiated
121 AT_SETUP([lacp - negotiation])
122 # Create bond0 on br0 with interfaces p0 and p1
123 # and bond1 on br1 with interfaces p2 and p3
124 # with p0 patched to p2 and p1 patched to p3.
126 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
127 other-config:lacp-time=fast \
128 other-config:bond-rebalance-interval=0 -- \
129 set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
130 set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
132 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
133 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
134 fail-mode=secure -- \
135 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
136 other-config:lacp-time=fast \
137 other-config:bond-rebalance-interval=0 -- \
138 set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
139 set interface p3 type=patch options:peer=p1 ofport_request=4 --])
141 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
146 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
149 ovs-appctl lacp/show bond0 > bond0
150 AT_CAPTURE_FILE([bond0])
151 ovs-appctl lacp/show bond1 > bond1
152 AT_CAPTURE_FILE([bond1])
153 if grep negotiated bond0 && grep negotiated bond1; then
154 if grep expired bond0 || grep expired bond1; then
161 if test $i = 50; then
164 ovs-appctl time/warp 100
167 # Now check the correctly negotiated configuration.
169 [ovs-appctl lacp/show bond0
170 ovs-appctl lacp/show bond1
171 ovs-appctl bond/show bond0
172 ovs-appctl bond/show bond1], [0], [stdout])
173 AT_CHECK([sed '/active slave/d' stdout], [0], [dnl
175 status: active negotiated
176 sys_id: aa:55:aa:55:00:00
181 slave: p0: current attached
186 actor sys_id: aa:55:aa:55:00:00
187 actor sys_priority: 65534
189 actor port_priority: 65535
191 actor state: activity timeout aggregation synchronized collecting distributing
193 partner sys_id: aa:66:aa:66:00:00
194 partner sys_priority: 65534
196 partner port_priority: 65535
198 partner state: activity timeout aggregation synchronized collecting distributing
200 slave: p1: current attached
205 actor sys_id: aa:55:aa:55:00:00
206 actor sys_priority: 65534
208 actor port_priority: 65535
210 actor state: activity timeout aggregation synchronized collecting distributing
212 partner sys_id: aa:66:aa:66:00:00
213 partner sys_priority: 65534
215 partner port_priority: 65535
217 partner state: activity timeout aggregation synchronized collecting distributing
219 status: active negotiated
220 sys_id: aa:66:aa:66:00:00
225 slave: p2: current attached
230 actor sys_id: aa:66:aa:66:00:00
231 actor sys_priority: 65534
233 actor port_priority: 65535
235 actor state: activity timeout aggregation synchronized collecting distributing
237 partner sys_id: aa:55:aa:55:00:00
238 partner sys_priority: 65534
240 partner port_priority: 65535
242 partner state: activity timeout aggregation synchronized collecting distributing
244 slave: p3: current attached
249 actor sys_id: aa:66:aa:66:00:00
250 actor sys_priority: 65534
252 actor port_priority: 65535
254 actor state: activity timeout aggregation synchronized collecting distributing
256 partner sys_id: aa:55:aa:55:00:00
257 partner sys_priority: 65534
259 partner port_priority: 65535
261 partner state: activity timeout aggregation synchronized collecting distributing
263 bond_mode: balance-tcp
267 lacp_status: negotiated
276 bond_mode: balance-tcp
280 lacp_status: negotiated
289 AT_CHECK([grep 'active slave' stdout], [0], [dnl
294 # Redirect the patch link between p0 and p2 so that no packets get
295 # back and forth across them anymore. Then wait 4 simulated
296 # seconds. The LACP state should become "expired" for p0 and p2.
297 AT_CHECK([ovs-vsctl \
298 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
299 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
301 for i in `seq 0 40`; do ovs-appctl time/warp 100; done
303 [ovs-appctl lacp/show bond0
304 ovs-appctl lacp/show bond1
305 ovs-appctl bond/show bond0
306 ovs-appctl bond/show bond1], [0], [dnl
308 status: active negotiated
309 sys_id: aa:55:aa:55:00:00
314 slave: p0: expired attached
319 actor sys_id: aa:55:aa:55:00:00
320 actor sys_priority: 65534
322 actor port_priority: 65535
324 actor state: activity timeout aggregation synchronized collecting distributing expired
326 partner sys_id: aa:66:aa:66:00:00
327 partner sys_priority: 65534
329 partner port_priority: 65535
331 partner state: activity timeout aggregation collecting distributing
333 slave: p1: current attached
338 actor sys_id: aa:55:aa:55:00:00
339 actor sys_priority: 65534
341 actor port_priority: 65535
343 actor state: activity timeout aggregation synchronized collecting distributing
345 partner sys_id: aa:66:aa:66:00:00
346 partner sys_priority: 65534
348 partner port_priority: 65535
350 partner state: activity timeout aggregation synchronized collecting distributing
352 status: active negotiated
353 sys_id: aa:66:aa:66:00:00
358 slave: p2: expired attached
363 actor sys_id: aa:66:aa:66:00:00
364 actor sys_priority: 65534
366 actor port_priority: 65535
368 actor state: activity timeout aggregation synchronized collecting distributing expired
370 partner sys_id: aa:55:aa:55:00:00
371 partner sys_priority: 65534
373 partner port_priority: 65535
375 partner state: activity timeout aggregation collecting distributing
377 slave: p3: current attached
382 actor sys_id: aa:66:aa:66:00:00
383 actor sys_priority: 65534
385 actor port_priority: 65535
387 actor state: activity timeout aggregation synchronized collecting distributing
389 partner sys_id: aa:55:aa:55:00:00
390 partner sys_priority: 65534
392 partner port_priority: 65535
394 partner state: activity timeout aggregation synchronized collecting distributing
396 bond_mode: balance-tcp
400 lacp_status: negotiated
410 bond_mode: balance-tcp
414 lacp_status: negotiated
425 # Wait 4 more simulated seconds. The LACP state should become
426 # "defaulted" for p0 and p2.
427 for i in `seq 0 40`; do ovs-appctl time/warp 100; done
429 [ovs-appctl lacp/show bond0
430 ovs-appctl lacp/show bond1
431 ovs-appctl bond/show bond0
432 ovs-appctl bond/show bond1], [0], [dnl
434 status: active negotiated
435 sys_id: aa:55:aa:55:00:00
440 slave: p0: defaulted detached
445 actor sys_id: aa:55:aa:55:00:00
446 actor sys_priority: 65534
448 actor port_priority: 65535
450 actor state: activity timeout aggregation defaulted
452 partner sys_id: 00:00:00:00:00:00
453 partner sys_priority: 0
455 partner port_priority: 0
459 slave: p1: current attached
464 actor sys_id: aa:55:aa:55:00:00
465 actor sys_priority: 65534
467 actor port_priority: 65535
469 actor state: activity timeout aggregation synchronized collecting distributing
471 partner sys_id: aa:66:aa:66:00:00
472 partner sys_priority: 65534
474 partner port_priority: 65535
476 partner state: activity timeout aggregation synchronized collecting distributing
478 status: active negotiated
479 sys_id: aa:66:aa:66:00:00
484 slave: p2: defaulted detached
489 actor sys_id: aa:66:aa:66:00:00
490 actor sys_priority: 65534
492 actor port_priority: 65535
494 actor state: activity timeout aggregation defaulted
496 partner sys_id: 00:00:00:00:00:00
497 partner sys_priority: 0
499 partner port_priority: 0
503 slave: p3: current attached
508 actor sys_id: aa:66:aa:66:00:00
509 actor sys_priority: 65534
511 actor port_priority: 65535
513 actor state: activity timeout aggregation synchronized collecting distributing
515 partner sys_id: aa:55:aa:55:00:00
516 partner sys_priority: 65534
518 partner port_priority: 65535
520 partner state: activity timeout aggregation synchronized collecting distributing
522 bond_mode: balance-tcp
526 lacp_status: negotiated
536 bond_mode: balance-tcp
540 lacp_status: negotiated