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 300 100
22 AT_CHECK([ovs-appctl lacp/show], [0], [dnl
24 status: active negotiated
25 sys_id: aa:55:aa:55:00:00
30 slave: p1: expired attached
35 actor sys_id: aa:55:aa:55:00:00
36 actor sys_priority: 65535
38 actor port_priority: 65535
40 actor state: activity synchronized collecting distributing expired
42 partner sys_id: 00:00:00:00:00:00
43 partner sys_priority: 0
45 partner port_priority: 0
47 partner state: timeout
49 AT_CHECK([ovs-appctl bond/show])
53 AT_SETUP([lacp - multi port config])
54 OVS_VSWITCHD_START([dnl
55 add-bond br0 bond p1 p2 --\
56 set Port bond lacp=active bond-mode=active-backup \
57 other_config:lacp-time="fast" \
58 other_config:lacp-system-id=11:22:33:44:55:66 \
59 other_config:lacp-system-priority=54321 --\
60 set Interface p1 type=dummy \
61 other_config:lacp-port-id=11 \
62 other_config:lacp-port-priority=111 \
63 other_config:lacp-aggregation-key=3333 --\
64 set Interface p2 type=dummy \
65 other_config:lacp-port-id=22 \
66 other_config:lacp-port-priority=222 \
67 other_config:lacp-aggregation-key=3333 ])
70 ovs-appctl time/warp 300 100
72 AT_CHECK([ovs-appctl lacp/show], [0], [stdout])
73 AT_CHECK([sed -e 's/aggregation key:.*/aggregation key: <omitted>/' < stdout], [0], [dnl
75 status: active negotiated
76 sys_id: 11:22:33:44:55:66
78 aggregation key: <omitted>
81 slave: p1: expired attached
86 actor sys_id: 11:22:33:44:55:66
87 actor sys_priority: 54321
89 actor port_priority: 111
91 actor state: activity timeout aggregation synchronized collecting distributing expired
93 partner sys_id: 00:00:00:00:00:00
94 partner sys_priority: 0
96 partner port_priority: 0
98 partner state: timeout
100 slave: p2: expired attached
105 actor sys_id: 11:22:33:44:55:66
106 actor sys_priority: 54321
108 actor port_priority: 222
110 actor state: activity timeout aggregation synchronized collecting distributing expired
112 partner sys_id: 00:00:00:00:00:00
113 partner sys_priority: 0
115 partner port_priority: 0
117 partner state: timeout
119 AT_CHECK([ovs-appctl bond/show], [0], [dnl
121 bond_mode: active-backup
122 bond may use recirculation: no, Recirc-ID : -1
126 lacp_status: negotiated
127 lacp_fallback_ab: false
128 active slave mac: 00:00:00:00:00:00(none)
140 AT_SETUP([lacp - negotiation])
141 # Create bond0 on br0 with interfaces p0 and p1
142 # and bond1 on br1 with interfaces p2 and p3
143 # with p0 patched to p2 and p1 patched to p3.
145 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
146 other-config:lacp-time=fast \
147 other-config:bond-rebalance-interval=0 -- \
148 set interface p0 type=patch options:peer=p2 ofport_request=1 \
149 other-config:lacp-aggregation-key=2 -- \
150 set interface p1 type=patch options:peer=p3 ofport_request=2 \
151 other-config:lacp-aggregation-key=2 -- \
153 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
154 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
155 fail-mode=secure -- \
156 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
157 other-config:lacp-time=fast \
158 other-config:bond-rebalance-interval=0 -- \
159 set interface p2 type=patch options:peer=p0 ofport_request=3 \
160 other-config:lacp-aggregation-key=4 -- \
161 set interface p3 type=patch options:peer=p1 ofport_request=4 \
162 other-config:lacp-aggregation-key=4 --])
164 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
169 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
172 ovs-appctl lacp/show bond0 > bond0
173 AT_CAPTURE_FILE([bond0])
174 ovs-appctl lacp/show bond1 > bond1
175 AT_CAPTURE_FILE([bond1])
176 if grep negotiated bond0 && grep negotiated bond1; then
177 if grep expired bond0 || grep expired bond1; then
184 if test $i = 50; then
187 ovs-appctl time/warp 100
190 # Now check the correctly negotiated configuration.
192 [ovs-appctl lacp/show bond0
193 ovs-appctl lacp/show bond1
194 ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
195 ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [stdout])
196 AT_CHECK([sed '/active slave/d' stdout], [0], [dnl
198 status: active negotiated
199 sys_id: aa:55:aa:55:00:00
204 slave: p0: 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 slave: p1: current attached
228 actor sys_id: aa:55:aa:55: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:66:aa:66:00:00
236 partner sys_priority: 65534
238 partner port_priority: 65535
240 partner state: activity timeout aggregation synchronized collecting distributing
242 status: active negotiated
243 sys_id: aa:66:aa:66:00:00
248 slave: p2: 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 slave: p3: current attached
272 actor sys_id: aa:66:aa:66:00:00
273 actor sys_priority: 65534
275 actor port_priority: 65535
277 actor state: activity timeout aggregation synchronized collecting distributing
279 partner sys_id: aa:55:aa:55:00:00
280 partner sys_priority: 65534
282 partner port_priority: 65535
284 partner state: activity timeout aggregation synchronized collecting distributing
286 bond_mode: balance-tcp
287 bond may use recirculation: yes, <del>
291 lacp_status: negotiated
292 lacp_fallback_ab: false
301 bond_mode: balance-tcp
302 bond may use recirculation: yes, <del>
306 lacp_status: negotiated
307 lacp_fallback_ab: false
316 AT_CHECK([grep 'active slave$' stdout], [0], [dnl
321 # Redirect the patch link between p0 and p2 so that no packets get
322 # back and forth across them anymore. Then wait 4 simulated
323 # seconds. The LACP state should become "expired" for p0 and p2.
324 AT_CHECK([ovs-vsctl \
325 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
326 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
328 ovs-appctl time/warp 4100 100
330 [ovs-appctl lacp/show bond0
331 ovs-appctl lacp/show bond1
332 ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
333 ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [dnl
335 status: active negotiated
336 sys_id: aa:55:aa:55:00:00
341 slave: p0: expired attached
346 actor sys_id: aa:55:aa:55:00:00
347 actor sys_priority: 65534
349 actor port_priority: 65535
351 actor state: activity timeout aggregation synchronized collecting distributing expired
353 partner sys_id: aa:66:aa:66:00:00
354 partner sys_priority: 65534
356 partner port_priority: 65535
358 partner state: activity timeout aggregation collecting distributing
360 slave: p1: current attached
365 actor sys_id: aa:55:aa:55:00:00
366 actor sys_priority: 65534
368 actor port_priority: 65535
370 actor state: activity timeout aggregation synchronized collecting distributing
372 partner sys_id: aa:66:aa:66:00:00
373 partner sys_priority: 65534
375 partner port_priority: 65535
377 partner state: activity timeout aggregation synchronized collecting distributing
379 status: active negotiated
380 sys_id: aa:66:aa:66:00:00
385 slave: p2: expired attached
390 actor sys_id: aa:66:aa:66:00:00
391 actor sys_priority: 65534
393 actor port_priority: 65535
395 actor state: activity timeout aggregation synchronized collecting distributing expired
397 partner sys_id: aa:55:aa:55:00:00
398 partner sys_priority: 65534
400 partner port_priority: 65535
402 partner state: activity timeout aggregation collecting distributing
404 slave: p3: current attached
409 actor sys_id: aa:66:aa:66:00:00
410 actor sys_priority: 65534
412 actor port_priority: 65535
414 actor state: activity timeout aggregation synchronized collecting distributing
416 partner sys_id: aa:55:aa:55:00:00
417 partner sys_priority: 65534
419 partner port_priority: 65535
421 partner state: activity timeout aggregation synchronized collecting distributing
423 bond_mode: balance-tcp
424 bond may use recirculation: yes, <del>
428 lacp_status: negotiated
429 lacp_fallback_ab: false
430 <active slave mac del>
440 bond_mode: balance-tcp
441 bond may use recirculation: yes, <del>
445 lacp_status: negotiated
446 lacp_fallback_ab: false
447 <active slave mac del>
458 # Wait 4 more simulated seconds. The LACP state should become
459 # "defaulted" for p0 and p2.
460 ovs-appctl time/warp 4100 100
462 [ovs-appctl lacp/show bond0
463 ovs-appctl lacp/show bond1
464 ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
465 ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [dnl
467 status: active negotiated
468 sys_id: aa:55:aa:55:00:00
473 slave: p0: defaulted detached
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 defaulted
485 partner sys_id: 00:00:00:00:00:00
486 partner sys_priority: 0
488 partner port_priority: 0
492 slave: p1: current attached
497 actor sys_id: aa:55:aa:55:00:00
498 actor sys_priority: 65534
500 actor port_priority: 65535
502 actor state: activity timeout aggregation synchronized collecting distributing
504 partner sys_id: aa:66:aa:66:00:00
505 partner sys_priority: 65534
507 partner port_priority: 65535
509 partner state: activity timeout aggregation synchronized collecting distributing
511 status: active negotiated
512 sys_id: aa:66:aa:66:00:00
517 slave: p2: defaulted detached
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 defaulted
529 partner sys_id: 00:00:00:00:00:00
530 partner sys_priority: 0
532 partner port_priority: 0
536 slave: p3: current attached
541 actor sys_id: aa:66:aa:66:00:00
542 actor sys_priority: 65534
544 actor port_priority: 65535
546 actor state: activity timeout aggregation synchronized collecting distributing
548 partner sys_id: aa:55:aa:55:00:00
549 partner sys_priority: 65534
551 partner port_priority: 65535
553 partner state: activity timeout aggregation synchronized collecting distributing
555 bond_mode: balance-tcp
556 bond may use recirculation: yes, <del>
560 lacp_status: negotiated
561 lacp_fallback_ab: false
562 <active slave mac del>
572 bond_mode: balance-tcp
573 bond may use recirculation: yes, <del>
577 lacp_status: negotiated
578 lacp_fallback_ab: false
579 <active slave mac del>
590 # Reconnect the patch link between p0 and p2 to allow traffic between the ports.
591 AT_CHECK([ovs-vsctl \
592 -- del-port null0 -- set int p2 options:peer=p0 \
593 -- del-port null1 -- set int p0 options:peer=p2])
595 # Wait for 30 more seconds (LACP_SLOW_TIME_TX) for the lacp to renegotiate
596 ovs-appctl time/warp 30100 100
599 [ovs-appctl lacp/show bond0
600 ovs-appctl lacp/show bond1
601 ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
602 ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [dnl
604 status: active negotiated
605 sys_id: aa:55:aa:55:00:00
610 slave: p0: current attached
615 actor sys_id: aa:55:aa:55:00:00
616 actor sys_priority: 65534
618 actor port_priority: 65535
620 actor state: activity timeout aggregation synchronized collecting distributing
622 partner sys_id: aa:66:aa:66:00:00
623 partner sys_priority: 65534
625 partner port_priority: 65535
627 partner state: activity timeout aggregation synchronized collecting distributing
629 slave: p1: current attached
634 actor sys_id: aa:55:aa:55:00:00
635 actor sys_priority: 65534
637 actor port_priority: 65535
639 actor state: activity timeout aggregation synchronized collecting distributing
641 partner sys_id: aa:66:aa:66:00:00
642 partner sys_priority: 65534
644 partner port_priority: 65535
646 partner state: activity timeout aggregation synchronized collecting distributing
648 status: active negotiated
649 sys_id: aa:66:aa:66:00:00
654 slave: p2: current attached
659 actor sys_id: aa:66:aa:66:00:00
660 actor sys_priority: 65534
662 actor port_priority: 65535
664 actor state: activity timeout aggregation synchronized collecting distributing
666 partner sys_id: aa:55:aa:55:00:00
667 partner sys_priority: 65534
669 partner port_priority: 65535
671 partner state: activity timeout aggregation synchronized collecting distributing
673 slave: p3: current attached
678 actor sys_id: aa:66:aa:66:00:00
679 actor sys_priority: 65534
681 actor port_priority: 65535
683 actor state: activity timeout aggregation synchronized collecting distributing
685 partner sys_id: aa:55:aa:55:00:00
686 partner sys_priority: 65534
688 partner port_priority: 65535
690 partner state: activity timeout aggregation synchronized collecting distributing
692 bond_mode: balance-tcp
693 bond may use recirculation: yes, <del>
697 lacp_status: negotiated
698 lacp_fallback_ab: false
699 <active slave mac del>
709 bond_mode: balance-tcp
710 bond may use recirculation: yes, <del>
714 lacp_status: negotiated
715 lacp_fallback_ab: false
716 <active slave mac del>
730 # test lacp liveness propagation - OF1.3.
731 AT_SETUP([lacp - liveness propagation - OF1.3])
733 AT_CHECK([ovs-ofctl -O OpenFlow13 -P standard monitor br0 --detach --no-chdir --pidfile])
735 printf '\n\n--- check_liveness %d ---\n\n\n' $1
738 echo >>expout "OFPT_PORT_STATUS (OF1.3): MOD: 1(p0): addr:
741 speed: 0 Mbps now, 0 Mbps max"
745 s/ (xid=0x[0-9a-fA-F]*)//
747 s/addr:[0-9a-fA-F:]*/addr:/' < monitor.log|grep -A3 "MOD: 1(p0)"|grep -ve --]],
751 ovs-appctl -t ovs-ofctl ofctl/barrier
752 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
753 # Set miss_send_len to 128, enabling port_status messages to our service connection.
754 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
756 # Create bond0 on br0 with interfaces p0 and p1
757 # and bond1 on br1 with interfaces p2 and p3
758 # with p0 patched to p2 and p1 patched to p3.
759 AT_CHECK([ovs-vsctl add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
760 other-config:lacp-time=fast \
761 other-config:bond-rebalance-interval=0 -- \
762 set interface p0 type=patch options:peer=p2 ofport_request=1 \
763 other-config:lacp-aggregation-key=2 -- \
764 set interface p1 type=patch options:peer=p3 ofport_request=2 \
765 other-config:lacp-aggregation-key=2 -- \
767 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
768 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
769 fail-mode=secure -- \
770 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
771 other-config:lacp-time=fast \
772 other-config:bond-rebalance-interval=0 -- \
773 set interface p2 type=patch options:peer=p0 ofport_request=3 \
774 other-config:lacp-aggregation-key=4 -- \
775 set interface p3 type=patch options:peer=p1 ofport_request=4 \
776 other-config:lacp-aggregation-key=4 --])
778 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
782 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
785 ovs-appctl lacp/show bond0 > bond0
786 AT_CAPTURE_FILE([bond0])
787 ovs-appctl lacp/show bond1 > bond1
788 AT_CAPTURE_FILE([bond1])
789 if grep negotiated bond0 && grep negotiated bond1; then
790 if grep expired bond0 || grep expired bond1; then
797 if test $i = 50; then
800 ovs-appctl time/warp 100
802 check_liveness 1 LIVE
804 # Makes LACP state "expired" for p0 and p2.
805 AT_CHECK([ovs-vsctl \
806 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
807 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
809 # Wait 4 more simulated seconds. The LACP state should become "defaulted" for p0 and p2.
810 ovs-appctl time/warp 4100 100
813 # Reconnect the patch link between p0 and p2 to allow traffic between the ports.
814 AT_CHECK([ovs-vsctl \
815 -- del-port null0 -- set int p2 options:peer=p0 \
816 -- del-port null1 -- set int p0 options:peer=p2])
818 # Wait for 30 more seconds (LACP_SLOW_TIME_TX) for the lacp to renegotiate
819 ovs-appctl time/warp 30100 100
820 check_liveness 3 LIVE
825 # test lacp liveness propagation - OF1.4.
826 AT_SETUP([lacp - liveness propagation - OF1.4])
828 AT_CHECK([ovs-ofctl -O OpenFlow14 -P standard monitor br0 --detach --no-chdir --pidfile])
830 printf '\n\n--- check_liveness %d ---\n\n\n' $1
833 echo >>expout "OFPT_PORT_STATUS (OF1.4): MOD: 1(p0): addr:
836 speed: 0 Mbps now, 0 Mbps max"
840 s/ (xid=0x[0-9a-fA-F]*)//
842 s/addr:[0-9a-fA-F:]*/addr:/' < monitor.log|grep -A3 "MOD: 1(p0)"|grep -ve --]],
846 ovs-appctl -t ovs-ofctl ofctl/barrier
847 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
848 # Set miss_send_len to 128, enabling port_status messages to our service connection.
849 ovs-appctl -t ovs-ofctl ofctl/send 0509000c0123456700000080
851 # Create bond0 on br0 with interfaces p0 and p1
852 # and bond1 on br1 with interfaces p2 and p3
853 # with p0 patched to p2 and p1 patched to p3.
854 AT_CHECK([ovs-vsctl add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
855 other-config:lacp-time=fast \
856 other-config:bond-rebalance-interval=0 -- \
857 set interface p0 type=patch options:peer=p2 ofport_request=1 \
858 other-config:lacp-aggregation-key=2 -- \
859 set interface p1 type=patch options:peer=p3 ofport_request=2 \
860 other-config:lacp-aggregation-key=2 -- \
862 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
863 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
864 fail-mode=secure -- \
865 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
866 other-config:lacp-time=fast \
867 other-config:bond-rebalance-interval=0 -- \
868 set interface p2 type=patch options:peer=p0 ofport_request=3 \
869 other-config:lacp-aggregation-key=4 -- \
870 set interface p3 type=patch options:peer=p1 ofport_request=4 \
871 other-config:lacp-aggregation-key=4 --])
873 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
877 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
880 ovs-appctl lacp/show bond0 > bond0
881 AT_CAPTURE_FILE([bond0])
882 ovs-appctl lacp/show bond1 > bond1
883 AT_CAPTURE_FILE([bond1])
884 if grep negotiated bond0 && grep negotiated bond1; then
885 if grep expired bond0 || grep expired bond1; then
892 if test $i = 50; then
895 ovs-appctl time/warp 100
897 check_liveness 1 LIVE
899 # Makes LACP state "expired" for p0 and p2.
900 AT_CHECK([ovs-vsctl \
901 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
902 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
904 # Wait 4 more simulated seconds. The LACP state should become "defaulted" for p0 and p2.
905 ovs-appctl time/warp 4100 100
908 # Reconnect the patch link between p0 and p2 to allow traffic between the ports.
909 AT_CHECK([ovs-vsctl \
910 -- del-port null0 -- set int p2 options:peer=p0 \
911 -- del-port null1 -- set int p0 options:peer=p2])
913 # Wait for 30 more seconds (LACP_SLOW_TIME_TX) for the lacp to renegotiate
914 ovs-appctl time/warp 30100 100
915 check_liveness 3 LIVE
920 # test lacp liveness propagation - OF1.5.
921 AT_SETUP([lacp - liveness propagation - OF1.5])
923 AT_CHECK([ovs-ofctl -O OpenFlow15 -P standard monitor br0 --detach --no-chdir --pidfile])
925 printf '\n\n--- check_liveness %d ---\n\n\n' $1
928 echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: 1(p0): addr:
931 speed: 0 Mbps now, 0 Mbps max"
935 s/ (xid=0x[0-9a-fA-F]*)//
937 s/addr:[0-9a-fA-F:]*/addr:/' < monitor.log|grep -A3 "MOD: 1(p0)"|grep -ve --]],
941 ovs-appctl -t ovs-ofctl ofctl/barrier
942 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
943 # Set miss_send_len to 128, enabling port_status messages to our service connection.
944 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
946 # Create bond0 on br0 with interfaces p0 and p1
947 # and bond1 on br1 with interfaces p2 and p3
948 # with p0 patched to p2 and p1 patched to p3.
949 AT_CHECK([ovs-vsctl add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
950 other-config:lacp-time=fast \
951 other-config:bond-rebalance-interval=0 -- \
952 set interface p0 type=patch options:peer=p2 ofport_request=1 \
953 other-config:lacp-aggregation-key=2 -- \
954 set interface p1 type=patch options:peer=p3 ofport_request=2 \
955 other-config:lacp-aggregation-key=2 -- \
957 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
958 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
959 fail-mode=secure -- \
960 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
961 other-config:lacp-time=fast \
962 other-config:bond-rebalance-interval=0 -- \
963 set interface p2 type=patch options:peer=p0 ofport_request=3 \
964 other-config:lacp-aggregation-key=4 -- \
965 set interface p3 type=patch options:peer=p1 ofport_request=4 \
966 other-config:lacp-aggregation-key=4 --])
968 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
972 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
975 ovs-appctl lacp/show bond0 > bond0
976 AT_CAPTURE_FILE([bond0])
977 ovs-appctl lacp/show bond1 > bond1
978 AT_CAPTURE_FILE([bond1])
979 if grep negotiated bond0 && grep negotiated bond1; then
980 if grep expired bond0 || grep expired bond1; then
987 if test $i = 50; then
990 ovs-appctl time/warp 100
992 check_liveness 1 LIVE
994 # Makes LACP state "expired" for p0 and p2.
995 AT_CHECK([ovs-vsctl \
996 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
997 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
999 # Wait 4 more simulated seconds. The LACP state should become "defaulted" for p0 and p2.
1000 ovs-appctl time/warp 4100 100
1003 # Reconnect the patch link between p0 and p2 to allow traffic between the ports.
1004 AT_CHECK([ovs-vsctl \
1005 -- del-port null0 -- set int p2 options:peer=p0 \
1006 -- del-port null1 -- set int p0 options:peer=p2])
1008 # Wait for 30 more seconds (LACP_SLOW_TIME_TX) for the lacp to renegotiate
1009 ovs-appctl time/warp 30100 100
1010 check_liveness 3 LIVE