From patchwork Mon Nov 11 07:14:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1192808 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.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47BMZk51NGz9s4Y for ; Mon, 11 Nov 2019 18:14:53 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 38873B59; Mon, 11 Nov 2019 07:14:50 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id C2B7CB3E for ; Mon, 11 Nov 2019 07:14:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0DE998A7 for ; Mon, 11 Nov 2019 07:14:46 +0000 (UTC) X-Originating-IP: 27.7.151.76 Received: from nummac.local (unknown [27.7.151.76]) (Authenticated sender: numans@ovn.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 721A640006; Mon, 11 Nov 2019 07:14:44 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Mon, 11 Nov 2019 12:44:34 +0530 Message-Id: <20191111071434.1034644-1-numans@ovn.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH ovn] Fix testsuite 85 - "ensure one gw controller restart in HA doesn't bounce the master ok". X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Numan Siddique This testsuite is failing frequently in travis CI and locally when tests are run with "-j5". The test case deletes the chassis row for chassis 'gw2' and expects that this doesn't cause the chassisresident port on the master ('gw1') to not bounce as 'gw1' has higher priority than gw2. But since the ha chassis group has only 2 chassis, 'gw2' can claim the port momemtarily when 'gw2' chassis row is recreated back until BFD session with 'gw1' is not established. This patch changes the test assertion approach and makes sure that 'gw1' is the owner of the chassisresident port eventually. Signed-off-by: Numan Siddique Acked-by: Dumitru Ceara Tested-by: Lorenzo Bianconi --- tests/ovn.at | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index cb7903db8..35ffaf331 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -11033,12 +11033,26 @@ ovn-nbctl --wait=hv --timeout=3 sync # doesn't have the same effect because "name" is conserved, and the # Chassis entry is not replaced. -> gw1/ovn-controller.log - gw2_chassis=$(ovn-sbctl --bare --columns=_uuid find Chassis name=gw2) ovn-sbctl destroy Chassis $gw2_chassis -OVS_WAIT_UNTIL([test 0 = `grep -c "Releasing lport" gw1/ovn-controller.log`]) +# Wait for the gw2_chassis row is recreated. +OVS_WAIT_UNTIL([test 1 = `ovn-sbctl --bare --columns=_uuid find Chassis name=gw2 | wc -l`]) + +gw1_chassis=$(ovn-sbctl --bare --columns=_uuid find Chassis name=gw1) +gw2_chassis=$(ovn-sbctl --bare --columns=_uuid find Chassis name=gw2) + +# When gw2 chassis row is destroyed, it gets recreated. There +# is a small window in which gw2 may claim the cr-outside port if +# it has not established bfd tunnel with gw1. +# So make sure that, cr-outside is claimed by gw1 finally. +OVS_WAIT_WHILE( + [cr_outside_ch=`ovn-sbctl --bare --columns=chassis find Port_binding logical_port=cr-outside` + test $cr_outside_ch = $gw2_chassis]) + +OVS_WAIT_UNTIL( + [cr_outside_ch=`ovn-sbctl --bare --columns=chassis find Port_binding logical_port=cr-outside` + test $cr_outside_ch = $gw1_chassis]) OVN_CLEANUP([gw1],[gw2],[hv1])