On 9 March 2017 at 03:49, nickcooper-zhangtonghao <[email protected]> wrote:
> This patch makes the stp tests more stable and
> adds the test for fdb/mdb flushing when topology
> is changed.
>
> Signed-off-by: nickcooper-zhangtonghao <[email protected]>
> ---
> tests/stp.at | 163
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 154 insertions(+), 9 deletions(-)
>
> diff --git a/tests/stp.at b/tests/stp.at
> index 8b64218..20f7940 100644
> --- a/tests/stp.at
> +++ b/tests/stp.at
> @@ -374,7 +374,12 @@ m4_define([STRIP_USED], [[sed '
> ']])
> m4_define([FILTER_STP_TOPOLOGY], [[
> grep 'STP state change' | sed '
> - s/.*ofproto_dpif|.*|//
> + s/.*ofproto_dpif|.*|port .*:/port <>:/
> +']])
> +
> +m4_define([FILTER_STP_TOPOLOGY_FORWARDING], [[
> +grep 'learning to forwarding' | sed '
> + s/.*ofproto_dpif|.*|port .*:/port <>:/
> ']])
>
> AT_SETUP([STP - dummy interface])
> @@ -423,8 +428,8 @@ ovs-appctl time/warp 3000
> ovs-appctl time/warp 3000
>
> AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY], [0], [dnl
> -port p1: STP state changed from disabled to listening
> -port p2: STP state changed from disabled to listening
> +port <>: STP state changed from disabled to listening
> +port <>: STP state changed from disabled to listening
> ])
>
> AT_CHECK([ovs-appctl ofproto/trace ovs-dummy
> 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
> | grep STP], [0], [dnl
> @@ -445,14 +450,15 @@ ovs-appctl time/warp 3000
> ovs-appctl time/warp 3000
> ovs-appctl time/warp 3000
> ovs-appctl time/warp 3000
> +ovs-appctl time/warp 3000
>
> AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY], [0], [dnl
> -port p1: STP state changed from disabled to listening
> -port p2: STP state changed from disabled to listening
> -port p1: STP state changed from listening to learning
> -port p2: STP state changed from listening to learning
> -port p1: STP state changed from learning to forwarding
> -port p2: STP state changed from learning to forwarding
> +port <>: STP state changed from disabled to listening
> +port <>: STP state changed from disabled to listening
> +port <>: STP state changed from listening to learning
> +port <>: STP state changed from listening to learning
> +port <>: STP state changed from learning to forwarding
> +port <>: STP state changed from learning to forwarding
> ])
>
> AT_CHECK([ovs-appctl ofproto/trace ovs-dummy
> 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
> | grep Datapath], [0], [dnl
> @@ -462,5 +468,144 @@ AT_CHECK([ovs-appctl ofproto/trace ovs-dummy
> 'in_port(8),eth(src=50:54:00:00:00:
> Datapath actions: 2
> ])
>
> +AT_CLEANUP
> +
> +AT_SETUP([STP - flush the fdb and mdb when topology changed])
> +OVS_VSWITCHD_START([])
> +
> +# setting as below, the br0 will be root bridge and p5 will be blocked.
> +AT_CHECK([
> + ovs-vsctl -- \
> + set port br0 other_config:stp-enable=false -- \
> + set bridge br0 datapath-type=dummy -- \
> + set bridge br0 stp_enable=true mcast_snooping_enable=true \
> + other-config:hwaddr=aa:66:aa:66:00:00 -- \
> + add-br br1 -- \
> + set port br1 other_config:stp-enable=false -- \
> + set bridge br1 datapath-type=dummy -- \
> + set bridge br1 stp_enable=true mcast_snooping_enable=true \
> + other-config:hwaddr=aa:66:aa:66:00:01 -- \
> + add-br br2 -- \
> + set port br2 other_config:stp-enable=false -- \
> + set bridge br2 datapath-type=dummy -- \
> + set bridge br2 stp_enable=true mcast_snooping_enable=true \
> + other-config:hwaddr=aa:66:aa:66:00:02
> +], [0])
> +
> +AT_CHECK([ovs-appctl vlog/set ofproto_dpif:dbg])
> +
> +AT_CHECK([ovs-ofctl add-flow br0 action=normal])
> +AT_CHECK([ovs-ofctl add-flow br1 action=normal])
> +AT_CHECK([ovs-ofctl add-flow br2 action=normal])
> +
> +AT_CHECK([
> + ovs-vsctl add-port br0 p1 -- \
> + set interface p1 type=dummy
> options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1
> + ovs-vsctl add-port br0 p2 -- \
> + set interface p2 type=dummy options:stream=unix:$OVS_RUNDIR/p6.sock
> ofport_request=2
> + ovs-vsctl add-port br1 p3 -- \
> + set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock
> ofport_request=3
> + ovs-vsctl add-port br1 p4 -- \
> + set interface p4 type=dummy
> options:pstream=punix:$OVS_RUNDIR/p4.sock ofport_request=4
> + ovs-vsctl add-port br2 p5 -- \
> + set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p4.sock
> ofport_request=5
> + ovs-vsctl add-port br2 p6 -- \
> + set interface p6 type=dummy
> options:pstream=punix:$OVS_RUNDIR/p6.sock ofport_request=6
> +], [0])
> +
> +
> +ovs-appctl time/stop
> +
> +# give time for STP to move initially
> +ovs-appctl time/warp 3000
> +ovs-appctl time/warp 3000
> +
> +AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY], [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
> +port <>: STP state changed from disabled to listening
> +port <>: STP state changed from disabled to listening
> +port <>: STP state changed from disabled to listening
> +])
> +
> +# give time for STP to synchronize
> +ovs-appctl time/warp 3000
> +ovs-appctl time/warp 3000
> +ovs-appctl time/warp 3000
> +ovs-appctl time/warp 3000
> +ovs-appctl time/warp 3000
> +
> +ovs-appctl time/warp 3000
> +ovs-appctl time/warp 3000
> +ovs-appctl time/warp 3000
> +ovs-appctl time/warp 3000
> +ovs-appctl time/warp 3000
> +
> +AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY_FORWARDING], [0], [dnl
> +port <>: STP state changed from learning to forwarding
> +port <>: STP state changed from learning to forwarding
> +port <>: STP state changed from learning to forwarding
> +port <>: STP state changed from learning to forwarding
> +port <>: STP state changed from learning to forwarding
> +])
> +
> +# 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 \
> +
> '01005E010101000C29A027D18100000108004500001C000100004002CBCBAC102201E00101011114EEEB00000000'])
> +
> +ovs-appctl time/warp 1000
> +AT_CHECK([ovs-appctl netdev-dummy/receive br0 \
> +
> '01005E010101000C29A027D18100000108004500001C000100004002CBCBAC102201E00101011114EEEB00000000'])
> +
> +OVS_WAIT_UNTIL([ovs-appctl fdb/show br0 | grep '00:0c:29:a0:27:d1'])
> +OVS_WAIT_UNTIL([ovs-appctl fdb/show br1 | grep '00:0c:29:a0:27:d1'])
> +OVS_WAIT_UNTIL([ovs-appctl fdb/show br2 | grep '00:0c:29:a0:27:d1'])
> +
> +OVS_WAIT_UNTIL([ovs-appctl mdb/show br0 | grep 'querier'])
Hmm, on my system this test just times out on this line and I get the
dreaded 'hard failure' (ie, it tried several times and the condition
never became true).
(My system is a bit weird, with newer kernel, python3 by default and
other things, but I don't see how any of that relates to this
particular problem..)
Here's my testsuite log:
# -*- compilation -*-
2180. stp.at:473: testing STP - flush the fdb and mdb when topology changed ...
../../tests/stp.at:474: ovsdb-tool create conf.db
$abs_top_srcdir/vswitchd/vswitch.ovsschema
../../tests/stp.at:474: ovsdb-server --detach --no-chdir --pidfile
--log-file --remote=punix:$OVS_RUNDIR/db.sock
stderr:
2017-03-20T21:06:42Z|00001|vlog|INFO|opened log file
/home/joe/git/openvswitch/_build-gcc/tests/testsuite.dir/2180/ovsdb-server.log
../../tests/stp.at:474: sed < stderr '
/vlog|INFO|opened log file/d
/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'
../../tests/stp.at:474: ovs-vsctl --no-wait init
../../tests/stp.at:474: ovs-vswitchd --enable-dummy --disable-system
--detach --no-chdir --pidfile --log-file -vvconn -vofproto_dpif
-vunixctl
stderr:
2017-03-20T21:06:42Z|00001|vlog|INFO|opened log file
/home/joe/git/openvswitch/_build-gcc/tests/testsuite.dir/2180/ovs-vswitchd.log
2017-03-20T21:06:42Z|00002|ovs_numa|INFO|Discovered 4 CPU cores on NUMA node 0
2017-03-20T21:06:42Z|00003|ovs_numa|INFO|Discovered 1 NUMA nodes and 4 CPU cores
2017-03-20T21:06:42Z|00004|reconnect|INFO|unix:/home/joe/git/openvswitch/_build-gcc/tests/testsuite.dir/2180/db.sock:
connecting...
2017-03-20T21:06:42Z|00005|reconnect|INFO|unix:/home/joe/git/openvswitch/_build-gcc/tests/testsuite.dir/2180/db.sock:
connected
../../tests/stp.at:474: sed < stderr '
/ovs_numa|INFO|Discovered /d
/vlog|INFO|opened log file/d
/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d
/reconnect|INFO|/d
/ofproto|INFO|using datapath ID/d
/netdev_linux|INFO|.*device has unknown hardware address family/d
/ofproto|INFO|datapath ID changed to fedcba9876543210/d
/dpdk|INFO|DPDK Disabled - Use other_config:dpdk-init to enable/d'
../../tests/stp.at:474: add_of_br 0
../../tests/stp.at:477:
ovs-vsctl -- \
set port br0 other_config:stp-enable=false -- \
set bridge br0 datapath-type=dummy -- \
set bridge br0 stp_enable=true mcast_snooping_enable=true \
other-config:hwaddr=aa:66:aa:66:00:00 -- \
add-br br1 -- \
set port br1 other_config:stp-enable=false -- \
set bridge br1 datapath-type=dummy -- \
set bridge br1 stp_enable=true mcast_snooping_enable=true \
other-config:hwaddr=aa:66:aa:66:00:01 -- \
add-br br2 -- \
set port br2 other_config:stp-enable=false -- \
set bridge br2 datapath-type=dummy -- \
set bridge br2 stp_enable=true mcast_snooping_enable=true \
other-config:hwaddr=aa:66:aa:66:00:02
../../tests/stp.at:495: ovs-appctl vlog/set ofproto_dpif:dbg
../../tests/stp.at:497: ovs-ofctl add-flow br0 action=normal
../../tests/stp.at:498: ovs-ofctl add-flow br1 action=normal
../../tests/stp.at:499: ovs-ofctl add-flow br2 action=normal
../../tests/stp.at:501:
ovs-vsctl add-port br0 p1 -- \
set interface p1 type=dummy
options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1
ovs-vsctl add-port br0 p2 -- \
set interface p2 type=dummy
options:stream=unix:$OVS_RUNDIR/p6.sock ofport_request=2
ovs-vsctl add-port br1 p3 -- \
set interface p3 type=dummy
options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3
ovs-vsctl add-port br1 p4 -- \
set interface p4 type=dummy
options:pstream=punix:$OVS_RUNDIR/p4.sock ofport_request=4
ovs-vsctl add-port br2 p5 -- \
set interface p5 type=dummy
options:stream=unix:$OVS_RUNDIR/p4.sock ofport_request=5
ovs-vsctl add-port br2 p6 -- \
set interface p6 type=dummy
options:pstream=punix:$OVS_RUNDIR/p6.sock ofport_request=6
warped
warped
../../tests/stp.at:523: cat ovs-vswitchd.log |
grep 'STP state change' | sed '
s/.*ofproto_dpif|.*|port .*:/port <>:/
'
warped
warped
warped
warped
warped
warped
warped
warped
warped
warped
../../tests/stp.at:545: cat ovs-vswitchd.log |
grep 'learning to forwarding' | sed '
s/.*ofproto_dpif|.*|port .*:/port <>:/
'
../../tests/stp.at:555: ovs-appctl netdev-dummy/receive br0 \
'01005E010101000C29A027D18100000108004500001C000100004002CBCBAC102201E00101011114EEEB00000000'
warped
../../tests/stp.at:559: ovs-appctl netdev-dummy/receive br0 \
'01005E010101000C29A027D18100000108004500001C000100004002CBCBAC102201E00101011114EEEB00000000'
LOCAL 1 00:0c:29:a0:27:d1 0
3 1 00:0c:29:a0:27:d1 0
6 1 00:0c:29:a0:27:d1 0
../../tests/stp.at:566: hard failure
2180. stp.at:473: 2180. STP - flush the fdb and mdb when topology
changed (stp.at:473): FAILED (stp.at:566)
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev