[ovs-dev] [PATCH] ovsdb-idl.at: Wait all servers to join the cluster.

Flavio Leitner fbl at sysclose.org
Wed Jun 10 23:49:50 UTC 2020


Hi,

It would be nice to have this applied to branch-2.13 as well.
fbl

On Wed, Jun 10, 2020 at 08:45:38PM -0300, Flavio Leitner wrote:
> The test 'Check Python IDL reconnects to leader - Python3
> (leader only)' fails sometimes when the first ovsdb-server
> gets killed before the others had joined the cluster.
> 
> Fix the function ovsdb_cluster_start_idltest to wait them
> to join the cluster.
> 
> Suggested-by: Ilya Maximets <i.maximets at ovn.org>
> Signed-off-by: Flavio Leitner <fbl at sysclose.org>
> ---
>  tests/ovsdb-idl.at | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at
> index b5cbee7d9..c045e9264 100644
> --- a/tests/ovsdb-idl.at
> +++ b/tests/ovsdb-idl.at
> @@ -29,6 +29,17 @@ ovsdb_cluster_start_idltest () {
>       ovsdb-server -vraft -vconsole:warn --detach --no-chdir --log-file=s$i.log --pidfile=s$i.pid --unixctl=s$i --remote=punix:s$i.ovsdb ${2:+--remote=$2} s$i.db || return $?
>     done
>     on_exit 'kill `cat s*.pid`'
> +   for i in `seq $n`; do
> +     for d in `seq 1 "$OVS_CTL_TIMEOUT"`; do
> +       if ovs-appctl -t $(pwd)/s$i cluster/status ${schema_name} | grep -q 'Status: cluster member'; then
> +         break
> +       fi
> +       sleep 1
> +     done
> +     if ! ovs-appctl -t $(pwd)/s$i cluster/status ${schema_name} | grep -q 'Status: cluster member'; then
> +       return 1
> +     fi
> +   done
>  }
>  
>  # ovsdb_cluster_leader [REMOTES] [DATABASE]
> -- 
> 2.26.2
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

-- 
fbl


More information about the dev mailing list