3 AT_SETUP([lacp - config])
6 set Port p1 lacp=active --\
7 set Interface p1 type=dummy ])
10 ovs-appctl time/warp 100
11 ovs-appctl time/warp 100
12 ovs-appctl time/warp 100
14 AT_CHECK([ovs-appctl lacp/show], [0], [dnl
16 status: active negotiated
17 sys_id: aa:55:aa:55:00:00
22 slave: p1: expired attached
27 actor sys_id: aa:55:aa:55:00:00
28 actor sys_priority: 65535
30 actor port_priority: 65535
32 actor state: activity synchronized collecting distributing expired
34 partner sys_id: 00:00:00:00:00:00
35 partner sys_priority: 0
37 partner port_priority: 0
39 partner state: timeout
41 AT_CHECK([ovs-appctl bond/show])
45 AT_SETUP([lacp - multi port config])
46 OVS_VSWITCHD_START([dnl
47 add-bond br0 bond p1 p2 --\
48 set Port bond lacp=active bond-mode=active-backup \
49 other_config:lacp-time="fast" \
50 other_config:lacp-system-id=11:22:33:44:55:66 \
51 other_config:lacp-system-priority=54321 --\
52 set Interface p1 type=dummy \
53 other_config:lacp-port-id=11 \
54 other_config:lacp-port-priority=111 \
55 other_config:lacp-aggregation-key=3333 --\
56 set Interface p2 type=dummy \
57 other_config:lacp-port-id=22 \
58 other_config:lacp-port-priority=222 \
59 other_config:lacp-aggregation-key=3333 ])
62 ovs-appctl time/warp 100
63 ovs-appctl time/warp 100
64 ovs-appctl time/warp 100
66 AT_CHECK([ovs-appctl lacp/show], [0], [stdout])
67 AT_CHECK([sed -e 's/aggregation key:.*/aggregation key: <omitted>/' < stdout], [0], [dnl
69 status: active negotiated
70 sys_id: 11:22:33:44:55:66
72 aggregation key: <omitted>
75 slave: p1: expired attached
80 actor sys_id: 11:22:33:44:55:66
81 actor sys_priority: 54321
83 actor port_priority: 111
85 actor state: activity timeout aggregation synchronized collecting distributing expired
87 partner sys_id: 00:00:00:00:00:00
88 partner sys_priority: 0
90 partner port_priority: 0
92 partner state: timeout
94 slave: p2: expired attached
99 actor sys_id: 11:22:33:44:55:66
100 actor sys_priority: 54321
102 actor port_priority: 222
104 actor state: activity timeout aggregation synchronized collecting distributing expired
106 partner sys_id: 00:00:00:00:00:00
107 partner sys_priority: 0
109 partner port_priority: 0
111 partner state: timeout
113 AT_CHECK([ovs-appctl bond/show], [0], [dnl
115 bond_mode: active-backup
119 lacp_status: negotiated
131 AT_SETUP([lacp - negotiation])
132 # Create bond0 on br0 with interfaces p0 and p1
133 # and bond1 on br1 with interfaces p2 and p3
134 # with p0 patched to p2 and p1 patched to p3.
136 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
137 other-config:lacp-time=fast \
138 other-config:bond-rebalance-interval=0 -- \
139 set interface p0 type=patch options:peer=p2 ofport_request=1 \
140 other-config:lacp-aggregation-key=2 -- \
141 set interface p1 type=patch options:peer=p3 ofport_request=2 \
142 other-config:lacp-aggregation-key=2 -- \
144 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
145 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
146 fail-mode=secure -- \
147 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
148 other-config:lacp-time=fast \
149 other-config:bond-rebalance-interval=0 -- \
150 set interface p2 type=patch options:peer=p0 ofport_request=3 \
151 other-config:lacp-aggregation-key=4 -- \
152 set interface p3 type=patch options:peer=p1 ofport_request=4 \
153 other-config:lacp-aggregation-key=4 --])
155 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
160 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
163 ovs-appctl lacp/show bond0 > bond0
164 AT_CAPTURE_FILE([bond0])
165 ovs-appctl lacp/show bond1 > bond1
166 AT_CAPTURE_FILE([bond1])
167 if grep negotiated bond0 && grep negotiated bond1; then
168 if grep expired bond0 || grep expired bond1; then
175 if test $i = 50; then
178 ovs-appctl time/warp 100
181 # Now check the correctly negotiated configuration.
183 [ovs-appctl lacp/show bond0
184 ovs-appctl lacp/show bond1
185 ovs-appctl bond/show bond0
186 ovs-appctl bond/show bond1], [0], [stdout])
187 AT_CHECK([sed '/active slave/d' stdout], [0], [dnl
189 status: active negotiated
190 sys_id: aa:55:aa:55:00:00
195 slave: p0: current attached
200 actor sys_id: aa:55:aa:55:00:00
201 actor sys_priority: 65534
203 actor port_priority: 65535
205 actor state: activity timeout aggregation synchronized collecting distributing
207 partner sys_id: aa:66:aa:66:00:00
208 partner sys_priority: 65534
210 partner port_priority: 65535
212 partner state: activity timeout aggregation synchronized collecting distributing
214 slave: p1: current attached
219 actor sys_id: aa:55:aa:55:00:00
220 actor sys_priority: 65534
222 actor port_priority: 65535
224 actor state: activity timeout aggregation synchronized collecting distributing
226 partner sys_id: aa:66:aa:66:00:00
227 partner sys_priority: 65534
229 partner port_priority: 65535
231 partner state: activity timeout aggregation synchronized collecting distributing
233 status: active negotiated
234 sys_id: aa:66:aa:66:00:00
239 slave: p2: current attached
244 actor sys_id: aa:66:aa:66:00:00
245 actor sys_priority: 65534
247 actor port_priority: 65535
249 actor state: activity timeout aggregation synchronized collecting distributing
251 partner sys_id: aa:55:aa:55:00:00
252 partner sys_priority: 65534
254 partner port_priority: 65535
256 partner state: activity timeout aggregation synchronized collecting distributing
258 slave: p3: current attached
263 actor sys_id: aa:66:aa:66:00:00
264 actor sys_priority: 65534
266 actor port_priority: 65535
268 actor state: activity timeout aggregation synchronized collecting distributing
270 partner sys_id: aa:55:aa:55:00:00
271 partner sys_priority: 65534
273 partner port_priority: 65535
275 partner state: activity timeout aggregation synchronized collecting distributing
277 bond_mode: balance-tcp
281 lacp_status: negotiated
290 bond_mode: balance-tcp
294 lacp_status: negotiated
303 AT_CHECK([grep 'active slave' stdout], [0], [dnl
308 # Redirect the patch link between p0 and p2 so that no packets get
309 # back and forth across them anymore. Then wait 4 simulated
310 # seconds. The LACP state should become "expired" for p0 and p2.
311 AT_CHECK([ovs-vsctl \
312 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
313 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
315 for i in `seq 0 40`; do ovs-appctl time/warp 100; done
317 [ovs-appctl lacp/show bond0
318 ovs-appctl lacp/show bond1
319 ovs-appctl bond/show bond0
320 ovs-appctl bond/show bond1], [0], [dnl
322 status: active negotiated
323 sys_id: aa:55:aa:55:00:00
328 slave: p0: expired attached
333 actor sys_id: aa:55:aa:55:00:00
334 actor sys_priority: 65534
336 actor port_priority: 65535
338 actor state: activity timeout aggregation synchronized collecting distributing expired
340 partner sys_id: aa:66:aa:66:00:00
341 partner sys_priority: 65534
343 partner port_priority: 65535
345 partner state: activity timeout aggregation collecting distributing
347 slave: p1: current attached
352 actor sys_id: aa:55:aa:55:00:00
353 actor sys_priority: 65534
355 actor port_priority: 65535
357 actor state: activity timeout aggregation synchronized collecting distributing
359 partner sys_id: aa:66:aa:66:00:00
360 partner sys_priority: 65534
362 partner port_priority: 65535
364 partner state: activity timeout aggregation synchronized collecting distributing
366 status: active negotiated
367 sys_id: aa:66:aa:66:00:00
372 slave: p2: expired attached
377 actor sys_id: aa:66:aa:66:00:00
378 actor sys_priority: 65534
380 actor port_priority: 65535
382 actor state: activity timeout aggregation synchronized collecting distributing expired
384 partner sys_id: aa:55:aa:55:00:00
385 partner sys_priority: 65534
387 partner port_priority: 65535
389 partner state: activity timeout aggregation collecting distributing
391 slave: p3: current attached
396 actor sys_id: aa:66:aa:66:00:00
397 actor sys_priority: 65534
399 actor port_priority: 65535
401 actor state: activity timeout aggregation synchronized collecting distributing
403 partner sys_id: aa:55:aa:55:00:00
404 partner sys_priority: 65534
406 partner port_priority: 65535
408 partner state: activity timeout aggregation synchronized collecting distributing
410 bond_mode: balance-tcp
414 lacp_status: negotiated
424 bond_mode: balance-tcp
428 lacp_status: negotiated
439 # Wait 4 more simulated seconds. The LACP state should become
440 # "defaulted" for p0 and p2.
441 for i in `seq 0 40`; do ovs-appctl time/warp 100; done
443 [ovs-appctl lacp/show bond0
444 ovs-appctl lacp/show bond1
445 ovs-appctl bond/show bond0
446 ovs-appctl bond/show bond1], [0], [dnl
448 status: active negotiated
449 sys_id: aa:55:aa:55:00:00
454 slave: p0: defaulted detached
459 actor sys_id: aa:55:aa:55:00:00
460 actor sys_priority: 65534
462 actor port_priority: 65535
464 actor state: activity timeout aggregation defaulted
466 partner sys_id: 00:00:00:00:00:00
467 partner sys_priority: 0
469 partner port_priority: 0
473 slave: p1: current attached
478 actor sys_id: aa:55:aa:55:00:00
479 actor sys_priority: 65534
481 actor port_priority: 65535
483 actor state: activity timeout aggregation synchronized collecting distributing
485 partner sys_id: aa:66:aa:66:00:00
486 partner sys_priority: 65534
488 partner port_priority: 65535
490 partner state: activity timeout aggregation synchronized collecting distributing
492 status: active negotiated
493 sys_id: aa:66:aa:66:00:00
498 slave: p2: defaulted detached
503 actor sys_id: aa:66:aa:66:00:00
504 actor sys_priority: 65534
506 actor port_priority: 65535
508 actor state: activity timeout aggregation defaulted
510 partner sys_id: 00:00:00:00:00:00
511 partner sys_priority: 0
513 partner port_priority: 0
517 slave: p3: current attached
522 actor sys_id: aa:66:aa:66:00:00
523 actor sys_priority: 65534
525 actor port_priority: 65535
527 actor state: activity timeout aggregation synchronized collecting distributing
529 partner sys_id: aa:55:aa:55:00:00
530 partner sys_priority: 65534
532 partner port_priority: 65535
534 partner state: activity timeout aggregation synchronized collecting distributing
536 bond_mode: balance-tcp
540 lacp_status: negotiated
550 bond_mode: balance-tcp
554 lacp_status: negotiated