From patchwork Thu Jul 13 11:08:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1807250 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=2605:bc80:3010::133; helo=smtp2.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=JLkAL6Sd; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (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 4R1sKx4NH2z20Ph for ; Thu, 13 Jul 2023 21:08:37 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id A791041742; Thu, 13 Jul 2023 11:08:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org A791041742 Authentication-Results: smtp2.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=JLkAL6Sd X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZQyk0q8l52NR; Thu, 13 Jul 2023 11:08:32 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id E360541733; Thu, 13 Jul 2023 11:08:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E360541733 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 450F0C0DE3; Thu, 13 Jul 2023 11:08:28 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2C0E9C0DDB for ; Thu, 13 Jul 2023 11:08:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A97F84183B for ; Thu, 13 Jul 2023 11:08:23 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A97F84183B Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JLkAL6Sd X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0TuTWyZXxkvJ for ; Thu, 13 Jul 2023 11:08:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9D65141854 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 9D65141854 for ; Thu, 13 Jul 2023 11:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689246501; 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=HuSkQFa606ePF6KlpFl38ulGPoBJHgsYzApZGDdNuEo=; b=JLkAL6SdXRIlKmzsktZ5DJwI7DhhFVvHcfDQzW5L14t747z4baLsXu4T5O3d07p6uAgD9t 2S1R/Z1zQrJfSVADp06tODCiFIDRTeKmpF67Ufrs0BwftYl59Heka+4dkckUdQVMU2XKeW uTmeXsUaQRiAEUXMFBDwmqbG0HZ/uSQ= 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-621-xZ5vTqO9M0esrDxumUaP1A-1; Thu, 13 Jul 2023 07:08:19 -0400 X-MC-Unique: xZ5vTqO9M0esrDxumUaP1A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D72B86F122 for ; Thu, 13 Jul 2023 11:08:19 +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 75B871454142; Thu, 13 Jul 2023 11:08:19 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Thu, 13 Jul 2023 13:08:16 +0200 Message-Id: <20230713110819.2408240-2-xsimonar@redhat.com> In-Reply-To: <20230713110819.2408240-1-xsimonar@redhat.com> References: <20230713110819.2408240-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 1/4] tests: fixed "Mirror - remote" and "Mirror - local" 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" Signed-off-by: Xavier Simonart --- tests/ovn.at | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index cd6d4b9ff..4ae33567f 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -17058,7 +17058,7 @@ rtr_l2_ip=$(ip_to_hex 172 16 1 1) l1_ip=$(ip_to_hex 192 168 1 2) check ovn-nbctl mirror-add mirror0 gre 0 to-lport 192.168.1.12 -check ovn-nbctl lsp-attach-mirror ls1-lp1 mirror0 +check ovn-nbctl --wait=hv lsp-attach-mirror ls1-lp1 mirror0 # Send ping packet and check for mirrored packet of the reply test_ipv4_icmp_request 1 000000010203 0000000102f1 $l1_ip $rtr_l2_ip 0000 8510 03ff 8d10 "gre" "to-lport" @@ -17071,7 +17071,9 @@ as hv1 reset_pcap_file br-phys_n1 hv1/br-phys_n1 rm -f br-phys_n1.expected rm -f vif1.expected -check ovn-nbctl set mirror . type=erspan +check ovn-nbctl --wait=hv set mirror . type=erspan +# Wait for port to get updated +OVS_WAIT_UNTIL([test 1 = `ovs-appctl dpif/show | grep ovn-mirror | grep -c erspan`]) # Send ping packet and check for mirrored packet of the reply test_ipv4_icmp_request 1 000000010203 0000000102f1 $l1_ip $rtr_l2_ip 0000 8510 03ff 8d10 "erspan" "to-lport" @@ -17084,7 +17086,15 @@ as hv1 reset_pcap_file br-phys_n1 hv1/br-phys_n1 rm -f br-phys_n1.expected rm -f vif1.expected -check ovn-nbctl set mirror . filter=from-lport +check ovn-nbctl --wait=hv set mirror . filter=from-lport + +# First make sure conf.db got updated +vif1=$(ovs-vsctl get Port vif1 _uuid) +OVS_WAIT_UNTIL([test `ovs-vsctl get mirror mirror0 select_src_port | tr -d "[[]]"` = $vif1]) +# Then make sure ovs-vswitchd got opportunity to run : run some random ovs-apctl command twice, so +# mirror_run could run +ovs-appctl dpif/show +ovs-appctl dpif/show # Send ping packet and check for mirrored packet of the request test_ipv4_icmp_request 1 000000010203 0000000102f1 $l1_ip $rtr_l2_ip 0000 8510 03ff 8d10 "erspan" "from-lport" @@ -17097,7 +17107,9 @@ as hv1 reset_pcap_file br-phys_n1 hv1/br-phys_n1 rm -f br-phys_n1.expected rm -f vif1.expected -check ovn-nbctl set mirror . type=gre +check ovn-nbctl --wait=hv set mirror . type=gre +# Wait for port to get updated +OVS_WAIT_UNTIL([test 1 = `ovs-appctl dpif/show | grep ovn-mirror | grep -c gre`]) # Send ping packet and check for mirrored packet of the request test_ipv4_icmp_request 1 000000010203 0000000102f1 $l1_ip $rtr_l2_ip 0000 8510 03ff 8d10 "gre" "from-lport" @@ -17243,7 +17255,7 @@ AT_CHECK([cat mirror1.packets | sort], [0], [expout]) AT_CHECK([cat mirror2.packets | sort], [0], [expout]) port_src_old=$(ovs-vsctl get mirror mirror-from-lp1 select_src_port) -check ovn-nbctl set mirror $uuid1 filter=both +check ovn-nbctl --wait=hv set mirror $uuid1 filter=both port_src_new=$(ovs-vsctl get mirror mirror-from-lp1 select_src_port) port_dst_new=$(ovs-vsctl get mirror mirror-from-lp1 select_dst_port) AT_CHECK([test $port_src_old = $port_src_new], [0], [])