[ovs-dev] [PATCH] ovsdb-server tests: Fixed unit tests hang on Windows

Paul Boca pboca at cloudbasesolutions.com
Tue Jun 28 17:32:25 UTC 2016


If OVSDB_SERVER_SHUTDOWN2 is called after OVSDB_SERVER_SHUTDOWN
the second ovsdb-server hangs on Windows.
If the first ovsdb-server is terminated gracefully then the second one,
which replicates the database, will keep running even if 'exit' command is sent.

Use OVS_APP_EXIT_AND_WAIT_BY_TARGET in OVSDB_SERVER_SHUTDOWN2 instead of appctl.

Signed-off-by: Paul-Daniel Boca <pboca at cloudbasesolutions.com>
---
 tests/ovsdb-server.at | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at
index 299e537..2591736 100644
--- a/tests/ovsdb-server.at
+++ b/tests/ovsdb-server.at
@@ -4,9 +4,7 @@ m4_define([OVSDB_SERVER_SHUTDOWN],
   [OVS_APP_EXIT_AND_WAIT_BY_TARGET([`pwd`/unixctl], [`pwd`/pid])])
 
 m4_define([OVSDB_SERVER_SHUTDOWN2],
-  [cp pid2 savepid2
-   AT_CHECK([ovs-appctl -t "`pwd`"/unixctl2 -e exit], [0], [ignore], [ignore])
-   OVS_WAIT_WHILE([kill -0 `cat savepid2`], [kill `cat savepid2`])])
+  [OVS_APP_EXIT_AND_WAIT_BY_TARGET([`pwd`/unixctl2], [`pwd`/pid2])])
 
 # OVSDB_CHECK_EXECUTION(TITLE, SCHEMA, TRANSACTIONS, OUTPUT, [KEYWORDS])
 #
@@ -1018,8 +1016,8 @@ m4_define([OVSDB_CHECK_EXECUTION],
 
    AT_CHECK([diff dump1 dump2], [0], [], [ignore],
             [test ! -e pid || kill `cat pid`; test ! -e pid2 || kill `cat pid2`])
-   OVSDB_SERVER_SHUTDOWN
    OVSDB_SERVER_SHUTDOWN2
+   OVSDB_SERVER_SHUTDOWN
    AT_CLEANUP])
 
 EXECUTION_EXAMPLES
@@ -1074,8 +1072,8 @@ m4_define([OVSDB_CHECK_REPLICATION],
    AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [$4], [ignore],
             [test ! -e pid || kill `cat pid`; test ! -e pid2 || kill `cat pid2`])
 
-   OVSDB_SERVER_SHUTDOWN
    OVSDB_SERVER_SHUTDOWN2
+   OVSDB_SERVER_SHUTDOWN
    AT_CLEANUP])
 
 REPLICATION_EXAMPLES
-- 
2.7.2.windows.1



More information about the dev mailing list