diff options
author | nickcooper-zhangtonghao <nic@opencloud.tech> | 2017-03-22 23:36:24 -0700 |
---|---|---|
committer | Joe Stringer <joe@ovn.org> | 2017-03-27 11:29:30 -0700 |
commit | 182c78216cd2a8326e5053b5c5940293d5ac06a9 (patch) | |
tree | 65c328f6a5dbe00ed13f6b487a780bee19b73955 /tests | |
parent | a576470f19739eaf5501d39835cfe9d21260bb94 (diff) | |
download | openvswitch-182c78216cd2a8326e5053b5c5940293d5ac06a9.tar.gz |
stp: Fix stp tests and make them more stable.
The difference between machines may cause the test to fail.
More importantly, when topology is changed or the root brdige
receives the TCN BPDU, the root bridge will start the topology
change timer. We should wait the topology change timer to stop
after 35s (max age 20 + forward delay 15). After 35s, the root
bridge will stop send CONF BPDU with STP_CONFIG_TOPOLOGY_CHANGE
flag and the topology will be stable. During this time, we should
make time warp (in a second) because the hold timer of stp ports
will stop after 1s. Then the root bridge can send quickly topology
change ack (other bridges may send TCN BPDU to root bridge) for
avoiding root brdige to flush fdb and mdb frequently.
This patch has been tested on centos 7.2 (kernel 3.10.0, python
2.7.5 and gcc 4.8.5), ubuntu 16.04 (kernel 4.4.0, python 3.5.2
and gcc 5.4.0) and ubuntu 16.04 (kernel 4.10.4, python 3.5.2 and
gcc 5.4.0). This patch has been tested for 3 hours. This patch
may make the stp tests more stable.
[Committer notes]
Folded time/warp execution into a for loop.
Fixes: 427e9751f300 ("tests: Add and improve stp tests.")
Reported-at: http://paste.ubuntu.com/24215426
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-March/330032.html
Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/stp.at | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/stp.at b/tests/stp.at index 20f7940a3..bd5d20892 100644 --- a/tests/stp.at +++ b/tests/stp.at @@ -377,6 +377,11 @@ grep 'STP state change' | sed ' s/.*ofproto_dpif|.*|port .*:/port <>:/ ']]) +m4_define([FILTER_STP_TOPOLOGY_LISTENING], [[ +grep 'disabled to listening' | sed ' + s/.*ofproto_dpif|.*|port .*:/port <>:/ +']]) + m4_define([FILTER_STP_TOPOLOGY_FORWARDING], [[ grep 'learning to forwarding' | sed ' s/.*ofproto_dpif|.*|port .*:/port <>:/ @@ -427,7 +432,7 @@ AT_CHECK([ovs-ofctl add-flow br1 "in_port=2 icmp actions=8"]) ovs-appctl time/warp 3000 ovs-appctl time/warp 3000 -AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY], [0], [dnl +AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY_LISTENING], [0], [dnl port <>: STP state changed from disabled to listening port <>: STP state changed from disabled to listening ]) @@ -493,6 +498,7 @@ AT_CHECK([ ], [0]) AT_CHECK([ovs-appctl vlog/set ofproto_dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set ofproto_dpif_xlate:dbg]) AT_CHECK([ovs-ofctl add-flow br0 action=normal]) AT_CHECK([ovs-ofctl add-flow br1 action=normal]) @@ -520,7 +526,7 @@ ovs-appctl time/stop ovs-appctl time/warp 3000 ovs-appctl time/warp 3000 -AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY], [0], [dnl +AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY_LISTENING], [0], [dnl port <>: STP state changed from disabled to listening port <>: STP state changed from disabled to listening port <>: STP state changed from disabled to listening @@ -550,6 +556,19 @@ port <>: STP state changed from learning to forwarding port <>: STP state changed from learning to forwarding ]) +# When topology is changed or the root brdige receives the TCN BPDU, the +# root bridge will start the topology change timer. We should wait the +# topology change timer to stop after 35s (max age 20 + forward delay 15). +# After 35s, the root bridge will stop send CONF BPDU with +# STP_CONFIG_TOPOLOGY_CHANGE flag and the topology will be stable. More +# importantly, we should make time warp (in a second) because the hold timer +# of stp ports will stop after 1s. So the root bridge can send quickly +# topology change ack (other bridges may send TCN BPDU to root bridge) for +# avoiding root brdige to flush fdb and mdb frequently. +for i in $(seq 0 35); do + ovs-appctl time/warp 1000 +done + # root bridge sends query packet # we don't want to lose that message, so send it twice AT_CHECK([ovs-appctl netdev-dummy/receive br0 \ |