From patchwork Fri Apr 17 14:57:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1272267 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.136; helo=silver.osuosl.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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 493fN508fRz9sR4 for ; Sat, 18 Apr 2020 00:57:56 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 384FD20410; Fri, 17 Apr 2020 14:57:54 +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 Ql72nlEN6U2g; Fri, 17 Apr 2020 14:57:53 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 28FE720198; Fri, 17 Apr 2020 14:57:53 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1AB8CC1AE8; Fri, 17 Apr 2020 14:57:53 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 17A02C0172 for ; Fri, 17 Apr 2020 14:57:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 026D185EAF for ; Fri, 17 Apr 2020 14:57:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QsGLozgfjbjF for ; Fri, 17 Apr 2020 14:57:51 +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 fraxinus.osuosl.org (Postfix) with ESMTPS id E5F1884B1F for ; Fri, 17 Apr 2020 14:57:50 +0000 (UTC) X-Originating-IP: 27.7.30.6 Received: from nummac.local (unknown [27.7.30.6]) (Authenticated sender: numans@ovn.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id B4C244000B; Fri, 17 Apr 2020 14:57:46 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Fri, 17 Apr 2020 20:27:37 +0530 Message-Id: <20200417145737.1769111-1-numans@ovn.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [ovs-dev] [PATCH ovn] tests: Fix occasional failures for test 85. 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" From: Numan Siddique The test case "85: ovn -- send gratuitous ARP for NAT rules on HA distributed router" fails occaionally. On faster systems, chances of failure are higher. This patch fixes this. Signed-off-by: Numan Siddique Tested-by: Flavio Fernandes > Tested-by: Flavio Fernandes --- tests/ovn.at | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index f83d3f536..040f7cff5 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -11035,6 +11035,12 @@ only_broadcast_from_lrp1() { garp="fffffffffffff0000000000108060001080006040001f00000000001c0a80064000000000000c0a80064" echo $garp > expout +OVS_WAIT_UNTIL( + [$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap > rcv_text + exp_rcvd=$(cat rcv_text | grep $garp | wc -l) + echo "expected received = $exp_rcvd" + test $exp_rcvd -ge 1]) + $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv1_snoop_tx echo "packets on hv1-snoopvif:" cat hv1_snoop_tx @@ -11063,12 +11069,17 @@ as hv1 reset_pcap_file snoopvif hv1/snoopvif as hv2 reset_pcap_file br-phys_n1 hv2/br-phys_n1 as hv3 reset_pcap_file br-phys_n1 hv3/br-phys_n1 -# Wait for packets to be received. -OVS_WAIT_UNTIL([test `wc -c < "hv1/snoopvif-tx.pcap"` -ge 100]) trim_zeros() { sed 's/\(00\)\{1,\}$//' } +# Wait for packets to be received. +OVS_WAIT_UNTIL( + [$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap > rcv_text + exp_rcvd=$(cat rcv_text | grep $garp | wc -l) + echo "expected received = $exp_rcvd" + test $exp_rcvd -ge 1]) + $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv1_snoopvif_tx AT_CHECK([sort hv1_snoopvif_tx], [0], [expout]) $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv3/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv3_br_phys_tx @@ -11114,6 +11125,12 @@ trim_zeros() { garp="fffffffffffff00000000001810007de08060001080006040001f00000000001c0a80064000000000000c0a80064" echo $garp > expout +OVS_WAIT_UNTIL( + [$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap > rcv_text + exp_rcvd=$(cat rcv_text | grep $garp | wc -l) + echo "expected received = $exp_rcvd" + test $exp_rcvd -ge 1]) + $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv1_snoopvif_tx AT_CHECK([sort hv1_snoopvif_tx], [0], [expout]) $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv3/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv3_br_phys_tx