summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarno Rajahalme <jarno@ovn.org>2016-07-21 06:22:18 -0700
committerBen Pfaff <blp@ovn.org>2016-07-22 13:13:43 -0700
commitf7525086194e05f88cc9d20fe941e22d2eb598bc (patch)
treef4e12e8b03346411f5d492c11cc5e9adc7803209
parentaced1c3a4b8f93a86b95eb9868cdc581a12d9be6 (diff)
downloadopenvswitch-f7525086194e05f88cc9d20fe941e22d2eb598bc.tar.gz
tests: Make ovsdb test more robust and faster.
Using sleep's is prone to runtime system dependent races, and indeed this test started consistently failing on my dev VM after an unrelated change to ovs-vswitchd. Get git of the sleeps and explicitly wait for the transaction on ovsdb1 to become visible on ovsdb2. Also fix the name of the test. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org> Tested-by: Joe Stringer <joe@ovn.org>
-rw-r--r--tests/ovsdb-server.at6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at
index 2f2ef99a4..baf253a68 100644
--- a/tests/ovsdb-server.at
+++ b/tests/ovsdb-server.at
@@ -1213,7 +1213,7 @@ OVSDB_SERVER_SHUTDOWN2
AT_CLEANUP
#ovsdb-server/disconnect-remote-server command
-AT_SETUP([ovsbd-server/disconnect-remote-server])
+AT_SETUP([ovsdb-server/disconnect-remote-server])
AT_KEYWORDS([ovsdb server replication disconnect-remote-server])
replication_schema > schema
AT_CHECK([ovsdb-tool create db1 schema], [0], [stdout], [ignore])
@@ -1231,7 +1231,8 @@ AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT1 \
"table": "a",
"row": {"number": 0, "name": "zero"}}]]'], [0], [stdout], [ignore],
[test ! -e pid || kill `cat pid`; test ! -e pid2 || kill `cat pid2`])
-sleep 2
+
+OVS_WAIT_UNTIL([ovsdb-client dump tcp:127.0.0.1:$TCP_PORT2 | grep zero])
AT_CHECK([ovs-appctl -t "`pwd`"/unixctl2 ovsdb-server/disconnect-remote-ovsdb-server], [0], [ignore], [ignore],
[test ! -e pid || kill `cat pid`; test ! -e pid2 || kill `cat pid2`])
@@ -1242,7 +1243,6 @@ AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT1 \
"table": "b",
"row": {"number": 1, "name": "one"}}]]'], [0], [stdout], [ignore],
[test ! -e pid || kill `cat pid`; test ! -e pid2 || kill `cat pid2`])
-sleep 2
AT_CHECK([ovsdb-client dump tcp:127.0.0.1:$TCP_PORT1], [0], [stdout], [ignore],
[test ! -e pid || kill `cat pid`; test ! -e pid2 || kill `cat pid2`])