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
124 lb_output action: disabled, bond-id: -1
127 lacp_status: negotiated
128 lacp_fallback_ab: false
129 active slave mac: 00:00:00:00:00:00(none)
141 AT_SETUP([lacp - negotiation])
142 # Create bond0 on br0 with interfaces p0 and p1
143 # and bond1 on br1 with interfaces p2 and p3
144 # with p0 patched to p2 and p1 patched to p3.
146 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
147 other-config:lacp-time=fast \
148 other-config:bond-rebalance-interval=0 -- \
149 set interface p0 type=patch options:peer=p2 ofport_request=1 \
150 other-config:lacp-aggregation-key=2 -- \
151 set interface p1 type=patch options:peer=p3 ofport_request=2 \
152 other-config:lacp-aggregation-key=2 -- \
154 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
155 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
156 fail-mode=secure -- \
157 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
158 other-config:lacp-time=fast \
159 other-config:bond-rebalance-interval=0 -- \
160 set interface p2 type=patch options:peer=p0 ofport_request=3 \
161 other-config:lacp-aggregation-key=4 -- \
162 set interface p3 type=patch options:peer=p1 ofport_request=4 \
163 other-config:lacp-aggregation-key=4 --])
165 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
170 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
173 ovs-appctl lacp/show bond0 > bond0
174 AT_CAPTURE_FILE([bond0])
175 ovs-appctl lacp/show bond1 > bond1
176 AT_CAPTURE_FILE([bond1])
177 if grep negotiated bond0 && grep negotiated bond1; then
178 if grep expired bond0 || grep expired bond1; then
185 if test $i = 50; then
188 ovs-appctl time/warp 100
191 # Now check the correctly negotiated configuration.
193 [ovs-appctl lacp/show bond0
194 ovs-appctl lacp/show bond1
195 ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
196 ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [stdout])
197 AT_CHECK([sed '/active slave/d' stdout], [0], [dnl
199 status: active negotiated
200 sys_id: aa:55:aa:55:00:00
205 slave: p0: current attached
210 actor sys_id: aa:55:aa:55:00:00
211 actor sys_priority: 65534
213 actor port_priority: 65535
215 actor state: activity timeout aggregation synchronized collecting distributing
217 partner sys_id: aa:66:aa:66:00:00
218 partner sys_priority: 65534
220 partner port_priority: 65535
222 partner state: activity timeout aggregation synchronized collecting distributing
224 slave: p1: current attached
229 actor sys_id: aa:55:aa:55:00:00
230 actor sys_priority: 65534
232 actor port_priority: 65535
234 actor state: activity timeout aggregation synchronized collecting distributing
236 partner sys_id: aa:66:aa:66:00:00
237 partner sys_priority: 65534
239 partner port_priority: 65535
241 partner state: activity timeout aggregation synchronized collecting distributing
243 status: active negotiated
244 sys_id: aa:66:aa:66:00:00
249 slave: p2: current attached
254 actor sys_id: aa:66:aa:66:00:00
255 actor sys_priority: 65534
257 actor port_priority: 65535
259 actor state: activity timeout aggregation synchronized collecting distributing
261 partner sys_id: aa:55:aa:55:00:00
262 partner sys_priority: 65534
264 partner port_priority: 65535
266 partner state: activity timeout aggregation synchronized collecting distributing
268 slave: p3: current attached
273 actor sys_id: aa:66:aa:66:00:00
274 actor sys_priority: 65534
276 actor port_priority: 65535
278 actor state: activity timeout aggregation synchronized collecting distributing
280 partner sys_id: aa:55:aa:55:00:00
281 partner sys_priority: 65534
283 partner port_priority: 65535
285 partner state: activity timeout aggregation synchronized collecting distributing
287 bond_mode: balance-tcp
288 bond may use recirculation: yes, <del>
290 lb_output action: disabled, bond-id: -1
293 lacp_status: negotiated
294 lacp_fallback_ab: false
303 bond_mode: balance-tcp
304 bond may use recirculation: yes, <del>
306 lb_output action: disabled, bond-id: -1
309 lacp_status: negotiated
310 lacp_fallback_ab: false
319 AT_CHECK([grep 'active slave$' stdout], [0], [dnl
324 # Redirect the patch link between p0 and p2 so that no packets get
325 # back and forth across them anymore. Then wait 4 simulated
326 # seconds. The LACP state should become "expired" for p0 and p2.
327 AT_CHECK([ovs-vsctl \
328 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
329 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
331 ovs-appctl time/warp 4100 100
333 [ovs-appctl lacp/show bond0
334 ovs-appctl lacp/show bond1
335 ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
336 ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [dnl
338 status: active negotiated
339 sys_id: aa:55:aa:55:00:00
344 slave: p0: expired attached
349 actor sys_id: aa:55:aa:55:00:00
350 actor sys_priority: 65534
352 actor port_priority: 65535
354 actor state: activity timeout aggregation synchronized collecting distributing expired
356 partner sys_id: aa:66:aa:66:00:00
357 partner sys_priority: 65534
359 partner port_priority: 65535
361 partner state: activity timeout aggregation collecting distributing
363 slave: p1: current attached
368 actor sys_id: aa:55:aa:55:00:00
369 actor sys_priority: 65534
371 actor port_priority: 65535
373 actor state: activity timeout aggregation synchronized collecting distributing
375 partner sys_id: aa:66:aa:66:00:00
376 partner sys_priority: 65534
378 partner port_priority: 65535
380 partner state: activity timeout aggregation synchronized collecting distributing
382 status: active negotiated
383 sys_id: aa:66:aa:66:00:00
388 slave: p2: expired attached
393 actor sys_id: aa:66:aa:66:00:00
394 actor sys_priority: 65534
396 actor port_priority: 65535
398 actor state: activity timeout aggregation synchronized collecting distributing expired
400 partner sys_id: aa:55:aa:55:00:00
401 partner sys_priority: 65534
403 partner port_priority: 65535
405 partner state: activity timeout aggregation collecting distributing
407 slave: p3: current attached
412 actor sys_id: aa:66:aa:66:00:00
413 actor sys_priority: 65534
415 actor port_priority: 65535
417 actor state: activity timeout aggregation synchronized collecting distributing
419 partner sys_id: aa:55:aa:55:00:00
420 partner sys_priority: 65534
422 partner port_priority: 65535
424 partner state: activity timeout aggregation synchronized collecting distributing
426 bond_mode: balance-tcp
427 bond may use recirculation: yes, <del>
429 lb_output action: disabled, bond-id: -1
432 lacp_status: negotiated
433 lacp_fallback_ab: false
434 <active slave mac del>
444 bond_mode: balance-tcp
445 bond may use recirculation: yes, <del>
447 lb_output action: disabled, bond-id: -1
450 lacp_status: negotiated
451 lacp_fallback_ab: false
452 <active slave mac del>
463 # Wait 4 more simulated seconds. The LACP state should become
464 # "defaulted" for p0 and p2.
465 ovs-appctl time/warp 4100 100
467 [ovs-appctl lacp/show bond0
468 ovs-appctl lacp/show bond1
469 ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
470 ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [dnl
472 status: active negotiated
473 sys_id: aa:55:aa:55:00:00
478 slave: p0: defaulted detached
483 actor sys_id: aa:55:aa:55:00:00
484 actor sys_priority: 65534
486 actor port_priority: 65535
488 actor state: activity timeout aggregation defaulted
490 partner sys_id: 00:00:00:00:00:00
491 partner sys_priority: 0
493 partner port_priority: 0
497 slave: p1: current attached
502 actor sys_id: aa:55:aa:55:00:00
503 actor sys_priority: 65534
505 actor port_priority: 65535
507 actor state: activity timeout aggregation synchronized collecting distributing
509 partner sys_id: aa:66:aa:66:00:00
510 partner sys_priority: 65534
512 partner port_priority: 65535
514 partner state: activity timeout aggregation synchronized collecting distributing
516 status: active negotiated
517 sys_id: aa:66:aa:66:00:00
522 slave: p2: defaulted detached
527 actor sys_id: aa:66:aa:66:00:00
528 actor sys_priority: 65534
530 actor port_priority: 65535
532 actor state: activity timeout aggregation defaulted
534 partner sys_id: 00:00:00:00:00:00
535 partner sys_priority: 0
537 partner port_priority: 0
541 slave: p3: current attached
546 actor sys_id: aa:66:aa:66:00:00
547 actor sys_priority: 65534
549 actor port_priority: 65535
551 actor state: activity timeout aggregation synchronized collecting distributing
553 partner sys_id: aa:55:aa:55:00:00
554 partner sys_priority: 65534
556 partner port_priority: 65535
558 partner state: activity timeout aggregation synchronized collecting distributing
560 bond_mode: balance-tcp
561 bond may use recirculation: yes, <del>
563 lb_output action: disabled, bond-id: -1
566 lacp_status: negotiated
567 lacp_fallback_ab: false
568 <active slave mac del>
578 bond_mode: balance-tcp
579 bond may use recirculation: yes, <del>
581 lb_output action: disabled, bond-id: -1
584 lacp_status: negotiated
585 lacp_fallback_ab: false
586 <active slave mac del>
597 # Reconnect the patch link between p0 and p2 to allow traffic between the ports.
598 AT_CHECK([ovs-vsctl \
599 -- del-port null0 -- set int p2 options:peer=p0 \
600 -- del-port null1 -- set int p0 options:peer=p2])
602 # Wait for 30 more seconds (LACP_SLOW_TIME_TX) for the lacp to renegotiate
603 ovs-appctl time/warp 30100 100
606 [ovs-appctl lacp/show bond0
607 ovs-appctl lacp/show bond1
608 ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
609 ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [dnl
611 status: active negotiated
612 sys_id: aa:55:aa:55:00:00
617 slave: p0: current attached
622 actor sys_id: aa:55:aa:55:00:00
623 actor sys_priority: 65534
625 actor port_priority: 65535
627 actor state: activity timeout aggregation synchronized collecting distributing
629 partner sys_id: aa:66:aa:66:00:00
630 partner sys_priority: 65534
632 partner port_priority: 65535
634 partner state: activity timeout aggregation synchronized collecting distributing
636 slave: p1: current attached
641 actor sys_id: aa:55:aa:55:00:00
642 actor sys_priority: 65534
644 actor port_priority: 65535
646 actor state: activity timeout aggregation synchronized collecting distributing
648 partner sys_id: aa:66:aa:66:00:00
649 partner sys_priority: 65534
651 partner port_priority: 65535
653 partner state: activity timeout aggregation synchronized collecting distributing
655 status: active negotiated
656 sys_id: aa:66:aa:66:00:00
661 slave: p2: current attached
666 actor sys_id: aa:66:aa:66:00:00
667 actor sys_priority: 65534
669 actor port_priority: 65535
671 actor state: activity timeout aggregation synchronized collecting distributing
673 partner sys_id: aa:55:aa:55:00:00
674 partner sys_priority: 65534
676 partner port_priority: 65535
678 partner state: activity timeout aggregation synchronized collecting distributing
680 slave: p3: current attached
685 actor sys_id: aa:66:aa:66:00:00
686 actor sys_priority: 65534
688 actor port_priority: 65535
690 actor state: activity timeout aggregation synchronized collecting distributing
692 partner sys_id: aa:55:aa:55:00:00
693 partner sys_priority: 65534
695 partner port_priority: 65535
697 partner state: activity timeout aggregation synchronized collecting distributing
699 bond_mode: balance-tcp
700 bond may use recirculation: yes, <del>
702 lb_output action: disabled, bond-id: -1
705 lacp_status: negotiated
706 lacp_fallback_ab: false
707 <active slave mac del>
717 bond_mode: balance-tcp
718 bond may use recirculation: yes, <del>
720 lb_output action: disabled, bond-id: -1
723 lacp_status: negotiated
724 lacp_fallback_ab: false
725 <active slave mac del>
739 # test lacp liveness propagation - OF1.3.
740 AT_SETUP([lacp - liveness propagation - OF1.3])
742 AT_CHECK([ovs-ofctl -O OpenFlow13 -P standard monitor br0 --detach --no-chdir --pidfile])
744 printf '\n\n--- check_liveness %d ---\n\n\n' $1
747 echo >>expout "OFPT_PORT_STATUS (OF1.3): MOD: 1(p0): addr:
750 speed: 0 Mbps now, 0 Mbps max"
754 s/ (xid=0x[0-9a-fA-F]*)//
756 s/addr:[0-9a-fA-F:]*/addr:/' < monitor.log|grep -A3 "MOD: 1(p0)"|grep -ve --]],
760 ovs-appctl -t ovs-ofctl ofctl/barrier
761 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
762 # Set miss_send_len to 128, enabling port_status messages to our service connection.
763 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
765 # Create bond0 on br0 with interfaces p0 and p1
766 # and bond1 on br1 with interfaces p2 and p3
767 # with p0 patched to p2 and p1 patched to p3.
768 AT_CHECK([ovs-vsctl add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
769 other-config:lacp-time=fast \
770 other-config:bond-rebalance-interval=0 -- \
771 set interface p0 type=patch options:peer=p2 ofport_request=1 \
772 other-config:lacp-aggregation-key=2 -- \
773 set interface p1 type=patch options:peer=p3 ofport_request=2 \
774 other-config:lacp-aggregation-key=2 -- \
776 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
777 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
778 fail-mode=secure -- \
779 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
780 other-config:lacp-time=fast \
781 other-config:bond-rebalance-interval=0 -- \
782 set interface p2 type=patch options:peer=p0 ofport_request=3 \
783 other-config:lacp-aggregation-key=4 -- \
784 set interface p3 type=patch options:peer=p1 ofport_request=4 \
785 other-config:lacp-aggregation-key=4 --])
787 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
791 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
794 ovs-appctl lacp/show bond0 > bond0
795 AT_CAPTURE_FILE([bond0])
796 ovs-appctl lacp/show bond1 > bond1
797 AT_CAPTURE_FILE([bond1])
798 if grep negotiated bond0 && grep negotiated bond1; then
799 if grep expired bond0 || grep expired bond1; then
806 if test $i = 50; then
809 ovs-appctl time/warp 100
811 check_liveness 1 LIVE
813 # Makes LACP state "expired" for p0 and p2.
814 AT_CHECK([ovs-vsctl \
815 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
816 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
818 # Wait 4 more simulated seconds. The LACP state should become "defaulted" for p0 and p2.
819 ovs-appctl time/warp 4100 100
822 # Reconnect the patch link between p0 and p2 to allow traffic between the ports.
823 AT_CHECK([ovs-vsctl \
824 -- del-port null0 -- set int p2 options:peer=p0 \
825 -- del-port null1 -- set int p0 options:peer=p2])
827 # Wait for 30 more seconds (LACP_SLOW_TIME_TX) for the lacp to renegotiate
828 ovs-appctl time/warp 30100 100
829 check_liveness 3 LIVE
834 # test lacp liveness propagation - OF1.4.
835 AT_SETUP([lacp - liveness propagation - OF1.4])
837 AT_CHECK([ovs-ofctl -O OpenFlow14 -P standard monitor br0 --detach --no-chdir --pidfile])
839 printf '\n\n--- check_liveness %d ---\n\n\n' $1
842 echo >>expout "OFPT_PORT_STATUS (OF1.4): MOD: 1(p0): addr:
845 speed: 0 Mbps now, 0 Mbps max"
849 s/ (xid=0x[0-9a-fA-F]*)//
851 s/addr:[0-9a-fA-F:]*/addr:/' < monitor.log|grep -A3 "MOD: 1(p0)"|grep -ve --]],
855 ovs-appctl -t ovs-ofctl ofctl/barrier
856 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
857 # Set miss_send_len to 128, enabling port_status messages to our service connection.
858 ovs-appctl -t ovs-ofctl ofctl/send 0509000c0123456700000080
860 # Create bond0 on br0 with interfaces p0 and p1
861 # and bond1 on br1 with interfaces p2 and p3
862 # with p0 patched to p2 and p1 patched to p3.
863 AT_CHECK([ovs-vsctl add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
864 other-config:lacp-time=fast \
865 other-config:bond-rebalance-interval=0 -- \
866 set interface p0 type=patch options:peer=p2 ofport_request=1 \
867 other-config:lacp-aggregation-key=2 -- \
868 set interface p1 type=patch options:peer=p3 ofport_request=2 \
869 other-config:lacp-aggregation-key=2 -- \
871 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
872 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
873 fail-mode=secure -- \
874 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
875 other-config:lacp-time=fast \
876 other-config:bond-rebalance-interval=0 -- \
877 set interface p2 type=patch options:peer=p0 ofport_request=3 \
878 other-config:lacp-aggregation-key=4 -- \
879 set interface p3 type=patch options:peer=p1 ofport_request=4 \
880 other-config:lacp-aggregation-key=4 --])
882 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
886 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
889 ovs-appctl lacp/show bond0 > bond0
890 AT_CAPTURE_FILE([bond0])
891 ovs-appctl lacp/show bond1 > bond1
892 AT_CAPTURE_FILE([bond1])
893 if grep negotiated bond0 && grep negotiated bond1; then
894 if grep expired bond0 || grep expired bond1; then
901 if test $i = 50; then
904 ovs-appctl time/warp 100
906 check_liveness 1 LIVE
908 # Makes LACP state "expired" for p0 and p2.
909 AT_CHECK([ovs-vsctl \
910 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
911 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
913 # Wait 4 more simulated seconds. The LACP state should become "defaulted" for p0 and p2.
914 ovs-appctl time/warp 4100 100
917 # Reconnect the patch link between p0 and p2 to allow traffic between the ports.
918 AT_CHECK([ovs-vsctl \
919 -- del-port null0 -- set int p2 options:peer=p0 \
920 -- del-port null1 -- set int p0 options:peer=p2])
922 # Wait for 30 more seconds (LACP_SLOW_TIME_TX) for the lacp to renegotiate
923 ovs-appctl time/warp 30100 100
924 check_liveness 3 LIVE
929 # test lacp liveness propagation - OF1.5.
930 AT_SETUP([lacp - liveness propagation - OF1.5])
932 AT_CHECK([ovs-ofctl -O OpenFlow15 -P standard monitor br0 --detach --no-chdir --pidfile])
934 printf '\n\n--- check_liveness %d ---\n\n\n' $1
937 echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: 1(p0): addr:
940 speed: 0 Mbps now, 0 Mbps max"
944 s/ (xid=0x[0-9a-fA-F]*)//
946 s/addr:[0-9a-fA-F:]*/addr:/' < monitor.log|grep -A3 "MOD: 1(p0)"|grep -ve --]],
950 ovs-appctl -t ovs-ofctl ofctl/barrier
951 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
952 # Set miss_send_len to 128, enabling port_status messages to our service connection.
953 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
955 # Create bond0 on br0 with interfaces p0 and p1
956 # and bond1 on br1 with interfaces p2 and p3
957 # with p0 patched to p2 and p1 patched to p3.
958 AT_CHECK([ovs-vsctl add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
959 other-config:lacp-time=fast \
960 other-config:bond-rebalance-interval=0 -- \
961 set interface p0 type=patch options:peer=p2 ofport_request=1 \
962 other-config:lacp-aggregation-key=2 -- \
963 set interface p1 type=patch options:peer=p3 ofport_request=2 \
964 other-config:lacp-aggregation-key=2 -- \
966 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
967 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
968 fail-mode=secure -- \
969 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
970 other-config:lacp-time=fast \
971 other-config:bond-rebalance-interval=0 -- \
972 set interface p2 type=patch options:peer=p0 ofport_request=3 \
973 other-config:lacp-aggregation-key=4 -- \
974 set interface p3 type=patch options:peer=p1 ofport_request=4 \
975 other-config:lacp-aggregation-key=4 --])
977 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
981 # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
984 ovs-appctl lacp/show bond0 > bond0
985 AT_CAPTURE_FILE([bond0])
986 ovs-appctl lacp/show bond1 > bond1
987 AT_CAPTURE_FILE([bond1])
988 if grep negotiated bond0 && grep negotiated bond1; then
989 if grep expired bond0 || grep expired bond1; then
996 if test $i = 50; then
999 ovs-appctl time/warp 100
1001 check_liveness 1 LIVE
1003 # Makes LACP state "expired" for p0 and p2.
1004 AT_CHECK([ovs-vsctl \
1005 -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
1006 -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
1008 # Wait 4 more simulated seconds. The LACP state should become "defaulted" for p0 and p2.
1009 ovs-appctl time/warp 4100 100
1012 # Reconnect the patch link between p0 and p2 to allow traffic between the ports.
1013 AT_CHECK([ovs-vsctl \
1014 -- del-port null0 -- set int p2 options:peer=p0 \
1015 -- del-port null1 -- set int p0 options:peer=p2])
1017 # Wait for 30 more seconds (LACP_SLOW_TIME_TX) for the lacp to renegotiate
1018 ovs-appctl time/warp 30100 100
1019 check_liveness 3 LIVE