From patchwork Mon Oct 23 09:22:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1853585 X-Patchwork-Delegate: dceara@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=HBDgEqeX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.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 4SDV8h0LbZz23jn for ; Mon, 23 Oct 2023 20:22:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 419F482BC8; Mon, 23 Oct 2023 09:22:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 419F482BC8 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=HBDgEqeX 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 ZarMwxTb9L7S; Mon, 23 Oct 2023 09:22:41 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 132F382BA7; Mon, 23 Oct 2023 09:22:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 132F382BA7 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EDB76C008D; Mon, 23 Oct 2023 09:22:38 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2ED04C008D for ; Mon, 23 Oct 2023 09:22:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 69E5241EFE for ; Mon, 23 Oct 2023 09:22:35 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 69E5241EFE Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HBDgEqeX X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9uhyknJWhKtk for ; Mon, 23 Oct 2023 09:22:34 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 3DC1041F06 for ; Mon, 23 Oct 2023 09:22:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3DC1041F06 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698052953; 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=f3lLhHMsmtyVXYnf9jhi7Gn33yEfGJeiQB3Opgta5BU=; b=HBDgEqeXz6kZWeIBoVEtDYAKXuvZ5/2PFJzVdI3D7iKg666+dZaqiKCcN/SQjXuWGpkYYA I3reSRJT2A+X5+5wxsSyVD+bXOAzjxjF/CmqNHbexphTuTDKfLzb0aKJSdbyiqXB0MZkqa DEGlazX0udSrIA/dvnLexB+JWmgpAKE= 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-611-JwamcfGvNf6ExGeCzBZiAA-1; Mon, 23 Oct 2023 05:22:31 -0400 X-MC-Unique: JwamcfGvNf6ExGeCzBZiAA-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 AE6C2811E7B 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 8BFD5503B; 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:28 +0200 Message-Id: <20231023092231.3861122-3-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 2/5] tests: do not start backup-northd by default 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" Tests were (usually) starting both northd and northd-backup, but the start procedure did not control which one was active. Most tests did not expect backup-northd to be running. - Either the test completely ignore the fact that backup northd might be running. In such a case, having backup-northd might hide a northd crash. - Some tests expects northd.log (and not northd-backup.log) to contain some specific strings. Having northd-backup running makes such tests to fail flakily. Signed-off-by: Xavier Simonart --- v2: do not start northd-backup instead of fixing test cases 1 by 1 --- tests/ovn-controller-vtep.at | 3 --- tests/ovn-controller.at | 6 +----- tests/ovn-macros.at | 10 +++++----- tests/ovn-northd.at | 11 +++++------ tests/ovn.at | 13 ------------- 5 files changed, 11 insertions(+), 32 deletions(-) diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at index 73971b3f4..50f31b22f 100644 --- a/tests/ovn-controller-vtep.at +++ b/tests/ovn-controller-vtep.at @@ -653,9 +653,6 @@ AT_CHECK([grep -c $northd_version vtep1/ovn-controller-vtep.log], [0], [1 as northd OVS_APP_EXIT_AND_WAIT([ovn-northd]) -as northd-backup -OVS_APP_EXIT_AND_WAIT([ovn-northd]) - check ovn-sbctl set SB_Global . options:northd_internal_version=foo check ovn-sbctl set Chassis vtep1 vtep_logical_switches=foo diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at index 0ca65f303..ea593b518 100644 --- a/tests/ovn-controller.at +++ b/tests/ovn-controller.at @@ -60,7 +60,6 @@ check_bridge_mappings () { # the RBAC rules programmed into the SB-DB. The test instruments the SB-DB # directly and we need to stop northd to avoid overwriting the instrumentation. kill `cat northd/ovn-northd.pid` -kill `cat northd-backup/ovn-northd.pid` kill `cat ovn-nb/ovsdb-server.pid` # Initially there should be no patch ports. @@ -579,10 +578,8 @@ localport lport : [[lsp1]] # pause ovn-northd check as northd ovn-appctl -t ovn-northd pause -check as northd-backup ovn-appctl -t ovn-northd pause as northd ovn-appctl -t ovn-northd status -as northd-backup ovn-appctl -t ovn-northd status pb_types=(patch chassisredirect l3gateway localnet localport l2gateway virtual external remote vtep) @@ -2097,7 +2094,6 @@ AT_CHECK([ovs-ofctl dump-flows br-int table=46 | grep -c "priority=1100"], [0], # pause ovn-northd check as northd ovn-appctl -t ovn-northd pause -check as northd-backup ovn-appctl -t ovn-northd pause # Simulate a SB address set "del and add" notification to ovn-controller in the # same IDL iteration. The flows programmed by ovn-controller should reflect the @@ -2122,7 +2118,7 @@ AT_CLEANUP AT_SETUP([ovn-controller - I-P handle lb_hairpin_use_ct_mark change]) -ovn_start --backup-northd=none +ovn_start net_add n1 sim_add hv1 diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at index 8dc4ec75c..cf8c0b3ef 100644 --- a/tests/ovn-macros.at +++ b/tests/ovn-macros.at @@ -188,16 +188,16 @@ ovn_start_northd() { # ovn-sbctl and ovn-nbctl use them by default, and starts ovn-northd running # against them. # -# Normally this starts an active northd and a backup northd. The following +# Normally this starts only an active northd and no backup northd. The following # options are accepted to adjust that: -# --backup-northd=none Don't start a backup northd. +# --backup-northd Start a backup northd. # --backup-northd=paused Start the backup northd in the paused state. ovn_start () { - local backup_northd=: + local backup_northd=false local backup_northd_options= case $1 in - --backup-northd=none) backup_northd=false; shift ;; - --backup-northd=paused) backup_northd_options=--paused; shift ;; + --backup-northd) backup_northd=true; shift ;; + --backup-northd=paused) backup_northd=true; backup_northd_options=--paused; shift ;; esac local AZ=$1 local msg_prefix=${AZ:+$AZ: } diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index 196fe01fb..565c970e5 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -813,7 +813,7 @@ AT_CLEANUP OVN_FOR_EACH_NORTHD_NO_HV([ AT_SETUP([ovn-northd restart]) -ovn_start --backup-northd=none +ovn_start # Check that ovn-northd is active, by verifying that it creates and # destroys southbound datapaths as one would expect. @@ -832,7 +832,7 @@ sleep 5 check_row_count Datapath_Binding 1 # Now resume ovn-northd. Changes should catch up. -ovn_start_northd primary +ovn_start_northd wait_row_count Datapath_Binding 2 AT_CLEANUP @@ -841,7 +841,7 @@ AT_CLEANUP OVN_FOR_EACH_NORTHD_NO_HV([ AT_SETUP([northbound database reconnection]) -ovn_start --backup-northd=none +ovn_start # Check that ovn-northd is active, by verifying that it creates and # destroys southbound datapaths as one would expect. @@ -873,7 +873,7 @@ AT_CLEANUP OVN_FOR_EACH_NORTHD_NO_HV([ AT_SETUP([southbound database reconnection]) -ovn_start --backup-northd=none +ovn_start # Check that ovn-northd is active, by verifying that it creates and # destroys southbound datapaths as one would expect. @@ -4612,7 +4612,7 @@ AT_SKIP_IF([test "$HAVE_OPENSSL" = no]) PKIDIR="$(cd $abs_top_builddir/tests && pwd)" AT_SKIP_IF([expr "$PKIDIR" : ".*[[ '\" \\]]"]) -ovn_start --backup-northd=none +ovn_start as northd OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE]) @@ -9002,7 +9002,6 @@ grep -c mutate], [0], [2 # Pause ovn-northd and add/remove few addresses. when it is resumed # it should use mutate for updating the address sets. check as northd ovn-appctl -t NORTHD_TYPE pause -check as northd-backup ovn-appctl -t NORTHD_TYPE pause check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats check ovn-nbctl add address_set $foo_as_uuid addresses 1.1.1.5 diff --git a/tests/ovn.at b/tests/ovn.at index ee6803f5b..3ce273a55 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -7168,9 +7168,6 @@ compare_dhcp_packets 1 as northd OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE]) -as northd-backup -OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE]) - northd_version=$(ovn-sbctl get SB_Global . options:northd_internal_version | sed s/\"//g) echo "northd version = $northd_version" @@ -30635,7 +30632,6 @@ check ovn-nbctl --wait=hv ls-lb-del sw0 lb-ipv6 # original destination tuple. # # ovn-controller should fall back to matching on ct_nw_dst()/ct_tp_dst(). -as northd-backup ovn-appctl -t NORTHD_TYPE pause as northd ovn-appctl -t NORTHD_TYPE pause check ovn-sbctl \ @@ -30686,7 +30682,6 @@ OVS_WAIT_FOR_OUTPUT([as hv2 ovs-ofctl dump-flows br-int table=70 | ofctl_strip_a # Resume ovn-northd. as northd ovn-appctl -t NORTHD_TYPE resume -as northd-backup ovn-appctl -t NORTHD_TYPE resume check ovn-nbctl --wait=hv sync as hv2 ovs-vsctl del-port hv2-vif1 @@ -30807,9 +30802,6 @@ AT_CHECK([grep -c $northd_version hv1/ovn-controller.log], [0], [1 as northd OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE]) -as northd-backup -OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE]) - check ovn-sbctl set SB_Global . options:northd_internal_version=foo as hv1 @@ -30951,7 +30943,6 @@ AS_BOX([ovn-controller should not reset Port_Binding.up without northd]) # Pause northd and clear the "up" field to simulate older ovn-northd # versions writing to the Southbound DB. as northd ovn-appctl -t NORTHD_TYPE pause -as northd-backup ovn-appctl -t NORTHD_TYPE pause as hv1 ovn-appctl -t ovn-controller debug/pause check ovn-sbctl clear Port_Binding lsp1 up @@ -30967,7 +30958,6 @@ check_column "" Port_Binding up logical_port=lsp1 # Once northd should explicitly set the Port_Binding.up field to 'false' and # ovn-controller sets it to 'true' as soon as the update is processed. as northd ovn-appctl -t NORTHD_TYPE resume -as northd-backup ovn-appctl -t NORTHD_TYPE resume wait_column "true" Port_Binding up logical_port=lsp1 wait_column "true" nb:Logical_Switch_Port up name=lsp1 @@ -31122,7 +31112,6 @@ check ovn-nbctl lsp-set-addresses sw0-p4 "00:00:00:00:00:04 192.168.47.4" # will be sent in one transaction. check as northd ovn-appctl -t NORTHD_TYPE pause -check as northd-backup ovn-appctl -t NORTHD_TYPE pause check ovn-nbctl lsp-add sw0 sw0-p1 check ovn-nbctl lsp-set-addresses sw0-p1 "00:00:00:00:00:01 192.168.47.1" @@ -33573,7 +33562,6 @@ check as hv1 ovn-appctl -t ovn-controller exit # Pause northd to guarantee that ovn-controller starts before requested_chassis # column is filled. -check as northd-backup ovn-appctl -t ovn-northd pause check as northd ovn-appctl -t ovn-northd pause # Wait until requested_chassis is empty @@ -33587,7 +33575,6 @@ wait_column "hv1" Chassis name # Start northd and wait for events to be processed check as northd ovn-appctl -t ovn-northd resume -check as northd-backup ovn-appctl -t ovn-northd resume wait_for_ports_up lsp1