From patchwork Tue Jul 23 15:54:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1963963 X-Patchwork-Delegate: nusiddiq@redhat.com 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=TH5u7iIj; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WT1v93QVhz1yZw for ; Wed, 24 Jul 2024 01:55:17 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 70D0A60748; Tue, 23 Jul 2024 15:55:15 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 7zhkDu_IT5vG; Tue, 23 Jul 2024 15:55:10 +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 smtp3.osuosl.org 5B59460889 Authentication-Results: smtp3.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=TH5u7iIj Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 5B59460889; Tue, 23 Jul 2024 15:55:06 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0A693C0A97; Tue, 23 Jul 2024 15:55:06 +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 12F28C0A96 for ; Tue, 23 Jul 2024 15:54:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 3581B81285 for ; Tue, 23 Jul 2024 15:54:57 +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 RReEsAmDEuAO for ; Tue, 23 Jul 2024 15:54:56 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=xsimonar@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 3301D81254 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 3301D81254 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=TH5u7iIj Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 3301D81254 for ; Tue, 23 Jul 2024 15:54:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721750094; 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=haeF38g9AxWrnhA1F13WzZjsek7zWJVMkWLJ7YCCxiw=; b=TH5u7iIjmxZ5+UtAiEJgQhzacBwt3/UQ3F767FKMapPx868/SZoTqEu+7e02Dm9OBtlvlV ggu2fTbGIW1aBZ1DKXZKZT5J0dYISZ60UGV3iPBWiCaY4klE02cYIVJS/j5hjC38sfpxHI rXpj/1Vf+YpzGqpbfyWKlcoyR/xYoGE= Received: from mx-prod-mc-02.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-35-3zt-L1n8N7W32uX1uNCcTg-1; Tue, 23 Jul 2024 11:54:52 -0400 X-MC-Unique: 3zt-L1n8N7W32uX1uNCcTg-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ED9641955D44 for ; Tue, 23 Jul 2024 15:54:49 +0000 (UTC) Received: from wsfd-netdev90.ntdv.lab.eng.bos.redhat.com (wsfd-netdev90.anl.eng.rdu2.dc.redhat.com [10.6.38.135]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 69D9F1955D45; Tue, 23 Jul 2024 15:54:49 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Tue, 23 Jul 2024 17:54:43 +0200 Message-Id: <20240723155444.2530187-7-xsimonar@redhat.com> In-Reply-To: <20240723155444.2530187-1-xsimonar@redhat.com> References: <20240719153603.2914663-2-xsimonar@redhat.com> <20240723155444.2530187-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn v2 6/7] tests: Compare IP and recompute related ports. 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: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Compare related-lports as obtained by IP and after recompute, automatically, for all unit tests. In current OVN, a datapath is not removed from the set of local datapath when it should (e.g. the last local port is removed). This is a known limitation of current implementation. Avoid test failing indirectly due to this reason (port considered as related as on a datapath erroneoulsy seen as local). Signed-off-by: Xavier Simonart --- tests/ovn-controller.at | 20 +++++++++++++------- tests/ovn-macros.at | 12 +++++++----- tests/ovn.at | 25 ++++++++++++++++++++----- 3 files changed, 40 insertions(+), 17 deletions(-) diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at index 2cb86dc98..1837942b4 100644 --- a/tests/ovn-controller.at +++ b/tests/ovn-controller.at @@ -201,13 +201,13 @@ OVS_WAIT_UNTIL([ # This requires operator intervention and removal of the stale chassis and # chassis_private records. Until that happens ovn-controller fails to # create the records due to constraint violation on the Encap table. -sysid=${sysid}-foo +new_sysid=${sysid}-foo current_remote=`ovs-vsctl get Open_vSwitch . external-ids:ovn-remote` if test X$HAVE_OPENSSL = Xyes; then # To change chassis name we need to change certificate with matching CN ovs-vsctl set-ssl \ - $PKIDIR/testpki-${sysid}-privkey.pem \ - $PKIDIR/testpki-${sysid}-cert.pem \ + $PKIDIR/testpki-${new_sysid}-privkey.pem \ + $PKIDIR/testpki-${new_sysid}-cert.pem \ $PKIDIR/testpki-cacert.pem # force reconnect which makes OVN controller read the new certificates # TODO implement check for change of certificates in ovn-controller @@ -221,8 +221,8 @@ if test X$HAVE_OPENSSL = Xyes; then OVS_WAIT_UNTIL([test x$(ovn-appctl -t ovn-controller debug/status) = "xrunning"]) fi -ovs-vsctl -- set Open_vSwitch . external-ids:hostname="${sysid}" \ - -- set Open_vSwitch . external-ids:system-id="${sysid}" \ +ovs-vsctl -- set Open_vSwitch . external-ids:hostname="${new_sysid}" \ + -- set Open_vSwitch . external-ids:system-id="${new_sysid}" \ -- set Open_vSwitch . external-ids:ovn-remote="${current_remote}" OVS_WAIT_UNTIL([ @@ -233,13 +233,19 @@ OVS_WAIT_UNTIL([ # to create new ones. check ovn-sbctl destroy chassis_private . -- destroy chassis . -wait_row_count Chassis_Private 1 name=${sysid} -wait_row_count Chassis 1 name=${sysid} +wait_row_count Chassis_Private 1 name=${new_sysid} +wait_row_count Chassis 1 name=${new_sysid} # Only one Chassis_Private/Chassis record should exist. wait_row_count Chassis_Private 1 wait_row_count Chassis 1 +# Reset sys_id back so we can properly cleanup. +ovs-vsctl -- set Open_vSwitch . external-ids:hostname="${sysid}" \ + -- set Open_vSwitch . external-ids:system-id="${sysid}" \ + -- set Open_vSwitch . external-ids:ovn-remote="${current_remote}" +check ovn-sbctl destroy chassis_private . -- destroy chassis . + # Gracefully terminate daemons # Ignore following errors: # - Invalid ovn-bridge-mappings configuration: 'foo-mapping' diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at index 02de7208d..61c9a2396 100644 --- a/tests/ovn-macros.at +++ b/tests/ovn-macros.at @@ -141,9 +141,9 @@ m4_define([CHECK_AFTER_RECOMPUTE], [ m4_define([OVN_CLEANUP_CONTROLLER],[ hv=$1 sbox=$2 + related_ports=$3 - ovn-nbctl --wait=hv sync - as $sbox + CHECK_RELATED_PORTS_AFTER_RECOMPUTE([$hv], [$sbox], [$related_ports]) if test "$hv" = "vtep"; then OVS_APP_EXIT_AND_WAIT([ovn-controller-vtep]) OVS_APP_EXIT_AND_WAIT([ovs-vtep]) @@ -161,8 +161,9 @@ m4_define([OVN_CLEANUP_CONTROLLER],[ m4_define([OVN_CLEANUP_SBOX],[ sbox=$1 error=$2 + related_ports=$3 echo "$sbox: clean up sandbox" - OVN_CLEANUP_CONTROLLER([$sbox], [$sbox]) + OVN_CLEANUP_CONTROLLER([$sbox], [$sbox], [$related_ports]) OVN_CLEANUP_VSWITCH([$sbox]) # Check for errors in logs. Ignore following errors: @@ -189,8 +190,9 @@ m4_define([OVN_CLEANUP_SBOX],[ m4_define([OVN_CLEANUP],[ m4_foreach([sbox_and_error], [$@], [ sbox=$(echo "sbox_and_error" |sed -n '1p') - error=$(echo "sbox_and_error" | sed -n '2,$p') - OVN_CLEANUP_SBOX([$sbox], [$error]) + error=$(echo "sbox_and_error" | grep '/') + related_ports=$(echo "sbox_and_error" | sed -n '2,$p' | grep -v '/') + OVN_CLEANUP_SBOX([$sbox], [$error], [$related_ports]) ]) echo diff --git a/tests/ovn.at b/tests/ovn.at index bd66f602c..9d0bcc81b 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -16487,7 +16487,6 @@ AT_CHECK([test "${hv1_claims}" -le "${max_claims}"], [0], []) AT_CHECK([test "${hv2_claims}" -le "${max_claims}"], [0], []) check ovn-nbctl --wait=hv lsp-del lsp0 - CHECK_AFTER_RECOMPUTE([hv1], [hv1]) OVN_CLEANUP([hv1],[hv2]) @@ -16792,7 +16791,11 @@ echo $expected_garp >> hv2/n1.expected OVN_CHECK_PACKETS([hv1/br-phys_n1-tx.pcap], [hv1/n1.expected]) OVN_CHECK_PACKETS_CONTAIN([hv2/br-phys_n1-tx.pcap], [hv2/n1.expected]) -OVN_CLEANUP([hv1],[hv2]) +# ls0 is not local to hv1 anymore. +# So public should not be a related_port. +OVN_CLEANUP([hv1 +public +],[hv2]) AT_CLEANUP ]) @@ -24392,9 +24395,10 @@ m4_define([DVR_N_S_ARP_HANDLING], as hv4 ovs-appctl fdb/show br-phys # Expect some potential transaction errors for MAC_Binding + # Since router-to-underlay moved to hv3, ls-underlay is not local to hv1 anymore and ln3 should not be a related_port. OVN_CLEANUP([hv1 /transaction error/d - ],[hv2 +ln3],[hv2 /transaction error/d ],[hv3 /transaction error/d @@ -33176,7 +33180,14 @@ test_ip vif11 f00000000010 06ac10010001 $sip $dip vif-north3 # Confirm that South to North traffic works fine. OVN_CHECK_PACKETS_REMOVE_BROADCAST([hv5/vif-north3-tx.pcap], [vif-north3.expected]) -OVN_CLEANUP([hv1],[hv2],[hv3],[hv4],[hv5]) +# Since DR-S1, DR-S2 and DR-S3 are gw-chassis on resp. hv2, hv3 and hv4, +# S1, S2 and S3 should not be local datapaths on hv1, and their localnets +# should not be related ports. +OVN_CLEANUP([hv1 +ln1 +ln2 +ln3 +],[hv2],[hv3],[hv4],[hv5]) AT_CLEANUP ]) @@ -36951,7 +36962,11 @@ OVS_WAIT_UNTIL([test `ovn-sbctl get Port_Binding lsp2 up` = 'false']) # Check ports are unbound wait_column "" Port_Binding chassis logical_port=lsp1 wait_column "" Port_Binding chassis logical_port=lsp2 -OVN_CLEANUP([hv1]) + +# ls1 should not be a local datapath in hv1 as vif1 iface-id has been removed. +# Hence ln1 should not be a related port. +OVN_CLEANUP([hv1 +ln1]) AT_CLEANUP ])