X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Flacp.at;h=0db2077381cb63d06297efdc61abf3d1a69883da;hb=003ce655b7116d18c86a74c50391e54990346931;hp=85447c9aa45a6836684f59ebbc5ff468743a4226;hpb=f3103dfa00d8c7c30af86cd861cca538caef4c15;p=sliver-openvswitch.git diff --git a/tests/lacp.at b/tests/lacp.at index 85447c9aa..0db207738 100644 --- a/tests/lacp.at +++ b/tests/lacp.at @@ -1,11 +1,21 @@ AT_BANNER([lacp]) +# Strips out Reciulation ID information since it may change over time. +m4_define([STRIP_RECIRC_ID], [[sed ' + s/Recirc-ID.*$// +' ]]) + AT_SETUP([lacp - config]) OVS_VSWITCHD_START([\ add-port br0 p1 --\ set Port p1 lacp=active --\ set Interface p1 type=dummy ]) +ovs-appctl time/stop +ovs-appctl time/warp 100 +ovs-appctl time/warp 100 +ovs-appctl time/warp 100 + AT_CHECK([ovs-appctl lacp/show], [0], [dnl ---- p1 ---- status: active negotiated @@ -53,6 +63,11 @@ OVS_VSWITCHD_START([dnl other_config:lacp-port-priority=222 \ other_config:lacp-aggregation-key=3333 ]) +ovs-appctl time/stop +ovs-appctl time/warp 100 +ovs-appctl time/warp 100 +ovs-appctl time/warp 100 + AT_CHECK([ovs-appctl lacp/show], [0], [stdout]) AT_CHECK([sed -e 's/aggregation key:.*/aggregation key: /' < stdout], [0], [dnl ---- bond ---- @@ -103,6 +118,7 @@ slave: p2: expired attached AT_CHECK([ovs-appctl bond/show], [0], [dnl ---- bond ---- bond_mode: active-backup +bond may use recirculation: no, Recirc-ID : -1 bond-hash-basis: 0 updelay: 0 ms downdelay: 0 ms @@ -126,8 +142,10 @@ OVS_VSWITCHD_START( [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \ other-config:lacp-time=fast \ other-config:bond-rebalance-interval=0 -- \ - set interface p0 type=patch options:peer=p2 ofport_request=1 -- \ - set interface p1 type=patch options:peer=p3 ofport_request=2 -- \ + set interface p0 type=patch options:peer=p2 ofport_request=1 \ + other-config:lacp-aggregation-key=2 -- \ + set interface p1 type=patch options:peer=p3 ofport_request=2 \ + other-config:lacp-aggregation-key=2 -- \ add-br br1 -- \ set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ @@ -135,12 +153,16 @@ OVS_VSWITCHD_START( add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \ other-config:lacp-time=fast \ other-config:bond-rebalance-interval=0 -- \ - set interface p2 type=patch options:peer=p0 ofport_request=3 -- \ - set interface p3 type=patch options:peer=p1 ofport_request=4 --]) + set interface p2 type=patch options:peer=p0 ofport_request=3 \ + other-config:lacp-aggregation-key=4 -- \ + set interface p3 type=patch options:peer=p1 ofport_request=4 \ + other-config:lacp-aggregation-key=4 --]) AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK ]) +ovs-appctl time/stop + # Wait for up to 5 (simulated) seconds, until LACP negotiation finishes. i=0 while :; do @@ -166,8 +188,8 @@ done AT_CHECK( [ovs-appctl lacp/show bond0 ovs-appctl lacp/show bond1 -ovs-appctl bond/show bond0 -ovs-appctl bond/show bond1], [0], [stdout]) +ovs-appctl bond/show bond0 | STRIP_RECIRC_ID +ovs-appctl bond/show bond1 | STRIP_RECIRC_ID ], [0], [stdout]) AT_CHECK([sed '/active slave/d' stdout], [0], [dnl ---- bond0 ---- status: active negotiated @@ -259,6 +281,7 @@ slave: p3: current attached partner state: activity timeout aggregation synchronized collecting distributing ---- bond0 ---- bond_mode: balance-tcp +bond may use recirculation: yes, bond-hash-basis: 0 updelay: 0 ms downdelay: 0 ms @@ -272,6 +295,7 @@ slave p1: enabled ---- bond1 ---- bond_mode: balance-tcp +bond may use recirculation: yes, bond-hash-basis: 0 updelay: 0 ms downdelay: 0 ms @@ -290,18 +314,18 @@ AT_CHECK([grep 'active slave' stdout], [0], [dnl ]) # Redirect the patch link between p0 and p2 so that no packets get -# back and forth across them anymore. Then wait 2.5 simulated +# back and forth across them anymore. Then wait 4 simulated # seconds. The LACP state should become "expired" for p0 and p2. AT_CHECK([ovs-vsctl \ -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \ -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1]) -for i in `seq 0 25`; do ovs-appctl time/warp 100; done +for i in `seq 0 40`; do ovs-appctl time/warp 100; done AT_CHECK( [ovs-appctl lacp/show bond0 ovs-appctl lacp/show bond1 -ovs-appctl bond/show bond0 -ovs-appctl bond/show bond1], [0], [dnl +ovs-appctl bond/show bond0 | STRIP_RECIRC_ID +ovs-appctl bond/show bond1 | STRIP_RECIRC_ID ], [0], [dnl ---- bond0 ---- status: active negotiated sys_id: aa:55:aa:55:00:00 @@ -392,6 +416,7 @@ slave: p3: current attached partner state: activity timeout aggregation synchronized collecting distributing ---- bond0 ---- bond_mode: balance-tcp +bond may use recirculation: yes, bond-hash-basis: 0 updelay: 0 ms downdelay: 0 ms @@ -406,6 +431,7 @@ slave p1: enabled ---- bond1 ---- bond_mode: balance-tcp +bond may use recirculation: yes, bond-hash-basis: 0 updelay: 0 ms downdelay: 0 ms @@ -426,8 +452,8 @@ for i in `seq 0 40`; do ovs-appctl time/warp 100; done AT_CHECK( [ovs-appctl lacp/show bond0 ovs-appctl lacp/show bond1 -ovs-appctl bond/show bond0 -ovs-appctl bond/show bond1], [0], [dnl +ovs-appctl bond/show bond0 | STRIP_RECIRC_ID +ovs-appctl bond/show bond1 | STRIP_RECIRC_ID ], [0], [dnl ---- bond0 ---- status: active negotiated sys_id: aa:55:aa:55:00:00 @@ -518,6 +544,7 @@ slave: p3: current attached partner state: activity timeout aggregation synchronized collecting distributing ---- bond0 ---- bond_mode: balance-tcp +bond may use recirculation: yes, bond-hash-basis: 0 updelay: 0 ms downdelay: 0 ms @@ -532,6 +559,7 @@ slave p1: enabled ---- bond1 ---- bond_mode: balance-tcp +bond may use recirculation: yes, bond-hash-basis: 0 updelay: 0 ms downdelay: 0 ms