[ovs-dev] [PATCH] ovsdb-server tests: Fixed unit tests hang on Windows
Paul Boca
pboca at cloudbasesolutions.com
Tue Jun 28 18:29:39 UTC 2016
This patch only avoids the unit test hang on replication tests.
The problem is that 'ovs-appctl exit' waits forever a reply from the replicator ovsdb-server,
and the replicator ovsdb-server just loops trying to get a message from the first
ovsdb-server which is closed at that time.
This might be a bug in the db replication code and this patch only avoids it.
Thanks,
Paul
> -----Original Message-----
> From: dev [mailto:dev-bounces at openvswitch.org] On Behalf Of Paul Boca
> Sent: Tuesday, June 28, 2016 8:32 PM
> To: dev at openvswitch.org
> Subject: [ovs-dev] [PATCH] ovsdb-server tests: Fixed unit tests hang on
> Windows
>
> 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
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list