From patchwork Fri Jul 19 15:36:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1962541 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=PwqwCh46; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.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 4WQYgG2sLBz20FP for ; Sat, 20 Jul 2024 01:36:26 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id A2A5B4105B; Fri, 19 Jul 2024 15:36:24 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id TizcAc2EHBZ3; Fri, 19 Jul 2024 15:36:22 +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 smtp2.osuosl.org D0EB140FF7 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=PwqwCh46 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id D0EB140FF7; Fri, 19 Jul 2024 15:36:21 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 046FFC0A9A; Fri, 19 Jul 2024 15:36:21 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id AC523C0A97 for ; Fri, 19 Jul 2024 15:36:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8F79360893 for ; Fri, 19 Jul 2024 15:36:13 +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 OYYR8NNfduoi for ; Fri, 19 Jul 2024 15:36:12 +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 smtp3.osuosl.org 992D36079B Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 992D36079B Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PwqwCh46 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 992D36079B for ; Fri, 19 Jul 2024 15:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721403371; 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=F92llSF0JzJC6rp6d1OyVSCc0DR1Su17GrquQcEPSNI=; b=PwqwCh46+C0FDWH+mXBXv7tj3TC3Gu9Tl4Z3/U9bQ7NmdyKnzeq1fzqg6yoSXcdqbkdw4F uIGji4K0zewFQOTYOWGjZEd5UcBZ7BdvDD3K0XLxWZ464tfeb9sbLASH3aQi10zSU9bh8p fbxskXn3ujOHbfJsI5o4Rf+6oH+cCvM= Received: from mx-prod-mc-05.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-647-waTWnpzuMmqPSuHlmcmkrg-1; Fri, 19 Jul 2024 11:36:10 -0400 X-MC-Unique: waTWnpzuMmqPSuHlmcmkrg-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 408511955F49 for ; Fri, 19 Jul 2024 15:36:09 +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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5657F1955D4D; Fri, 19 Jul 2024 15:36:08 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Fri, 19 Jul 2024 17:36:02 +0200 Message-Id: <20240719153603.2914663-7-xsimonar@redhat.com> In-Reply-To: <20240719153603.2914663-1-xsimonar@redhat.com> References: <20240719153603.2914663-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 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 32114fffe..1ca15c9c5 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 @@ -33169,7 +33173,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 ]) @@ -36944,7 +36955,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 ])