[ovs-dev] [PATCH] rstp.at: Fix intermittent test failure.

Alex Wang alexw at nicira.com
Thu Sep 25 15:51:01 UTC 2014


Sub-test "RSTP - dummy interface" checks the ovs-vswitchd.log
output immediately after command execution.  The check may
fail if the write of new log is delayed by the IO thread.

This commit fixes the above issue by waiting for the
ovs-vswitchd.log output.

Signed-off-by: Alex Wang <alexw at nicira.com>
---
 tests/rstp.at |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/rstp.at b/tests/rstp.at
index 3f56931..5caa84f 100644
--- a/tests/rstp.at
+++ b/tests/rstp.at
@@ -213,6 +213,7 @@ AT_CHECK([ovs-ofctl add-flow br1 "in_port=2 icmp actions=8"])
 
 AT_CHECK([ovs-vsctl set port p2 other_config:rstp-enable=true])
 
+OVS_WAIT_UNTIL([test `cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY | wc -l` -ge 2])
 AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY], [0], [dnl
 port p1: RSTP state changed from Disabled to Discarding
 port p2: RSTP state changed from Disabled to Discarding
@@ -232,6 +233,7 @@ AT_CHECK([ovs-appctl netdev-dummy/set-admin-state p2 up], [], [dnl
 OK
 ])
 
+OVS_WAIT_UNTIL([test `cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY | wc -l` -ge 4])
 AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY], [0], [dnl
 port p1: RSTP state changed from Disabled to Discarding
 port p2: RSTP state changed from Disabled to Discarding
-- 
1.7.9.5




More information about the dev mailing list