From patchwork Mon Sep 27 11:16:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1533264 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=PlIv9lyO; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HJ0Sr393xz9tk7 for ; Mon, 27 Sep 2021 21:16:28 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id E1F3C607FA; Mon, 27 Sep 2021 11:16:25 +0000 (UTC) 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 kwpzQOjneD_d; Mon, 27 Sep 2021 11:16:25 +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 31721607F6; Mon, 27 Sep 2021 11:16:24 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 12095C0011; Mon, 27 Sep 2021 11:16:24 +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 24FEAC000D for ; Mon, 27 Sep 2021 11:16:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 03D0F607F6 for ; Mon, 27 Sep 2021 11:16:23 +0000 (UTC) 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 06v19rs260Mb for ; Mon, 27 Sep 2021 11:16:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 1B901607F5 for ; Mon, 27 Sep 2021 11:16:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632741381; 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=nioUNdoUpyLMVSjr+Mz+CIdGji22FSoCeDZsO/OA8LA=; b=PlIv9lyO3nOtpGu//VT4+wR3dKjYYhgfheXTBtNz4b7FGmaJy3J26vPaHb50cptOhgxCEu 4/bev2QDRcGCEqIwPKLxw3SDcv5S9sgsQJWCc4sVcdF5E6t4LXizlHsanEYiv5k2F6tnc8 p6mrlJ9b7mZEi1Lt7ssix8uUyNwnsNI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-201-2utpy4NoMHWYdTKIGvutpg-1; Mon, 27 Sep 2021 07:16:20 -0400 X-MC-Unique: 2utpy4NoMHWYdTKIGvutpg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2402984A5E1 for ; Mon, 27 Sep 2021 11:16: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 D60A66A904; Mon, 27 Sep 2021 11:16:18 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Mon, 27 Sep 2021 07:16:18 -0400 Message-Id: <20210927111618.761303-1-xsimonar@redhat.com> In-Reply-To: <20210915085251.2609426-1-xsimonar@redhat.com> References: <20210915085251.2609426-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=xsimonar@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn v2] ovn.at: Fix flaky test "controller I-P handling with monitoring disabled". 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" Test was waiting for port to be up in SBDB before checking number of flows in OVS. However, with conditional monitoring, there is no guarantee that all flows are installed in OVS when port is up. In addition, in both conditional monitoring and monitor-all cases, ARP reponder flows are installed when port is detected up. Hence, test was randomly failing as some flows were installed, but not all. To fix this, we wait until the ARP related flows are installed. Also fixed small typo in logging (for the same test). Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2004390 Fixes: f8a81693b0 ("ovn-controller: Fix the missing flows with monitor-all set to True") Signed-off-by: Xavier Simonart --- tests/ovn.at | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index 172b5c713..080991b89 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -23698,6 +23698,12 @@ ovs-vsctl -- add-port br-int hv1-vif1 -- \ wait_for_ports_up sw0-p1 +# Wait for last flow to be installed +OVS_WAIT_UNTIL([ + test $(as hv1 ovs-ofctl dump-flows br-int | \ + grep "arp_tpa=10.0.0.3,arp_op=1" -c) -eq 2 +]) + # Get the number of OF flows in hv1 and hv2 hv1_offlows=$(as hv1 ovs-ofctl dump-flows br-int | wc -l) echo "hv1 flows : $hv1_offlows" @@ -23712,6 +23718,12 @@ ovs-vsctl -- add-port br-int hv2-vif1 -- \ wait_for_ports_up sw0-p2 +# Wait for last flow to be installed +OVS_WAIT_UNTIL([ + test $(as hv2 ovs-ofctl dump-flows br-int | \ + grep "arp_tpa=10.0.0.4,arp_op=1" -c) -eq 2 +]) + hv2_offlows=$(as hv2 ovs-ofctl dump-flows br-int | wc -l) echo "hv2 flows : $hv2_offlows" AT_CHECK([test $hv2_offlows -gt 0]) @@ -23750,9 +23762,15 @@ ovs-vsctl -- add-port br-int hv1-vif1 -- \ wait_for_ports_up sw0-p1 +# Wait for last flow to be installed +OVS_WAIT_UNTIL([ + test $(as hv1 ovs-ofctl dump-flows br-int | \ + grep "arp_tpa=10.0.0.3,arp_op=1" -c) -eq 2 +]) + # Get the number of OF flows in hv1 and hv2 hv1_offlows_mon=$(as hv1 ovs-ofctl dump-flows br-int | wc -l) -echo "hv1 flows after monitor-all=true : $hv1_offlows" +echo "hv1 flows after monitor-all=true : $hv1_offlows_mon" AT_CHECK([test "$hv1_offlows" = "$hv1_offlows_mon"]) as hv2 @@ -23764,8 +23782,14 @@ ovs-vsctl -- add-port br-int hv2-vif1 -- \ wait_for_ports_up sw0-p2 +# Wait for last flow to be installed +OVS_WAIT_UNTIL([ + test $(as hv2 ovs-ofctl dump-flows br-int | \ + grep "arp_tpa=10.0.0.4,arp_op=1" -c) -eq 2 +]) + hv2_offlows_mon=$(as hv2 ovs-ofctl dump-flows br-int | wc -l) -echo "hv2 flows after monitor-all=true : $hv2_offlows" +echo "hv2 flows after monitor-all=true : $hv2_offlows_mon" AT_CHECK([test "$hv2_offlows" = "$hv2_offlows_mon"]) OVN_CLEANUP([hv1], [hv2])