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 other-config:lacp-aggregation-key=2 -- \
131 set interface p1 type=patch options:peer=p3 ofport_request=2 \
132 other-config:lacp-aggregation-key=2 -- \
134 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
135 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
136 fail-mode=secure -- \
137 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
138 other-config:lacp-time=fast \
139 other-config:bond-rebalance-interval=0 -- \
140 set interface p2 type=patch options:peer=p0 ofport_request=3 \
141 other-config:lacp-aggregation-key=4 -- \
142 set interface p3 type=patch options:peer=p1 ofport_request=4 \
143 other-config:lacp-aggregation-key=4 --])
145 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
150 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
153 ovs-appctl lacp/show bond0 > bond0
154 AT_CAPTURE_FILE([bond0])
155 ovs-appctl lacp/show bond1 > bond1
156 AT_CAPTURE_FILE([bond1])
157 if grep negotiated bond0 && grep negotiated bond1; then
158 if grep expired bond0 || grep expired bond1; then
165 if test $i = 50; then
168 ovs-appctl time/warp 100
171 # Now check the correctly negotiated configuration.
173 [ovs-appctl lacp/show bond0
174 ovs-appctl lacp/show bond1
175 ovs-appctl bond/show bond0
176 ovs-appctl bond/show bond1], [0], [stdout])
177 AT_CHECK([sed '/active slave/d' stdout], [0], [dnl
179 status: active negotiated
180 sys_id: aa:55:aa:55:00:00
185 slave: p0: current attached
190 actor sys_id: aa:55:aa:55:00:00
191 actor sys_priority: 65534
193 actor port_priority: 65535
195 actor state: activity timeout aggregation synchronized collecting distributing
197 partner sys_id: aa:66:aa:66:00:00
198 partner sys_priority: 65534
200 partner port_priority: 65535
202 partner state: activity timeout aggregation synchronized collecting distributing
204 slave: p1: current attached
209 actor sys_id: aa:55:aa:55:00:00
210 actor sys_priority: 65534
212 actor port_priority: 65535
214 actor state: activity timeout aggregation synchronized collecting distributing
216 partner sys_id: aa:66:aa:66:00:00
217 partner sys_priority: 65534
219 partner port_priority: 65535
221 partner state: activity timeout aggregation synchronized collecting distributing
223 status: active negotiated
224 sys_id: aa:66:aa:66:00:00
229 slave: p2: current attached
234 actor sys_id: aa:66:aa:66:00:00
235 actor sys_priority: 65534
237 actor port_priority: 65535
239 actor state: activity timeout aggregation synchronized collecting distributing
241 partner sys_id: aa:55:aa:55:00:00
242 partner sys_priority: 65534
244 partner port_priority: 65535
246 partner state: activity timeout aggregation synchronized collecting distributing
248 slave: p3: current attached
253 actor sys_id: aa:66:aa:66:00:00
254 actor sys_priority: 65534
256 actor port_priority: 65535
258 actor state: activity timeout aggregation synchronized collecting distributing
260 partner sys_id: aa:55:aa:55:00:00
261 partner sys_priority: 65534
263 partner port_priority: 65535
265 partner state: activity timeout aggregation synchronized collecting distributing
267 bond_mode: balance-tcp
271 lacp_status: negotiated
280 bond_mode: balance-tcp
284 lacp_status: negotiated
293 AT_CHECK([grep 'active slave' stdout], [0], [dnl
298 # Redirect the patch link between p0 and p2 so that no packets get
299 # back and forth across them anymore. Then wait 4 simulated
300 # seconds. The LACP state should become "expired" for p0 and p2.
301 AT_CHECK([ovs-vsctl \
302 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
303 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
305 for i in `seq 0 40`; do ovs-appctl time/warp 100; done
307 [ovs-appctl lacp/show bond0
308 ovs-appctl lacp/show bond1
309 ovs-appctl bond/show bond0
310 ovs-appctl bond/show bond1], [0], [dnl
312 status: active negotiated
313 sys_id: aa:55:aa:55:00:00
318 slave: p0: expired attached
323 actor sys_id: aa:55:aa:55:00:00
324 actor sys_priority: 65534
326 actor port_priority: 65535
328 actor state: activity timeout aggregation synchronized collecting distributing expired
330 partner sys_id: aa:66:aa:66:00:00
331 partner sys_priority: 65534
333 partner port_priority: 65535
335 partner state: activity timeout aggregation collecting distributing
337 slave: p1: current attached
342 actor sys_id: aa:55:aa:55:00:00
343 actor sys_priority: 65534
345 actor port_priority: 65535
347 actor state: activity timeout aggregation synchronized collecting distributing
349 partner sys_id: aa:66:aa:66:00:00
350 partner sys_priority: 65534
352 partner port_priority: 65535
354 partner state: activity timeout aggregation synchronized collecting distributing
356 status: active negotiated
357 sys_id: aa:66:aa:66:00:00
362 slave: p2: expired attached
367 actor sys_id: aa:66:aa:66:00:00
368 actor sys_priority: 65534
370 actor port_priority: 65535
372 actor state: activity timeout aggregation synchronized collecting distributing expired
374 partner sys_id: aa:55:aa:55:00:00
375 partner sys_priority: 65534
377 partner port_priority: 65535
379 partner state: activity timeout aggregation collecting distributing
381 slave: p3: current attached
386 actor sys_id: aa:66:aa:66:00:00
387 actor sys_priority: 65534
389 actor port_priority: 65535
391 actor state: activity timeout aggregation synchronized collecting distributing
393 partner sys_id: aa:55:aa:55:00:00
394 partner sys_priority: 65534
396 partner port_priority: 65535
398 partner state: activity timeout aggregation synchronized collecting distributing
400 bond_mode: balance-tcp
404 lacp_status: negotiated
414 bond_mode: balance-tcp
418 lacp_status: negotiated
429 # Wait 4 more simulated seconds. The LACP state should become
430 # "defaulted" for p0 and p2.
431 for i in `seq 0 40`; do ovs-appctl time/warp 100; done
433 [ovs-appctl lacp/show bond0
434 ovs-appctl lacp/show bond1
435 ovs-appctl bond/show bond0
436 ovs-appctl bond/show bond1], [0], [dnl
438 status: active negotiated
439 sys_id: aa:55:aa:55:00:00
444 slave: p0: defaulted detached
449 actor sys_id: aa:55:aa:55:00:00
450 actor sys_priority: 65534
452 actor port_priority: 65535
454 actor state: activity timeout aggregation defaulted
456 partner sys_id: 00:00:00:00:00:00
457 partner sys_priority: 0
459 partner port_priority: 0
463 slave: p1: current attached
468 actor sys_id: aa:55:aa:55:00:00
469 actor sys_priority: 65534
471 actor port_priority: 65535
473 actor state: activity timeout aggregation synchronized collecting distributing
475 partner sys_id: aa:66:aa:66:00:00
476 partner sys_priority: 65534
478 partner port_priority: 65535
480 partner state: activity timeout aggregation synchronized collecting distributing
482 status: active negotiated
483 sys_id: aa:66:aa:66:00:00
488 slave: p2: defaulted detached
493 actor sys_id: aa:66:aa:66:00:00
494 actor sys_priority: 65534
496 actor port_priority: 65535
498 actor state: activity timeout aggregation defaulted
500 partner sys_id: 00:00:00:00:00:00
501 partner sys_priority: 0
503 partner port_priority: 0
507 slave: p3: current attached
512 actor sys_id: aa:66:aa:66:00:00
513 actor sys_priority: 65534
515 actor port_priority: 65535
517 actor state: activity timeout aggregation synchronized collecting distributing
519 partner sys_id: aa:55:aa:55:00:00
520 partner sys_priority: 65534
522 partner port_priority: 65535
524 partner state: activity timeout aggregation synchronized collecting distributing
526 bond_mode: balance-tcp
530 lacp_status: negotiated
540 bond_mode: balance-tcp
544 lacp_status: negotiated