From patchwork Mon Oct 23 09:22:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1853587 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=P0hl1zy0; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SDV8q4Fwpz23jn for ; Mon, 23 Oct 2023 20:22:51 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9AD8A41555; Mon, 23 Oct 2023 09:22:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 9AD8A41555 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=P0hl1zy0 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 1eMTczalkFBx; Mon, 23 Oct 2023 09:22:45 +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 0D9DB4154A; Mon, 23 Oct 2023 09:22:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 0D9DB4154A Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AF9D1C008D; Mon, 23 Oct 2023 09:22:42 +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 0F44BC0039 for ; Mon, 23 Oct 2023 09:22:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id D8F3E82BC8 for ; Mon, 23 Oct 2023 09:22:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org D8F3E82BC8 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=P0hl1zy0 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 EQwGGa1VydXC for ; Mon, 23 Oct 2023 09:22:39 +0000 (UTC) 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 0EC7482BA7 for ; Mon, 23 Oct 2023 09:22:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0EC7482BA7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698052958; 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: in-reply-to:in-reply-to:references:references; bh=1ajCnF5Nx/yWFAzB9nX/GoGZY4piImQO3YgZtSko8kE=; b=P0hl1zy0IUArnY0mR8K8UZtvw9xnuzuIpphShPsqzmbdaYqxkJ4t/Bw85bKz4PMTGhDEI6 lj9Sgw3ZGrHtBi/DAWNlJvyFl08moApRJkkFNtBImZhdbR4WgIv94viVsydqA4coK3TcuK WWo9lTQQCnYdFZbBZME550LRKvPaZRs= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-596-c7lMCSm7NoCSxVubAq7kDQ-1; Mon, 23 Oct 2023 05:22:32 -0400 X-MC-Unique: c7lMCSm7NoCSxVubAq7kDQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 D8CAB1C06E2D for ; Mon, 23 Oct 2023 09:22:31 +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 B57BC8C0A; Mon, 23 Oct 2023 09:22:31 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Mon, 23 Oct 2023 11:22:29 +0200 Message-Id: <20231023092231.3861122-4-xsimonar@redhat.com> In-Reply-To: <20231023092231.3861122-1-xsimonar@redhat.com> References: <20231023092231.3861122-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: dceara@redhat.com Subject: [ovs-dev] [PATCH ovn v2 3/5] tests: fixed "LSP incremental processing" 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" We might get less recomputes than expected: e.g. Port_Binding->chassis and Port_Binding->up might be received by northd within the same idl transaction. Signed-off-by: Xavier Simonart --- v2: check number of recomputes within bounds (min/max) instead of just a max --- tests/ovn-northd.at | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index 565c970e5..a5fad791e 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -10024,14 +10024,21 @@ ovs-vsctl add-br br-phys ovn_attach n1 br-phys 192.168.0.11 check_recompute_counter() { + northd_recomp_min=$1 + northd_recomp_max=$2 + lflow_recomp_min=$3 + lflow_recomp_max=$4 + sync_sb_pb_recomp_min=$5 + sync_sb_pb_recomp_max=$6 + northd_recomp=$(as northd ovn-appctl -t NORTHD_TYPE inc-engine/show-stats northd recompute) - AT_CHECK([test x$northd_recomp = x$1]) + AT_CHECK([test $northd_recomp -ge $northd_recomp_min && test $northd_recomp -le $northd_recomp_max]) lflow_recomp=$(as northd ovn-appctl -t NORTHD_TYPE inc-engine/show-stats lflow recompute) - AT_CHECK([test x$lflow_recomp = x$2]) + AT_CHECK([test $lflow_recomp -ge $lflow_recomp_min && test $lflow_recomp -le $lflow_recomp_max]) sync_sb_pb_recomp=$(as northd ovn-appctl -t NORTHD_TYPE inc-engine/show-stats sync_to_sb_pb recompute) - AT_CHECK([test x$sync_sb_pb_recomp = x$3]) + AT_CHECK([test $sync_sb_pb_recomp -ge $sync_sb_pb_recomp_min && test $sync_sb_pb_recomp -le $sync_sb_pb_recomp_max]) } check ovn-nbctl --wait=hv ls-add ls0 @@ -10048,29 +10055,29 @@ check ovn-nbctl --wait=hv lsp-add ls0 lsp0-0 -- lsp-set-addresses lsp0-0 "unknow ovs-vsctl add-port br-int lsp0-0 -- set interface lsp0-0 external_ids:iface-id=lsp0-0 wait_for_ports_up check ovn-nbctl --wait=hv sync -check_recompute_counter 5 5 5 +check_recompute_counter 4 5 5 5 5 5 check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats check ovn-nbctl --wait=hv lsp-add ls0 lsp0-1 -- lsp-set-addresses lsp0-1 "aa:aa:aa:00:00:01 192.168.0.11" ovs-vsctl add-port br-int lsp0-1 -- set interface lsp0-1 external_ids:iface-id=lsp0-1 wait_for_ports_up check ovn-nbctl --wait=hv sync -check_recompute_counter 0 0 0 +check_recompute_counter 0 0 0 0 0 0 check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats check ovn-nbctl --wait=hv lsp-add ls0 lsp0-2 -- lsp-set-addresses lsp0-2 "aa:aa:aa:00:00:02 192.168.0.12" ovs-vsctl add-port br-int lsp0-2 -- set interface lsp0-2 external_ids:iface-id=lsp0-2 wait_for_ports_up check ovn-nbctl --wait=hv sync -check_recompute_counter 0 0 0 +check_recompute_counter 0 0 0 0 0 0 check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats check ovn-nbctl --wait=hv lsp-del lsp0-1 -check_recompute_counter 0 0 0 +check_recompute_counter 0 0 0 0 0 0 check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats check ovn-nbctl --wait=hv lsp-set-addresses lsp0-2 "aa:aa:aa:00:00:88 192.168.0.88" -check_recompute_counter 0 0 0 +check_recompute_counter 0 0 0 0 0 0 # Delete and re-add a LSP for several times continuously, to ensure # frequent operations do not trigger recompute when there are in-flight @@ -10084,12 +10091,12 @@ for i in $(seq 10); do check ovn-nbctl lsp-del lsp0-2 check ovn-nbctl lsp-add ls0 lsp0-2 -- lsp-set-addresses lsp0-2 "aa:aa:aa:00:00:02 192.168.0.12" done -check_recompute_counter 0 0 0 +check_recompute_counter 0 0 0 0 0 0 # No change, no recompute check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats check ovn-nbctl --wait=sb sync -check_recompute_counter 0 0 0 +check_recompute_counter 0 0 0 0 0 0 CHECK_NO_CHANGE_AFTER_RECOMPUTE @@ -10101,7 +10108,7 @@ ovn-nbctl dhcp-options-set-options $CIDR_UUID lease_time=3600 router=192.168. check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats ovn-nbctl --wait=sb lsp-set-dhcpv4-options lsp0-2 $CIDR_UUID -check_recompute_counter 0 0 0 +check_recompute_counter 0 0 0 0 0 0 CHECK_NO_CHANGE_AFTER_RECOMPUTE @@ -10112,7 +10119,7 @@ options="\"server_id\"=\"00:00:00:10:00:01\"")" check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats ovn-nbctl --wait=sb lsp-set-dhcpv6-options lsp0-2 ${d1} -check_recompute_counter 0 0 0 +check_recompute_counter 0 0 0 0 0 0 CHECK_NO_CHANGE_AFTER_RECOMPUTE