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>
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
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