From patchwork Thu Aug 8 13:03:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1970555 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=V3hp8A/m; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4WfnKV3Wwzz1ydk for ; Thu, 8 Aug 2024 23:03:26 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D22C7409F2; Thu, 8 Aug 2024 13:03:24 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id frAnvOdKyoQB; Thu, 8 Aug 2024 13:03:23 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 53B4A4099B Authentication-Results: smtp4.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=V3hp8A/m Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 53B4A4099B; Thu, 8 Aug 2024 13:03:23 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1F653C002B; Thu, 8 Aug 2024 13:03:23 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 276C7C002A for ; Thu, 8 Aug 2024 13:03:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 16E7A81D24 for ; Thu, 8 Aug 2024 13:03:22 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id nASN7I1tiQ6P for ; Thu, 8 Aug 2024 13:03:21 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=amusil@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 3254181CDC 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 3254181CDC Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=V3hp8A/m 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 3254181CDC for ; Thu, 8 Aug 2024 13:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723122199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=84DamjV6lGqwRxIDBNCjK/PDz1eYDqXCA1TxMnXYl8E=; b=V3hp8A/mPGfbOnj6yjONf69In++/MkcnwxnJ740xk9n0KAuYRIwyrfbFgHf6I28fwI6fO+ +Bv+CqWMQ9+ST1CH/qrKNBxO2K5cthCjiQ9ANjrlNzMX5y+U//HvzAESeib5H0Ooh/hkIn D+cgVE905wBrrIOYH09q1otXxXRu/dU= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-640-BGvsRlU4P8m0kLop4B797g-1; Thu, 08 Aug 2024 09:03:17 -0400 X-MC-Unique: BGvsRlU4P8m0kLop4B797g-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9A72A1944B2F for ; Thu, 8 Aug 2024 13:03:16 +0000 (UTC) Received: from amusil.redhat.com (unknown [10.45.224.89]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6FC8F1955F38; Thu, 8 Aug 2024 13:03:14 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Thu, 8 Aug 2024 15:03:12 +0200 Message-ID: <20240808130312.1666065-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn v2] test: Fix flaky I-P test. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dceara@redhat.com Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The test was checking if there was any recompute after all operations. This proven to be flaky because there might have been "random" recompute happening in the middle due to the following events: 1) SB becomes read only 2) non_vif_data handler for OVS_interface fails 3) Recompute of non_vif_data is not allowed because SB is read only 4) non_vif_data is marked as cancelled 5) Next engine run will do force recompute of all nodes To prevent that check specifically for the handler that is supposed to gracefully handle the interface changes. Fixes: 603f38da062b ("controller: Remove OvS iface type check in I-P processing.") Signed-off-by: Ales Musil Acked-by: Mark Michelson Acked-by: Ilya Maximets --- v2: Address comment from Ilya: - Add recompute case to the test so if the debug format changes the test fails. - Add missing checks for ovs-vsctl. --- tests/ovn-controller.at | 43 +++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at index 898981867..dcab5f2e9 100644 --- a/tests/ovn-controller.at +++ b/tests/ovn-controller.at @@ -3308,51 +3308,60 @@ net_add n1 sim_add hv1 ovs-vsctl add-br br-phys ovn_attach n1 br-phys 192.168.0.20 +ovn-appctl vlog/set inc_proc_eng:dbg check ovn-nbctl ls-add ls0 check ovn-nbctl lsp-add ls0 vif -ovn-appctl inc-engine/clear-stats +m4_define([HANDLER_MESSAGE], [runtime_data, recompute (failed handler for input ovs_interface_shadow)]) -ovs-vsctl -- add-port br-int vif -- \ +check ovs-vsctl -- add-port br-int vif -- \ set Interface vif external-ids:iface-id=vif wait_row_count Port_Binding 1 logical_port="vif" up=true +AT_CHECK([test 0 = $(grep -c "HANDLER_MESSAGE" hv1/ovn-controller.log)]) -ovs-vsctl del-port br-int vif +check ovs-vsctl del-port br-int vif wait_row_count Port_Binding 1 logical_port="vif" up=false +AT_CHECK([test 0 = $(grep -c "HANDLER_MESSAGE" hv1/ovn-controller.log)]) -ovs-vsctl add-port br-int vif -- \ +check ovs-vsctl add-port br-int vif -- \ set Interface vif type=dummy -- \ set Interface vif external-ids:iface-id=vif wait_row_count Port_Binding 1 logical_port="vif" up=true +AT_CHECK([test 0 = $(grep -c "HANDLER_MESSAGE" hv1/ovn-controller.log)]) -ovs-vsctl del-port br-int vif +check ovs-vsctl del-port br-int vif wait_row_count Port_Binding 1 logical_port="vif" up=false +AT_CHECK([test 0 = $(grep -c "HANDLER_MESSAGE" hv1/ovn-controller.log)]) -ovs-vsctl add-port br-int vif -- \ +check ovs-vsctl add-port br-int vif -- \ set Interface vif type=geneve -- \ set Interface vif options:remote_ip=1.1.1.1 external-ids:iface-id=vif wait_row_count Port_Binding 1 logical_port="vif" up=true +AT_CHECK([test 0 = $(grep -c "HANDLER_MESSAGE" hv1/ovn-controller.log)]) -ovs-vsctl del-port br-int vif +check ovs-vsctl del-port br-int vif wait_row_count Port_Binding 1 logical_port="vif" up=false +AT_CHECK([test 0 = $(grep -c "HANDLER_MESSAGE" hv1/ovn-controller.log)]) # Make sure that setting iface in two different transaction doesn't # cause recompute. -ovs-vsctl add-port br-int vif -ovs-vsctl set Interface vif external-ids:iface-id=vif +check ovs-vsctl add-port br-int vif +check ovs-vsctl set Interface vif external-ids:iface-id=vif wait_row_count Port_Binding 1 logical_port="vif" up=true +AT_CHECK([test 0 = $(grep -c "HANDLER_MESSAGE" hv1/ovn-controller.log)]) -ovs-vsctl del-port br-int vif +check ovs-vsctl del-port br-int vif wait_row_count Port_Binding 1 logical_port="vif" up=false +AT_CHECK([test 0 = $(grep -c "HANDLER_MESSAGE" hv1/ovn-controller.log)]) -AT_CHECK([ovn-appctl inc-engine/show-stats runtime_data |\ - sed "s/- compute:\s\+[[0-9]]\+/- compute: ??/"], [0], [dnl -Node: runtime_data -- recompute: 0 -- compute: ?? -- cancel: 0 -]) +# Make sure that setting dummy iface in two different transactions +# causes recompute. +check ovs-vsctl add-port br-int vif -- \ + set Interface vif type=dummy +check ovs-vsctl set Interface vif external-ids:iface-id=vif +wait_row_count Port_Binding 1 logical_port="vif" up=true +AT_CHECK([test $(grep -c "HANDLER_MESSAGE" hv1/ovn-controller.log) -ge 1]) OVN_CLEANUP([hv1]) AT_CLEANUP