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
144 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
147 ovs-appctl lacp/show bond0 > bond0
148 AT_CAPTURE_FILE([bond0])
149 ovs-appctl lacp/show bond1 > bond1
150 AT_CAPTURE_FILE([bond1])
151 if grep negotiated bond0 && grep negotiated bond1; then
152 if grep expired bond0 || grep expired bond1; then
159 if test $i = 50; then
162 ovs-appctl time/warp 100
165 # Now check the correctly negotiated configuration.
167 [ovs-appctl lacp/show bond0
168 ovs-appctl lacp/show bond1
169 ovs-appctl bond/show bond0
170 ovs-appctl bond/show bond1], [0], [stdout])
171 AT_CHECK([sed '/active slave/d' stdout], [0], [dnl
173 status: active negotiated
174 sys_id: aa:55:aa:55:00:00
179 slave: p0: current attached
184 actor sys_id: aa:55:aa:55:00:00
185 actor sys_priority: 65534
187 actor port_priority: 65535
189 actor state: activity timeout aggregation synchronized collecting distributing
191 partner sys_id: aa:66:aa:66:00:00
192 partner sys_priority: 65534
194 partner port_priority: 65535
196 partner state: activity timeout aggregation synchronized collecting distributing
198 slave: p1: current attached
203 actor sys_id: aa:55:aa:55:00:00
204 actor sys_priority: 65534
206 actor port_priority: 65535
208 actor state: activity timeout aggregation synchronized collecting distributing
210 partner sys_id: aa:66:aa:66:00:00
211 partner sys_priority: 65534
213 partner port_priority: 65535
215 partner state: activity timeout aggregation synchronized collecting distributing
217 status: active negotiated
218 sys_id: aa:66:aa:66:00:00
223 slave: p2: current attached
228 actor sys_id: aa:66:aa:66:00:00
229 actor sys_priority: 65534
231 actor port_priority: 65535
233 actor state: activity timeout aggregation synchronized collecting distributing
235 partner sys_id: aa:55:aa:55:00:00
236 partner sys_priority: 65534
238 partner port_priority: 65535
240 partner state: activity timeout aggregation synchronized collecting distributing
242 slave: p3: current attached
247 actor sys_id: aa:66:aa:66:00:00
248 actor sys_priority: 65534
250 actor port_priority: 65535
252 actor state: activity timeout aggregation synchronized collecting distributing
254 partner sys_id: aa:55:aa:55:00:00
255 partner sys_priority: 65534
257 partner port_priority: 65535
259 partner state: activity timeout aggregation synchronized collecting distributing
261 bond_mode: balance-tcp
265 lacp_status: negotiated
274 bond_mode: balance-tcp
278 lacp_status: negotiated
287 AT_CHECK([grep 'active slave' stdout], [0], [dnl
292 # Redirect the patch link between p0 and p2 so that no packets get
293 # back and forth across them anymore. Then wait 4 simulated
294 # seconds. The LACP state should become "expired" for p0 and p2.
295 AT_CHECK([ovs-vsctl \
296 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
297 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
299 for i in `seq 0 40`; do ovs-appctl time/warp 100; done
301 [ovs-appctl lacp/show bond0
302 ovs-appctl lacp/show bond1
303 ovs-appctl bond/show bond0
304 ovs-appctl bond/show bond1], [0], [dnl
306 status: active negotiated
307 sys_id: aa:55:aa:55:00:00
312 slave: p0: expired attached
317 actor sys_id: aa:55:aa:55:00:00
318 actor sys_priority: 65534
320 actor port_priority: 65535
322 actor state: activity timeout aggregation synchronized collecting distributing expired
324 partner sys_id: aa:66:aa:66:00:00
325 partner sys_priority: 65534
327 partner port_priority: 65535
329 partner state: activity timeout aggregation collecting distributing
331 slave: p1: current attached
336 actor sys_id: aa:55:aa:55:00:00
337 actor sys_priority: 65534
339 actor port_priority: 65535
341 actor state: activity timeout aggregation synchronized collecting distributing
343 partner sys_id: aa:66:aa:66:00:00
344 partner sys_priority: 65534
346 partner port_priority: 65535
348 partner state: activity timeout aggregation synchronized collecting distributing
350 status: active negotiated
351 sys_id: aa:66:aa:66:00:00
356 slave: p2: expired attached
361 actor sys_id: aa:66:aa:66:00:00
362 actor sys_priority: 65534
364 actor port_priority: 65535
366 actor state: activity timeout aggregation synchronized collecting distributing expired
368 partner sys_id: aa:55:aa:55:00:00
369 partner sys_priority: 65534
371 partner port_priority: 65535
373 partner state: activity timeout aggregation collecting distributing
375 slave: p3: current attached
380 actor sys_id: aa:66:aa:66:00:00
381 actor sys_priority: 65534
383 actor port_priority: 65535
385 actor state: activity timeout aggregation synchronized collecting distributing
387 partner sys_id: aa:55:aa:55:00:00
388 partner sys_priority: 65534
390 partner port_priority: 65535
392 partner state: activity timeout aggregation synchronized collecting distributing
394 bond_mode: balance-tcp
398 lacp_status: negotiated
408 bond_mode: balance-tcp
412 lacp_status: negotiated
423 # Wait 4 more simulated seconds. The LACP state should become
424 # "defaulted" for p0 and p2.
425 for i in `seq 0 40`; do ovs-appctl time/warp 100; done
427 [ovs-appctl lacp/show bond0
428 ovs-appctl lacp/show bond1
429 ovs-appctl bond/show bond0
430 ovs-appctl bond/show bond1], [0], [dnl
432 status: active negotiated
433 sys_id: aa:55:aa:55:00:00
438 slave: p0: defaulted detached
443 actor sys_id: aa:55:aa:55:00:00
444 actor sys_priority: 65534
446 actor port_priority: 65535
448 actor state: activity timeout aggregation defaulted
450 partner sys_id: 00:00:00:00:00:00
451 partner sys_priority: 0
453 partner port_priority: 0
457 slave: p1: current attached
462 actor sys_id: aa:55:aa:55:00:00
463 actor sys_priority: 65534
465 actor port_priority: 65535
467 actor state: activity timeout aggregation synchronized collecting distributing
469 partner sys_id: aa:66:aa:66:00:00
470 partner sys_priority: 65534
472 partner port_priority: 65535
474 partner state: activity timeout aggregation synchronized collecting distributing
476 status: active negotiated
477 sys_id: aa:66:aa:66:00:00
482 slave: p2: defaulted detached
487 actor sys_id: aa:66:aa:66:00:00
488 actor sys_priority: 65534
490 actor port_priority: 65535
492 actor state: activity timeout aggregation defaulted
494 partner sys_id: 00:00:00:00:00:00
495 partner sys_priority: 0
497 partner port_priority: 0
501 slave: p3: current attached
506 actor sys_id: aa:66:aa:66:00:00
507 actor sys_priority: 65534
509 actor port_priority: 65535
511 actor state: activity timeout aggregation synchronized collecting distributing
513 partner sys_id: aa:55:aa:55:00:00
514 partner sys_priority: 65534
516 partner port_priority: 65535
518 partner state: activity timeout aggregation synchronized collecting distributing
520 bond_mode: balance-tcp
524 lacp_status: negotiated
534 bond_mode: balance-tcp
538 lacp_status: negotiated