From patchwork Thu Jul 11 16:00:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1130867 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) 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=fail (p=none dis=none) header.from=redhat.com 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 45l1Fb4qVwz9sNF for ; Fri, 12 Jul 2019 02:08:50 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id EA2B25355; Thu, 11 Jul 2019 16:08:47 +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 35E50531E for ; Thu, 11 Jul 2019 16:00:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 5A02988E for ; Thu, 11 Jul 2019 16:00:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D939A30C132B for ; Thu, 11 Jul 2019 16:00:38 +0000 (UTC) Received: from nusiddiq.mac (unknown [10.74.10.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5E4A60920 for ; Thu, 11 Jul 2019 16:00:37 +0000 (UTC) From: nusiddiq@redhat.com To: dev@openvswitch.org Date: Thu, 11 Jul 2019 21:30:33 +0530 Message-Id: <20190711160033.2604-1-nusiddiq@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 11 Jul 2019 16:00:38 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 the test failures in travis CI. 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 After the commit [1], below test cases are failing repeatedly in travis CI. 2663: ovn -- 4 HV, 1 LS, 1 LR, packet test with HA distributed router gateway port FAILED (ovn.at:8597) 2664: ovn -- 4 HV, 3 LS, 2 LR, packet test with HA distributed router gateway port FAILED (ovn.at:8844) 2667: ovn -- vlan traffic for external network with distributed router gateway port FAILED (ovn.at:9580) 2691: ovn -- router - check packet length - icmp defrag FAILED (ovn.at:13624) With the commit [1], ovn-controller sends GARPs for the IPs of the distributed router ports. The failing tests did not handle the situation if multiple GARPs are sent. The failures are mostly timing related. This patch fixes these issues. [1] - d65586b6fa97 ("ovn: Send GARP for router port IPs of a router port connected to bridged logical switch") Fixes: d65586b6fa97 ("ovn: Send GARP for router port IPs of a router port connected to bridged logical switch") CC: Ilya Maximets Signed-off-by: Numan Siddique Tested-by: Ilya Maximets --- tests/ovn.at | 53 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index 4da7059b3..95980f2f1 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -8593,7 +8593,9 @@ grep actions=mod_dl_dst:f0:00:00:01:02:04 | wc -l` -eq 1 OVN_CHECK_PACKETS([ext1/vif1-tx.pcap], [ext1-vif1.expected]) $PYTHON "$top_srcdir/utilities/ovs-pcap.in" $active_gw/br-phys_n1-tx.pcap > packets cat packets | grep $expected > exp - cat packets | grep $exp_gw_ip_garp >> exp + # Its possible that $active_gw/br-phys_n1-tx.pcap may have received multiple + # garp packets. So consider only the first packet. + cat packets | grep $exp_gw_ip_garp | head -1 >> exp AT_CHECK([cat exp], [0], [expout]) rm -f expout if test $backup_vswitchd_dead != 1; then @@ -8840,7 +8842,7 @@ grep actions=mod_dl_dst:f0:00:00:01:02:04 | wc -l` -eq 1 OVN_CHECK_PACKETS([ext1/vif1-tx.pcap], [ext1-vif1.expected]) $PYTHON "$top_srcdir/utilities/ovs-pcap.in" $active_gw/br-phys_n1-tx.pcap > packets cat packets | grep $expected > exp - cat packets | grep $exp_gw_ip_garp >> exp + cat packets | grep $exp_gw_ip_garp | head -1 >> exp AT_CHECK([cat exp], [0], [expout]) $PYTHON "$top_srcdir/utilities/ovs-pcap.in" $backup_gw/br-phys_n1-tx.pcap > packets @@ -9567,20 +9569,9 @@ options:rxq_pcap=${pcap_file}-rx.pcap as hv1 reset_pcap_file br-ex_n2 hv1/br-ex_n2 as hv3 reset_pcap_file hv3-vif1 hv3/vif1 -sleep 2 -# Take note of how many packets arrived on the VLAN switch before generating -# further traffic -n_packets=`as hv1 ovs-ofctl dump-flows br-int table=65 | grep "priority=100,reg15=0x1,metadata=0x2" | grep actions=clone | sed 's/.*n_packets=\([[0-9]]*\),.*/\1/'` as hv1 ovs-appctl netdev-dummy/receive hv1-vif1 $packet sleep 2 -# On hv1, the packet should not go from vlan switch pipleline to router -# pipeline -as hv1 ovs-ofctl dump-flows br-int -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=65 | grep "priority=100,reg15=0x1,metadata=0x2" \ -| grep actions=clone | grep -v n_packets=$n_packets | wc -l], [0], [[0 -]]) - # On hv1, table 32 check that no packet goes via the tunnel port AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=32 \ | grep "NXM_NX_TUN_ID" | grep -v n_packets=0 | wc -l], [0], [[0 @@ -9624,21 +9615,38 @@ echo $exp_garp_on_foo1 > foo1.expout # ovn-controller on hv2 should send garp with VLAN tag sent_garp="ffffffffffff0000010102038100000208060001080006040001000001010203c0a80101000000000000c0a80101" -echo $sent_garp > br-ex_n2.expout OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [foo1.expout]) -OVN_CHECK_PACKETS([hv2/br-ex_n2-tx.pcap], [br-ex_n2.expout]) +# Wait until we receive atleast 1 packet +OVS_WAIT_UNTIL([test 1=`$PYTHON "$top_srcdir/utilities/ovs-pcap.in" hv2/br-ex_n2-tx.pcap | wc -l`]) +$PYTHON "$top_srcdir/utilities/ovs-pcap.in" hv2/br-ex_n2-tx.pcap | head -1 > packets +echo $sent_garp > expout +AT_CHECK([cat packets], [0], [expout]) $PYTHON "$top_srcdir/utilities/ovs-pcap.in" hv4/br-ex_n2-tx.pcap > empty AT_CHECK([cat empty], [0], []) # Make hv4 master as hv1 reset_pcap_file hv1-vif1 hv1/vif1 -as hv2 reset_pcap_file br-ex_n2 hv2/br-ex_n2 as hv4 reset_pcap_file br-ex_n2 hv4/br-ex_n2 ovn-nbctl --wait=sb ha-chassis-group-add-chassis hagrp1 hv4 40 +# Wait till cr-alice is claimed by hv4 +hv4_chassis=$(ovn-sbctl --bare --columns=_uuid find Chassis name=hv4) +# check that the chassis redirect port has been claimed by the gw1 chassis +OVS_WAIT_UNTIL([ovn-sbctl --columns chassis --bare find Port_Binding \ +logical_port=cr-alice | grep $hv4_chassis | wc -l], [0],[[1 +]]) + +# Reset the pcap file for hv2/br-ex_n2. From now on ovn-controller in hv2 +# should not send GARPs for the router ports. +as hv2 reset_pcap_file br-ex_n2 hv2/br-ex_n2 + +echo $sent_garp > br-ex_n2.expout OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [foo1.expout]) OVN_CHECK_PACKETS([hv4/br-ex_n2-tx.pcap], [br-ex_n2.expout]) + +sleep 2 + $PYTHON "$top_srcdir/utilities/ovs-pcap.in" hv2/br-ex_n2-tx.pcap > empty AT_CHECK([cat empty], [0], []) @@ -13580,6 +13588,8 @@ test_ip_packet_larger() { orig_packet_l3=${orig_packet_l3}000000000000000000000000000000000000 packet=${packet}${orig_packet_l3} + gw_ip_garp=ffffffffffff00002020121308060001080006040001000020201213aca80064000000000000aca80064 + # If icmp_pmtu_reply_expected is 0, it means the packet is lesser than # the gateway mtu and should be delivered to the provider bridge via the # localnet port. @@ -13599,6 +13609,7 @@ test_ip_packet_larger() { expected=${expected}000000000000000000000000000000000000 expected=${expected}000000000000000000000000000000000000 echo $expected > br_phys_n1.expected + echo $gw_ip_garp >> br_phys_n1.expected else # MTU would be 100 - 18 = 82 (hex 0052) mtu=0052 @@ -13622,12 +13633,18 @@ test_ip_packet_larger() { if test $icmp_pmtu_reply_expected = 0; then OVN_CHECK_PACKETS([hv1/br-phys_n1-tx.pcap], [br_phys_n1.expected]) - $PYTHON "$top_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap > packets + $PYTHON "$top_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap > pkts + # hv1/vif1-tx.pcap can receive the GARP packet generated by ovn-controller + # for the gateway router port. So ignore this packet. + cat pkts | grep -v $gw_ip_garp > packets AT_CHECK([cat packets], [0], []) else OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [hv1-vif1.expected]) $PYTHON "$top_srcdir/utilities/ovs-pcap.in" hv1/br-phys_n1-tx.pcap > \ - packets + pkts + # hv1/br-phys_n1-tx.pcap can receive the GARP packet generated by ovn-controller + # for the gateway router port. So ignore this packet. + cat pkts | grep -v $gw_ip_garp > packets AT_CHECK([cat packets], [0], []) fi }