3 # Strips out Reciulation ID information since it may change over time.
4 m4_define([STRIP_RECIRC_ID], [[sed '
8 # Strips out active slave mac address since it may change over time.
9 m4_define([STRIP_ACTIVE_SLAVE_MAC], [[sed '
10 s/active slave mac.*$/<active slave mac del>/
13 AT_SETUP([lacp - config])
16 set Port p1 lacp=active --\
17 set Interface p1 type=dummy ])
20 ovs-appctl time/warp 100
21 ovs-appctl time/warp 100
22 ovs-appctl time/warp 100
24 AT_CHECK([ovs-appctl lacp/show], [0], [dnl
26 status: active negotiated
27 sys_id: aa:55:aa:55:00:00
32 slave: p1: expired attached
37 actor sys_id: aa:55:aa:55:00:00
38 actor sys_priority: 65535
40 actor port_priority: 65535
42 actor state: activity synchronized collecting distributing expired
44 partner sys_id: 00:00:00:00:00:00
45 partner sys_priority: 0
47 partner port_priority: 0
49 partner state: timeout
51 AT_CHECK([ovs-appctl bond/show])
55 AT_SETUP([lacp - multi port config])
56 OVS_VSWITCHD_START([dnl
57 add-bond br0 bond p1 p2 --\
58 set Port bond lacp=active bond-mode=active-backup \
59 other_config:lacp-time="fast" \
60 other_config:lacp-system-id=11:22:33:44:55:66 \
61 other_config:lacp-system-priority=54321 --\
62 set Interface p1 type=dummy \
63 other_config:lacp-port-id=11 \
64 other_config:lacp-port-priority=111 \
65 other_config:lacp-aggregation-key=3333 --\
66 set Interface p2 type=dummy \
67 other_config:lacp-port-id=22 \
68 other_config:lacp-port-priority=222 \
69 other_config:lacp-aggregation-key=3333 ])
72 ovs-appctl time/warp 100
73 ovs-appctl time/warp 100
74 ovs-appctl time/warp 100
76 AT_CHECK([ovs-appctl lacp/show], [0], [stdout])
77 AT_CHECK([sed -e 's/aggregation key:.*/aggregation key: <omitted>/' < stdout], [0], [dnl
79 status: active negotiated
80 sys_id: 11:22:33:44:55:66
82 aggregation key: <omitted>
85 slave: p1: expired attached
90 actor sys_id: 11:22:33:44:55:66
91 actor sys_priority: 54321
93 actor port_priority: 111
95 actor state: activity timeout aggregation synchronized collecting distributing expired
97 partner sys_id: 00:00:00:00:00:00
98 partner sys_priority: 0
100 partner port_priority: 0
102 partner state: timeout
104 slave: p2: expired attached
109 actor sys_id: 11:22:33:44:55:66
110 actor sys_priority: 54321
112 actor port_priority: 222
114 actor state: activity timeout aggregation synchronized collecting distributing expired
116 partner sys_id: 00:00:00:00:00:00
117 partner sys_priority: 0
119 partner port_priority: 0
121 partner state: timeout
123 AT_CHECK([ovs-appctl bond/show], [0], [dnl
125 bond_mode: active-backup
126 bond may use recirculation: no, Recirc-ID : -1
130 lacp_status: negotiated
131 active slave mac: 00:00:00:00:00:00(none)
143 AT_SETUP([lacp - negotiation])
144 # Create bond0 on br0 with interfaces p0 and p1
145 # and bond1 on br1 with interfaces p2 and p3
146 # with p0 patched to p2 and p1 patched to p3.
148 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
149 other-config:lacp-time=fast \
150 other-config:bond-rebalance-interval=0 -- \
151 set interface p0 type=patch options:peer=p2 ofport_request=1 \
152 other-config:lacp-aggregation-key=2 -- \
153 set interface p1 type=patch options:peer=p3 ofport_request=2 \
154 other-config:lacp-aggregation-key=2 -- \
156 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
157 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
158 fail-mode=secure -- \
159 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
160 other-config:lacp-time=fast \
161 other-config:bond-rebalance-interval=0 -- \
162 set interface p2 type=patch options:peer=p0 ofport_request=3 \
163 other-config:lacp-aggregation-key=4 -- \
164 set interface p3 type=patch options:peer=p1 ofport_request=4 \
165 other-config:lacp-aggregation-key=4 --])
167 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
172 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
175 ovs-appctl lacp/show bond0 > bond0
176 AT_CAPTURE_FILE([bond0])
177 ovs-appctl lacp/show bond1 > bond1
178 AT_CAPTURE_FILE([bond1])
179 if grep negotiated bond0 && grep negotiated bond1; then
180 if grep expired bond0 || grep expired bond1; then
187 if test $i = 50; then
190 ovs-appctl time/warp 100
193 # Now check the correctly negotiated configuration.
195 [ovs-appctl lacp/show bond0
196 ovs-appctl lacp/show bond1
197 ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
198 ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [stdout])
199 AT_CHECK([sed '/active slave/d' stdout], [0], [dnl
201 status: active negotiated
202 sys_id: aa:55:aa:55:00:00
207 slave: p0: current attached
212 actor sys_id: aa:55:aa:55:00:00
213 actor sys_priority: 65534
215 actor port_priority: 65535
217 actor state: activity timeout aggregation synchronized collecting distributing
219 partner sys_id: aa:66:aa:66:00:00
220 partner sys_priority: 65534
222 partner port_priority: 65535
224 partner state: activity timeout aggregation synchronized collecting distributing
226 slave: p1: current attached
231 actor sys_id: aa:55:aa:55:00:00
232 actor sys_priority: 65534
234 actor port_priority: 65535
236 actor state: activity timeout aggregation synchronized collecting distributing
238 partner sys_id: aa:66:aa:66:00:00
239 partner sys_priority: 65534
241 partner port_priority: 65535
243 partner state: activity timeout aggregation synchronized collecting distributing
245 status: active negotiated
246 sys_id: aa:66:aa:66:00:00
251 slave: p2: current attached
256 actor sys_id: aa:66:aa:66:00:00
257 actor sys_priority: 65534
259 actor port_priority: 65535
261 actor state: activity timeout aggregation synchronized collecting distributing
263 partner sys_id: aa:55:aa:55:00:00
264 partner sys_priority: 65534
266 partner port_priority: 65535
268 partner state: activity timeout aggregation synchronized collecting distributing
270 slave: p3: current attached
275 actor sys_id: aa:66:aa:66:00:00
276 actor sys_priority: 65534
278 actor port_priority: 65535
280 actor state: activity timeout aggregation synchronized collecting distributing
282 partner sys_id: aa:55:aa:55:00:00
283 partner sys_priority: 65534
285 partner port_priority: 65535
287 partner state: activity timeout aggregation synchronized collecting distributing
289 bond_mode: balance-tcp
290 bond may use recirculation: yes, <del>
294 lacp_status: negotiated
303 bond_mode: balance-tcp
304 bond may use recirculation: yes, <del>
308 lacp_status: negotiated
317 AT_CHECK([grep 'active slave$' stdout], [0], [dnl
322 # Redirect the patch link between p0 and p2 so that no packets get
323 # back and forth across them anymore. Then wait 4 simulated
324 # seconds. The LACP state should become "expired" for p0 and p2.
325 AT_CHECK([ovs-vsctl \
326 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
327 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
329 for i in `seq 0 40`; do ovs-appctl time/warp 100; done
331 [ovs-appctl lacp/show bond0
332 ovs-appctl lacp/show bond1
333 ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
334 ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [dnl
336 status: active negotiated
337 sys_id: aa:55:aa:55:00:00
342 slave: p0: expired attached
347 actor sys_id: aa:55:aa:55:00:00
348 actor sys_priority: 65534
350 actor port_priority: 65535
352 actor state: activity timeout aggregation synchronized collecting distributing expired
354 partner sys_id: aa:66:aa:66:00:00
355 partner sys_priority: 65534
357 partner port_priority: 65535
359 partner state: activity timeout aggregation collecting distributing
361 slave: p1: current attached
366 actor sys_id: aa:55:aa:55:00:00
367 actor sys_priority: 65534
369 actor port_priority: 65535
371 actor state: activity timeout aggregation synchronized collecting distributing
373 partner sys_id: aa:66:aa:66:00:00
374 partner sys_priority: 65534
376 partner port_priority: 65535
378 partner state: activity timeout aggregation synchronized collecting distributing
380 status: active negotiated
381 sys_id: aa:66:aa:66:00:00
386 slave: p2: expired attached
391 actor sys_id: aa:66:aa:66:00:00
392 actor sys_priority: 65534
394 actor port_priority: 65535
396 actor state: activity timeout aggregation synchronized collecting distributing expired
398 partner sys_id: aa:55:aa:55:00:00
399 partner sys_priority: 65534
401 partner port_priority: 65535
403 partner state: activity timeout aggregation collecting distributing
405 slave: p3: current attached
410 actor sys_id: aa:66:aa:66:00:00
411 actor sys_priority: 65534
413 actor port_priority: 65535
415 actor state: activity timeout aggregation synchronized collecting distributing
417 partner sys_id: aa:55:aa:55:00:00
418 partner sys_priority: 65534
420 partner port_priority: 65535
422 partner state: activity timeout aggregation synchronized collecting distributing
424 bond_mode: balance-tcp
425 bond may use recirculation: yes, <del>
429 lacp_status: negotiated
430 <active slave mac del>
440 bond_mode: balance-tcp
441 bond may use recirculation: yes, <del>
445 lacp_status: negotiated
446 <active slave mac del>
457 # Wait 4 more simulated seconds. The LACP state should become
458 # "defaulted" for p0 and p2.
459 for i in `seq 0 40`; do ovs-appctl time/warp 100; done
461 [ovs-appctl lacp/show bond0
462 ovs-appctl lacp/show bond1
463 ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
464 ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [dnl
466 status: active negotiated
467 sys_id: aa:55:aa:55:00:00
472 slave: p0: defaulted detached
477 actor sys_id: aa:55:aa:55:00:00
478 actor sys_priority: 65534
480 actor port_priority: 65535
482 actor state: activity timeout aggregation defaulted
484 partner sys_id: 00:00:00:00:00:00
485 partner sys_priority: 0
487 partner port_priority: 0
491 slave: p1: current attached
496 actor sys_id: aa:55:aa:55:00:00
497 actor sys_priority: 65534
499 actor port_priority: 65535
501 actor state: activity timeout aggregation synchronized collecting distributing
503 partner sys_id: aa:66:aa:66:00:00
504 partner sys_priority: 65534
506 partner port_priority: 65535
508 partner state: activity timeout aggregation synchronized collecting distributing
510 status: active negotiated
511 sys_id: aa:66:aa:66:00:00
516 slave: p2: defaulted detached
521 actor sys_id: aa:66:aa:66:00:00
522 actor sys_priority: 65534
524 actor port_priority: 65535
526 actor state: activity timeout aggregation defaulted
528 partner sys_id: 00:00:00:00:00:00
529 partner sys_priority: 0
531 partner port_priority: 0
535 slave: p3: current attached
540 actor sys_id: aa:66:aa:66:00:00
541 actor sys_priority: 65534
543 actor port_priority: 65535
545 actor state: activity timeout aggregation synchronized collecting distributing
547 partner sys_id: aa:55:aa:55:00:00
548 partner sys_priority: 65534
550 partner port_priority: 65535
552 partner state: activity timeout aggregation synchronized collecting distributing
554 bond_mode: balance-tcp
555 bond may use recirculation: yes, <del>
559 lacp_status: negotiated
560 <active slave mac del>
570 bond_mode: balance-tcp
571 bond may use recirculation: yes, <del>
575 lacp_status: negotiated
576 <active slave mac del>