From patchwork Fri Dec 2 13:51:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1711414 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=eaa5OshR; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NNvWF4gqjz23mf for ; Sat, 3 Dec 2022 00:51:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1964861160; Fri, 2 Dec 2022 13:51:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 1964861160 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=eaa5OshR X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eUmv6EsM5LZu; Fri, 2 Dec 2022 13:51:50 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id E717061149; Fri, 2 Dec 2022 13:51:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E717061149 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id BE7D0C008B; Fri, 2 Dec 2022 13:51:44 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id BF0E5C0078 for ; Fri, 2 Dec 2022 13:51:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9768460F20 for ; Fri, 2 Dec 2022 13:51:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 9768460F20 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aCLaqt-_gRMY for ; Fri, 2 Dec 2022 13:51:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org AA66060B8C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id AA66060B8C for ; Fri, 2 Dec 2022 13:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669989099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=az7lX8sxcAn0I/jvO0xEZyYIiEM2whINwndFDlQU1MU=; b=eaa5OshRdSI5sUUYcSTMDuQ2DFpCQ0p8xi5IAZH+U3MpkVL96rqeIFGzlUlzZhcVzVHO14 q8Gf+NZSzBXO+YSBJQ/YeDlQqhvs8Z5FnomKCttLH2rQMxz/y36Q0UhCg5nkAq6UtmDv0f wj943LvI5dhn/OAjOqpprSzoSL9x/Tk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-315-XQ7mpsafNy2BDmlu9oFj9A-1; Fri, 02 Dec 2022 08:51:38 -0500 X-MC-Unique: XQ7mpsafNy2BDmlu9oFj9A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6919C101A528 for ; Fri, 2 Dec 2022 13:51:38 +0000 (UTC) Received: from wsfd-netdev90.ntdv.lab.eng.bos.redhat.com (wsfd-netdev90.ntdv.lab.eng.bos.redhat.com [10.19.188.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52A1A111E3FA; Fri, 2 Dec 2022 13:51:38 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Fri, 2 Dec 2022 08:51:34 -0500 Message-Id: <20221202135137.1728564-10-xsimonar@redhat.com> In-Reply-To: <20221202135137.1728564-1-xsimonar@redhat.com> References: <20221202135137.1728564-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 09/12] tests: Removed macro reset_iface_pcap_file 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" reset_iface_pcap_file and reset_pcap_file do almost exactly the same thing. reset_iface_pcap_file adds "wait while the pcap file has the size of the PCAP header". This adds some quite long delay to the test (the time to receive garp). While replacing reset_iface_pcap_file by reset_pcap_file, some tests fail as they are now much faster, and dummy packets might be generated before all flows are installed. Those tests are fixed by waiting bfd to be up (causing the last flows to be installed). Signed-off-by: Xavier Simonart --- tests/ovn-macros.at | 21 --------------------- tests/ovn.at | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at index ee6e09d39..03c5bd3da 100644 --- a/tests/ovn-macros.at +++ b/tests/ovn-macros.at @@ -516,27 +516,6 @@ wait_for_ports_up() { fi } -# reset_iface_pcap_file iface pcap_file -# Resets the pcap file associates with OVS interface. should be used -# with dummy datapath. -# -# XXX: This should actually replace reset_pcap_file() as they do almost -# exactly the same thing but the "wait while the pcap file has the size -# of the PCAP header" check causes tests to fail. -reset_iface_pcap_file() { - local iface=$1 - local pcap_file=$2 - check rm -f dummy-*.pcap - check ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \ -options:rxq_pcap=dummy-rx.pcap - OVS_WAIT_WHILE([test 24 = $(wc -c dummy-tx.pcap | cut -d " " -f1)]) - check rm -f ${pcap_file}*.pcap - check ovs-vsctl -- set Interface $iface options:tx_pcap=${pcap_file}-tx.pcap \ -options:rxq_pcap=${pcap_file}-rx.pcap - - OVS_WAIT_WHILE([test 24 = $(wc -c ${pcap_file}-tx.pcap | cut -d " " -f1)]) -} - # reset_pcap_file iface pcap_file # Resets the pcap file associates with OVS interface. should be used # with dummy datapath. diff --git a/tests/ovn.at b/tests/ovn.at index b540920b4..dcc74649e 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -11206,13 +11206,13 @@ test_ip_packet() echo $expected > ext1-vif1.expected exp_gw_ip_garp=ffffffffffff00000201020308060001080006040001000002010203ac100101000000000000ac100101 echo $exp_gw_ip_garp >> ext1-vif1.expected - as $active_gw reset_iface_pcap_file br-phys_n1 $active_gw/br-phys_n1 + as $active_gw reset_pcap_file br-phys_n1 $active_gw/br-phys_n1 if test $backup_vswitchd_dead != 1; then # Reset the file only if vswitchd in backup gw is alive - as $backup_gw reset_iface_pcap_file br-phys_n1 $backup_gw/br-phys_n1 + as $backup_gw reset_pcap_file br-phys_n1 $backup_gw/br-phys_n1 fi - as ext1 reset_iface_pcap_file ext1-vif1 ext1/vif1 + as ext1 reset_pcap_file ext1-vif1 ext1/vif1 # Resend packet from foo1 to outside1 check as hv1 ovs-appctl netdev-dummy/receive hv1-vif1 $packet @@ -11249,6 +11249,10 @@ test_ip_packet() fi } +# Wait for BFD to be up, then for ovn-controller to handle that change +ovn_wait_for_bfd_up hv1 gw1 gw2 +check ovn-nbctl --wait=hv sync + test_ip_packet gw1 gw2 0 AT_CHECK( @@ -11489,9 +11493,9 @@ grep actions=mod_dl_dst:f0:00:00:01:02:04 | wc -l` -eq 1 exp_gw_ip_garp=ffffffffffff00000201020308060001080006040001000002010203ac100101000000000000ac100101 echo $exp_gw_ip_garp >> ext1-vif1.expected - as $active_gw reset_iface_pcap_file br-phys_n1 $active_gw/br-phys_n1 - as $backup_gw reset_iface_pcap_file br-phys_n1 $backup_gw/br-phys_n1 - as ext1 reset_iface_pcap_file ext1-vif1 ext1/vif1 + as $active_gw reset_pcap_file br-phys_n1 $active_gw/br-phys_n1 + as $backup_gw reset_pcap_file br-phys_n1 $backup_gw/br-phys_n1 + as ext1 reset_pcap_file ext1-vif1 ext1/vif1 # Resend packet from foo1 to outside1 check as hv1 ovs-appctl netdev-dummy/receive hv1-vif1 $packet @@ -11506,6 +11510,9 @@ grep actions=mod_dl_dst:f0:00:00:01:02:04 | wc -l` -eq 1 AT_CHECK([grep $expected packets | sort], [0], []) } +# Wait for BFD to be up, then for ovn-controller to handle that change +ovn_wait_for_bfd_up hv1 gw1 gw2 +check ovn-nbctl --wait=hv sync test_ip_packet gw1 gw2 AT_CHECK([ovn-nbctl --wait=hv \