tests: Make ovsdb test more robust and faster.
[cascardo/ovs.git] / tests / ovsdb-server.at
index 2f2ef99..baf253a 100644 (file)
@@ -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`])