rstp.at: Fix intermittent test failure.
authorAlex Wang <alexw@nicira.com>
Thu, 25 Sep 2014 23:51:01 +0000 (23:51 +0000)
committerAlex Wang <alexw@nicira.com>
Thu, 25 Sep 2014 20:32:31 +0000 (13:32 -0700)
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@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
tests/rstp.at

index 3f56931..5caa84f 100644 (file)
@@ -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