From patchwork Wed Jun 10 23:45:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Leitner X-Patchwork-Id: 1307271 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=sysclose.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sysclose.org header.i=@sysclose.org header.a=rsa-sha256 header.s=201903 header.b=tHzDp4nR; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49j3XM5SK0z9sR4 for ; Thu, 11 Jun 2020 09:45:55 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 28D4788557; Wed, 10 Jun 2020 23:45:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dfSshwEgfW1D; Wed, 10 Jun 2020 23:45:51 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id B3D96883E1; Wed, 10 Jun 2020 23:45:51 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A121EC088C; Wed, 10 Jun 2020 23:45:51 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 949DBC016F for ; Wed, 10 Jun 2020 23:45:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2206423DB4 for ; Wed, 10 Jun 2020 23:45:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YFsqLiffSgqo for ; Wed, 10 Jun 2020 23:45:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sysclose.org (smtp.sysclose.org [69.164.214.230]) by silver.osuosl.org (Postfix) with ESMTPS id 423EA203DA for ; Wed, 10 Jun 2020 23:45:48 +0000 (UTC) Received: from localhost (unknown [191.7.188.130]) by sysclose.org (Postfix) with ESMTPSA id DD73317A; Wed, 10 Jun 2020 23:46:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 sysclose.org DD73317A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sysclose.org; s=201903; t=1591832794; bh=dqM3SJZ0JXFJ+gr/SO0Z0XIifx2f6ObmVtp6GmHD7Xs=; h=From:To:Cc:Subject:Date:From; b=tHzDp4nRB/qJtRFKyWXxCeha6sOOoUyZc4Mdizvud6kJU8L16wAzSRS2vLdU0kW4x mR9b3nRekIFIx8VvBTM7JCmwckOU6C7uISr00iBjVVXdBohCbwC+nNIUNnvgm+kS5K 9/xd6o2iaGJhP3WJeDqmy/mB57/g7aNaAHN5YtaksQ578+zX7mofiMw+Ep1vuE4gRK Hzdp6zBtP9MMJZcQb4g53hz4TDQd5VKJ90cl8WYMlzsF7/WD0ohEEPWMkmye3gesS4 t0FrceJjNT0kciFMpJcnqQtAREtW0TNezemuGF08tCTBPMIvXjFA6Buk39XOPF5Xxy 2wFWhZS2zSbnw== From: Flavio Leitner To: dev@openvswitch.org Date: Wed, 10 Jun 2020 20:45:38 -0300 Message-Id: <20200610234538.962020-1-fbl@sysclose.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Cc: Flavio Leitner , Ilya Maximets Subject: [ovs-dev] [PATCH] ovsdb-idl.at: Wait all servers to join the cluster. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 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 Signed-off-by: Flavio Leitner Acked-by: Dumitru Ceara --- 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]