From patchwork Wed Sep 15 08:52:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1528250 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: 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=VGlgHDYR; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::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 ozlabs.org (Postfix) with ESMTPS id 4H8Ys03Nm2z9sRf for ; Wed, 15 Sep 2021 18:53:08 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 6D3B060B34; Wed, 15 Sep 2021 08:53:05 +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 F_itzrS3NB_W; Wed, 15 Sep 2021 08:53:04 +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 9AB5D60708; Wed, 15 Sep 2021 08:53:03 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6A551C0011; Wed, 15 Sep 2021 08:53:03 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id C5A7DC000D for ; Wed, 15 Sep 2021 08:53:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B3A9640499 for ; Wed, 15 Sep 2021 08:53:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com 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 DtMqr4OK94KM for ; Wed, 15 Sep 2021 08:53:01 +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 [170.10.133.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id C6BC740498 for ; Wed, 15 Sep 2021 08:53:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631695979; 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; bh=INA964EFZCcWnF4Ch+GGWgt+yX4OpDzmcD8uQqQ8oW0=; b=VGlgHDYRoCLxSw7PYr5tL0OwybBTkN3ds9uq9Gns3PZSTUje9iUG9BOETxpwHtCqF91tbB 6AjsLOPDxIthbYTCXgagFbozzEUe3dx9U66ERR1JMwHORLhOnGS+BBqCtqkHHABa1QrqUH PNwePwHleveWGbS9xIkhkluqKaQthW0= 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-222-pg7-yVH8Of-YJqi1O3jBvw-1; Wed, 15 Sep 2021 04:52:54 -0400 X-MC-Unique: pg7-yVH8Of-YJqi1O3jBvw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF8921B18BC2 for ; Wed, 15 Sep 2021 08:52:53 +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 69A3960C81; Wed, 15 Sep 2021 08:52:53 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Wed, 15 Sep 2021 04:52:51 -0400 Message-Id: <20210915085251.2609426-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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] 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, there is no guarantee that all flows are installed in OVS when port is up. Test was randomly failing as some flows were installed, but not all. To fix this, we wait until the last flow (with actions=output) is 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 30625ec37..18aeacd02 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -23448,6 +23448,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 "actions=output" -c) -eq 1 +]) + # 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" @@ -23462,6 +23468,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 "actions=output" -c) -eq 1 +]) + hv2_offlows=$(as hv2 ovs-ofctl dump-flows br-int | wc -l) echo "hv2 flows : $hv2_offlows" AT_CHECK([test $hv2_offlows -gt 0]) @@ -23500,9 +23512,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 "actions=output" -c) -eq 1 +]) + # 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 @@ -23514,8 +23532,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 "actions=output" -c) -eq 1 +]) + 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])