tests: Fix race in async config test.
authorJoe Stringer <joestringer@nicira.com>
Wed, 3 Dec 2014 18:57:37 +0000 (10:57 -0800)
committerJoe Stringer <joestringer@nicira.com>
Thu, 4 Dec 2014 21:58:48 +0000 (13:58 -0800)
Occasionally, the testsuite would send the OFPT_SET_ASYNC before
ovs-vswitchd got a chance to send its OFPT_ROLE_REPLY message, causing a
reordering of the testsuite output and a false positive. Give the test
script something extra to do so this is less likely to happen.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
tests/ofproto-dpif.at

index 9d3da4a..fd3f00a 100644 (file)
@@ -2642,6 +2642,8 @@ OVS_VSWITCHD_START([dnl
 ])
 ON_EXIT([kill `cat ovs-ofctl.pid`])
 
+ovs-appctl time/stop
+
 AT_CAPTURE_FILE([ofctl_monitor.log])
 # A table-miss flow has priority 0 and no match
 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
@@ -2652,9 +2654,13 @@ AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --det
 # Become slave (OF 1.3), which should disable everything except port status.
 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
 
+# Ensure that ovs-vswitchd gets a chance to reply before sending another command.
+ovs-appctl time/warp 500 100
+
 # Use OF 1.3 OFPT_SET_ASYNC to enable OFPR_NO_MATCH for slave only.
 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000000000000100000000000000000000000000000000
 
+ovs-appctl time/warp 500 100
 for i in 1 2 3 ; do
     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
 done