From patchwork Mon Feb 12 17:55:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1897898 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=Rvne6ucU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TYXF20w0bz23yB for ; Tue, 13 Feb 2024 04:55:49 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id DA82781CDC; Mon, 12 Feb 2024 17:55:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iH_1hXj4Vphq; Mon, 12 Feb 2024 17:55:46 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 78C8181C44 Authentication-Results: smtp1.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=Rvne6ucU Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 78C8181C44; Mon, 12 Feb 2024 17:55:46 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 33732C0DD0; Mon, 12 Feb 2024 17:55:46 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2A51BC0DCF for ; Mon, 12 Feb 2024 17:55:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1A42D81C44 for ; Mon, 12 Feb 2024 17:55:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7HOx1-rmihPF for ; Mon, 12 Feb 2024 17:55:43 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=xsimonar@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 2DF0581C38 Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 2DF0581C38 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 2DF0581C38 for ; Mon, 12 Feb 2024 17:55:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707760542; 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=O8kdtDDuGBf60z2KwdPnIOWC08Uoo1vwWQ/sWkoEcwI=; b=Rvne6ucUysNZC9fTHwzn51gv2AUs7CDagnRAJobKJLNhHbJMbDjpYlg+1uNRaYRJBxfeed DkUBATbpxoVqpQrQKNcWspARiamKNEvvPx4i0QIbp2MhBzQHaaOd6nFjBIQXj7X3eeLgK/ mB1Mp/NS9uOnduYskl2h9dL648XkWFE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-88-q_ZDMGazNFakhReIgG-iYA-1; Mon, 12 Feb 2024 12:55:40 -0500 X-MC-Unique: q_ZDMGazNFakhReIgG-iYA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 73298811E79 for ; Mon, 12 Feb 2024 17:55:40 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.193.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03891AD6D; Mon, 12 Feb 2024 17:55:39 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Mon, 12 Feb 2024 18:55:30 +0100 Message-ID: <20240212175537.1356073-4-xsimonar@redhat.com> In-Reply-To: <20240212175537.1356073-1-xsimonar@redhat.com> References: <20240212175537.1356073-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 03/10] tests: Fix flaky "options:requested-chassis ...". 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" The test was failing due to the following race condition. By using ofport-request, there is the risk that the ofport is initially not assigned the expected value, and hence that the ofport changes. This happens for instance if the geneve interface gets the ofport expected for the vif. In that case, both the geneve and the vif see their ofports changing. An ofport change for the geneve interface is not I+P handled. If this change is handled within the same loop as the iface-id setting for the vif, then a runtime data recompute happened for the vif, and the expected log was not produced. Signed-off-by: Xavier Simonart --- tests/ovn.at | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index 291c6bca5..6ed764ace 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -16246,15 +16246,13 @@ sim_add hv1 as hv1 ovs-vsctl add-br br-phys ovn_attach n1 br-phys 192.168.0.11 -ovs-vsctl -- add-port br-int hv1-vif0 -- \ -set Interface hv1-vif0 ofport-request=1 +ovs-vsctl -- add-port br-int hv1-vif0 sim_add hv2 as hv2 ovs-vsctl add-br br-phys ovn_attach n1 br-phys 192.168.0.12 -ovs-vsctl -- add-port br-int hv2-vif0 -- \ -set Interface hv2-vif0 ofport-request=1 +ovs-vsctl -- add-port br-int hv2-vif0 # Allow only chassis hv1 to bind logical port lsp0. ovn-nbctl lsp-set-options lsp0 requested-chassis=hv1 @@ -16262,6 +16260,16 @@ ovn-nbctl lsp-set-options lsp0 requested-chassis=hv1 # Allow some time for ovn-northd and ovn-controller to catch up. check ovn-nbctl --wait=hv sync +OVS_WAIT_UNTIL([ + hv1_ofport=$(as hv1 ovs-vsctl --bare --columns ofport find Interface name=hv1-vif0) + test 1 -le $hv1_ofport +]) + +OVS_WAIT_UNTIL([ + hv2_ofport=$(as hv2 ovs-vsctl --bare --columns ofport find Interface name=hv2-vif0) + test 1 -le $hv2_ofport +]) + # Retrieve hv1 and hv2 chassis UUIDs from southbound database wait_row_count Chassis 1 name=hv1 wait_row_count Chassis 1 name=hv2 @@ -16277,7 +16285,7 @@ OVS_WAIT_UNTIL([test 1 = $(grep -c "Not claiming lport lsp0" hv2/ovn-controller. wait_row_count Port_Binding 1 logical_port=lsp0 'chassis=[[]]' # (2) Chassis hv2 should not add flows in OFTABLE_PHY_TO_LOG and OFTABLE_LOG_TO_PHY tables. -AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=OFTABLE_PHY_TO_LOG | grep in_port=1], [1], []) +AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=OFTABLE_PHY_TO_LOG | grep in_port=$hv2_ofport], [1], []) AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=OFTABLE_LOG_TO_PHY | grep output], [1], []) # (3) Chassis hv1 should bind lsp0 when physical to logical mapping exists on hv1. @@ -16290,8 +16298,8 @@ wait_column "$hv1_uuid" Port_Binding chassis logical_port=lsp0 # (4) Chassis hv1 should add flows in OFTABLE_PHY_TO_LOG and OFTABLE_LOG_TO_PHY tables. as hv1 ovs-ofctl dump-flows br-int -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=OFTABLE_PHY_TO_LOG | grep in_port=1], [0], [ignore]) -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=OFTABLE_LOG_TO_PHY | grep actions=output:1], [0], [ignore]) +AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=OFTABLE_PHY_TO_LOG | grep in_port=$hv1_ofport], [0], [ignore]) +AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=OFTABLE_LOG_TO_PHY | grep actions=output:$hv1_ofport], [0], [ignore]) # (5) Chassis hv1 should release lsp0 binding and chassis hv2 should bind lsp0 when # the requested chassis for lsp0 is changed from hv1 to hv2. @@ -16304,10 +16312,10 @@ OVS_WAIT_UNTIL([test 1 -le $(grep -c "Releasing lport lsp0" hv1/ovn-controller.l wait_column "$hv2_uuid" Port_Binding chassis logical_port=lsp0 # (6) Chassis hv2 should add flows and hv1 should not. -AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=OFTABLE_PHY_TO_LOG | grep in_port=1], [0], [ignore]) -AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=OFTABLE_LOG_TO_PHY | grep actions=output:1], [0], [ignore]) +AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=OFTABLE_PHY_TO_LOG | grep in_port=$hv2_ofport], [0], [ignore]) +AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=OFTABLE_LOG_TO_PHY | grep actions=output:$hv2_ofport], [0], [ignore]) -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=OFTABLE_PHY_TO_LOG | grep in_port=1], [1], []) +AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=OFTABLE_PHY_TO_LOG | grep in_port=$hv1_ofport], [1], []) AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=OFTABLE_LOG_TO_PHY | grep output], [1], []) OVN_CLEANUP([hv1],[hv2])