From patchwork Thu Apr 20 16:14:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1771527 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) 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=hgy6Js/W; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q2N6T0HZwz23tD for ; Fri, 21 Apr 2023 02:15:12 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 2487442BBF; Thu, 20 Apr 2023 16:15:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 2487442BBF 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=hgy6Js/W 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 PnRmaAiQL_Zo; Thu, 20 Apr 2023 16:15:08 +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 5599C427D6; Thu, 20 Apr 2023 16:15:07 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5599C427D6 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 52D30C008E; Thu, 20 Apr 2023 16:15:05 +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 577B9C0037 for ; Thu, 20 Apr 2023 16:15:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 4A64C4188C for ; Thu, 20 Apr 2023 16:15:02 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 4A64C4188C 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=hgy6Js/W 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 85w0CAOnPraY for ; Thu, 20 Apr 2023 16:15:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org AFE4D40975 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 AFE4D40975 for ; Thu, 20 Apr 2023 16:15:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682007299; 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; bh=NqOzBc3E+z4bf06zlrM05abHUG69nRdIUOhvmburLus=; b=hgy6Js/WsSuoIWVl+ZofMrJo6tylalmYXNBv/TxrhAnNJzJktVNMxtBID/jhTpykc7TJS8 T3uLvD6qhfAcc7Ohbi59qrvwSoRkvfh2BttlrpuaWieTWr/JtSc/hSETYMhvhCQj0fYQ7f qM5KRLTjU3FoqsE41ttQaMaPp9LfInk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-441-WekhjYgDOI-U_GOSKSN5Hw-1; Thu, 20 Apr 2023 12:14:56 -0400 X-MC-Unique: WekhjYgDOI-U_GOSKSN5Hw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0A3A1185A794 for ; Thu, 20 Apr 2023 16:14:56 +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 E04A12026D16; Thu, 20 Apr 2023 16:14:55 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Thu, 20 Apr 2023 18:14:53 +0200 Message-Id: <20230420161455.134493-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 1/3] tests: Fixed "1 LR with HA distributed router gateway port" 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" This test is broken since a long time but passed as it used OVS_WAIT_UNTIL for checking output, which succeeds whatever the output is ... - Replaced OVS_WAIT_UNTIL by OVS_WAIT_FOR_OUTPUT - Update table numbers - Added back hv$i-vif1 port - Changed slaves to members - Added back gw2 (hence could remove the XXX) The following has also been removed: OVS_WAIT_UNTIL([as gw2 ovs-ofctl dump-flows br-int table=9 | grep arp_tpa=192.168.0.101 | wc -l], [0], [[0 i.e. checking ARP responder flows in ls_in_arp_rsp as the test expected n such flows for the lowest priority chassis in the HA group. Signed-off-by: Xavier Simonart Acked-by: Ales Musil --- tests/ovn.at | 159 +++++++++++++++++++++++---------------------------- 1 file changed, 72 insertions(+), 87 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index 7e804699a..aba3e92c6 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -13277,30 +13277,27 @@ as hv2 ovs-ofctl dump-flows br-int table=37 gw1_chassis=$(fetch_column Chassis _uuid name=gw1) gw2_chassis=$(fetch_column Chassis _uuid name=gw2) -OVS_WAIT_UNTIL([as hv1 ovs-ofctl dump-flows br-int table=37 | \ -grep active_backup | grep slaves:$hv1_gw1_ofport,$hv1_gw2_ofport \ +OVS_WAIT_FOR_OUTPUT([as hv1 ovs-ofctl dump-flows br-int table=37 | \ +grep active_backup | grep members:$hv1_gw1_ofport,$hv1_gw2_ofport \ | wc -l], [0], [1 ]) -OVS_WAIT_UNTIL([as hv2 ovs-ofctl dump-flows br-int table=37 | \ -grep active_backup | grep slaves:$hv2_gw1_ofport,$hv2_gw2_ofport \ +OVS_WAIT_FOR_OUTPUT([as hv2 ovs-ofctl dump-flows br-int table=37 | \ +grep active_backup | grep members:$hv2_gw1_ofport,$hv2_gw2_ofport \ | wc -l], [0], [1 ]) -# make sure that flows for handling the outside router port reside on gw1 -OVS_WAIT_UNTIL([as gw1 ovs-ofctl dump-flows br-int table=25 | \ -grep 00:00:02:01:02:04 | wc -l], [0], [[1 +# make sure that flows for handling the outside router port reside on gw1 through ls_in_l2_lkup table +OVS_WAIT_FOR_OUTPUT([as gw1 ovs-ofctl dump-flows br-int table=33 | \ +grep "dl_dst=00:00:02:01:02:04" | wc -l], [0], [[1 ]]) -OVS_WAIT_UNTIL([as gw2 ovs-ofctl dump-flows br-int table=25 | \ -grep 00:00:02:01:02:04 | wc -l], [0], [[0 +OVS_WAIT_FOR_OUTPUT([as gw2 ovs-ofctl dump-flows br-int table=33 | \ +grep "dl_dst=00:00:02:01:02:04" | wc -l], [0], [[0 ]]) -# make sure ARP responder flows for outside router port reside on gw1 too -OVS_WAIT_UNTIL([as gw1 ovs-ofctl dump-flows br-int table=9 | \ -grep arp_tpa=192.168.0.101 | wc -l], [0], [[1 -]]) -OVS_WAIT_UNTIL([as gw2 ovs-ofctl dump-flows br-int table=9 | grep arp_tpa=192.168.0.101 | wc -l], [0], [[0 -]]) +# make sure ARP responder flows for outside router port reside on gw1 too through ls_in_arp_rsp table +OVS_WAIT_UNTIL([test `as gw1 ovs-ofctl dump-flows br-int table=27 | \ +grep arp_tpa=192.168.0.101 | wc -l` -ge 1]) # check that the chassis redirect port has been claimed by the gw1 chassis wait_row_count Port_Binding 1 logical_port=cr-outside chassis=$gw1_chassis @@ -13323,13 +13320,13 @@ wait_for_ports_up check ovn-nbctl --wait=hv sync # we make sure that the hypervisors noticed, and inverted the slave ports -OVS_WAIT_UNTIL([as hv1 ovs-ofctl dump-flows br-int table=37 | \ -grep active_backup | grep slaves:$hv1_gw2_ofport,$hv1_gw1_ofport \ +OVS_WAIT_FOR_OUTPUT([as hv1 ovs-ofctl dump-flows br-int table=37 | \ +grep active_backup | grep members:$hv1_gw2_ofport,$hv1_gw1_ofport \ | wc -l], [0], [1 ]) -OVS_WAIT_UNTIL([as hv2 ovs-ofctl dump-flows br-int table=37 | \ -grep active_backup | grep slaves:$hv2_gw2_ofport,$hv2_gw1_ofport \ +OVS_WAIT_FOR_OUTPUT([as hv2 ovs-ofctl dump-flows br-int table=37 | \ +grep active_backup | grep members:$hv2_gw2_ofport,$hv2_gw1_ofport \ | wc -l], [0], [1 ]) @@ -13381,11 +13378,11 @@ AT_CHECK([ovs-vsctl --bare --columns bfd find Interface name=ovn-hv1-0],[0], ]]) # make sure that flows for handling the outside router port reside on gw2 now -OVS_WAIT_UNTIL([as gw2 ovs-ofctl dump-flows br-int table=25 | \ -grep 00:00:02:01:02:04 | wc -l], [0], [[1 +OVS_WAIT_FOR_OUTPUT([as gw2 ovs-ofctl dump-flows br-int table=33 | \ +grep "dl_dst=00:00:02:01:02:04" | wc -l], [0], [[1 ]]) -OVS_WAIT_UNTIL([as gw1 ovs-ofctl dump-flows br-int table=25 | \ -grep 00:00:02:01:02:04 | wc -l], [0], [[0 +OVS_WAIT_FOR_OUTPUT([as gw1 ovs-ofctl dump-flows br-int table=33 | \ +grep "dl_dst=00:00:02:01:02:04" | wc -l], [0], [[0 ]]) # disconnect GW2 from the network, GW1 should take over @@ -13395,12 +13392,12 @@ as main ovs-vsctl del-port n1 $port bfd_dump -# make sure that flows for handling the outside router port reside on gw2 now -OVS_WAIT_UNTIL([as gw1 ovs-ofctl dump-flows br-int table=25 | \ -grep 00:00:02:01:02:04 | wc -l], [0], [[1 +# make sure that flows for handling the outside router port reside on gw1 now +OVS_WAIT_FOR_OUTPUT([as gw1 ovs-ofctl dump-flows br-int table=33 | \ +grep "dl_dst=00:00:02:01:02:04" | wc -l], [0], [[1 ]]) -OVS_WAIT_UNTIL([as gw2 ovs-ofctl dump-flows br-int table=25 | \ -grep 00:00:02:01:02:04 | wc -l], [0], [[0 +OVS_WAIT_FOR_OUTPUT([as gw2 ovs-ofctl dump-flows br-int table=33 | \ +grep "dl_dst=00:00:02:01:02:04" | wc -l], [0], [[0 ]]) # check that the chassis redirect port has been reclaimed by the gw1 chassis @@ -13479,45 +13476,16 @@ ovn-nbctl set Logical_Router_Port outside ha_chassis_group=$hagrp1_uuid wait_row_count HA_Chassis_Group 1 wait_row_count HA_Chassis 2 -OVS_WAIT_UNTIL([as hv1 ovs-ofctl dump-flows br-int table=37 | \ -grep active_backup | grep slaves:$hv1_gw1_ofport,$hv1_gw2_ofport \ -| wc -l], [0], [1 +OVS_WAIT_FOR_OUTPUT([as hv1 ovs-ofctl dump-flows br-int table=37 | \ +grep active_backup | grep members:$hv1_gw1_ofport,$hv1_gw2_ofport \ +| wc -l], [0], [0 ]) -OVS_WAIT_UNTIL([as hv2 ovs-ofctl dump-flows br-int table=37 | \ -grep active_backup | grep slaves:$hv2_gw1_ofport,$hv2_gw2_ofport \ -| wc -l], [0], [1 +OVS_WAIT_FOR_OUTPUT([as hv2 ovs-ofctl dump-flows br-int table=37 | \ +grep active_backup | grep members:$hv2_gw1_ofport,$hv2_gw2_ofport \ +| wc -l], [0], [0 ]) -# make sure that flows for handling the outside router port reside on gw1 -OVS_WAIT_UNTIL([as gw1 ovs-ofctl dump-flows br-int table=24 | \ -grep 00:00:02:01:02:04 | wc -l], [0], [[1 -]]) -OVS_WAIT_UNTIL([as gw2 ovs-ofctl dump-flows br-int table=24 | \ -grep 00:00:02:01:02:04 | wc -l], [0], [[0 -]]) - -# make sure ARP responder flows for outside router port reside on gw1 too -OVS_WAIT_UNTIL([as gw1 ovs-ofctl dump-flows br-int table=9 | \ -grep arp_tpa=192.168.0.101 | wc -l], [0], [[1 -]]) -OVS_WAIT_UNTIL([as gw2 ovs-ofctl dump-flows br-int table=9 | grep arp_tpa=192.168.0.101 | wc -l], [0], [[0 -]]) - -# check that the chassis redirect port has been claimed by the gw1 chassis -# -# XXX actually it doesn't happen, the test has always been wrong here -# because the following just checks that "wc -l" succeeds (and it always -# does): -# -# OVS_WAIT_UNTIL([ovn-sbctl --columns chassis --bare find Port_Binding \ -# logical_port=cr-outside | grep $gw1_chassis | wc -l], [0],[[1 -# ]]) -# -# If it were correct, then the following would be a good substitute: -# -# wait_row_count Port_Binding 1 logical_port=cr-outside chassis=$gw1_chassis - # Re add the ovs ports. for i in 1 2; do as hv$i @@ -13528,6 +13496,34 @@ for i in 1 2; do ofport-request=1 done +# Re-add gw2 +as gw2 ovn_attach n1 br-phys 192.168.0.1 + +OVS_WAIT_FOR_OUTPUT([as hv1 ovs-ofctl dump-flows br-int table=37 | \ +grep active_backup | grep members:$hv1_gw1_ofport,$hv1_gw2_ofport \ +| wc -l], [0], [1 +]) + +OVS_WAIT_FOR_OUTPUT([as hv2 ovs-ofctl dump-flows br-int table=37 | \ +grep active_backup | grep members:$hv2_gw1_ofport,$hv2_gw2_ofport \ +| wc -l], [0], [1 +]) + +# make sure that flows for handling the outside router port reside on gw1 +OVS_WAIT_FOR_OUTPUT([as gw1 ovs-ofctl dump-flows br-int table=33 | \ +grep "dl_dst=00:00:02:01:02:04" | wc -l], [0], [[1 +]]) +OVS_WAIT_FOR_OUTPUT([as gw2 ovs-ofctl dump-flows br-int table=33 | \ +grep "dl_dst:00:00:02:01:02:04" | wc -l], [0], [[0 +]]) + +# make sure ARP responder flows for outside router port reside on gw1 too +OVS_WAIT_UNTIL([test `as gw1 ovs-ofctl dump-flows br-int table=27 | \ +grep arp_tpa=192.168.0.101 | wc -l` -ge 1 ]) + +# check that the chassis redirect port has been claimed by the gw1 chassis +wait_row_count Port_Binding 1 logical_port=cr-outside chassis=$gw1_chassis + hv1_ch_uuid=$(fetch_column Chassis _uuid name=hv1) hv2_ch_uuid=$(fetch_column Chassis _uuid name=hv2) exp_ref_ch_list="$hv1_ch_uuid $hv2_ch_uuid" @@ -13536,29 +13532,18 @@ wait_column "$exp_ref_ch_list" HA_Chassis_Group ref_chassis # Increase the priority of gw2 ovn-nbctl --wait=sb ha-chassis-group-add-chassis hagrp1 gw2 40 -OVS_WAIT_UNTIL([as hv1 ovs-ofctl dump-flows br-int table=37 | \ -grep active_backup | grep slaves:$hv1_gw2_ofport,$hv1_gw1_ofport \ +OVS_WAIT_FOR_OUTPUT([as hv1 ovs-ofctl dump-flows br-int table=37 | \ +grep active_backup | grep members:$hv1_gw2_ofport,$hv1_gw1_ofport \ | wc -l], [0], [1 ]) -OVS_WAIT_UNTIL([as hv2 ovs-ofctl dump-flows br-int table=37 | \ -grep active_backup | grep slaves:$hv2_gw2_ofport,$hv2_gw1_ofport \ +OVS_WAIT_FOR_OUTPUT([as hv2 ovs-ofctl dump-flows br-int table=37 | \ +grep active_backup | grep members:$hv2_gw2_ofport,$hv2_gw1_ofport \ | wc -l], [0], [1 ]) # check that the chassis redirect port has been reclaimed by the gw2 chassis -# -# XXX actually it doesn't happen, the test has always been wrong here -# because the following just checks that "wc -l" succeeds (and it always -# does): -# -# OVS_WAIT_UNTIL([ovn-sbctl --columns chassis --bare find Port_Binding \ -# logical_port=cr-outside | grep $gw2_chassis | wc -l], [0],[[1 -# ]]) -# -# If it were correct, then the following would be a good substitute: -# -# wait_row_count Port_Binding 1 logical_port=cr-outside chassis=$gw2_chassis +wait_row_count Port_Binding 1 logical_port=cr-outside chassis=$gw2_chassis # check BFD enablement on tunnel ports from gw1 ######### as gw1 @@ -13597,11 +13582,11 @@ AT_CHECK([ovs-vsctl --bare --columns bfd find Interface name=ovn-hv1-0],[0], ]]) # make sure that flows for handling the outside router port reside on gw2 now -OVS_WAIT_UNTIL([as gw2 ovs-ofctl dump-flows br-int table=24 | \ -grep 00:00:02:01:02:04 | wc -l], [0], [[1 +OVS_WAIT_FOR_OUTPUT([as gw2 ovs-ofctl dump-flows br-int table=33 | \ +grep "dl_dst=00:00:02:01:02:04" | wc -l], [0], [[1 ]]) -OVS_WAIT_UNTIL([as gw1 ovs-ofctl dump-flows br-int table=24 | \ -grep 00:00:02:01:02:04 | wc -l], [0], [[0 +OVS_WAIT_FOR_OUTPUT([as gw1 ovs-ofctl dump-flows br-int table=33 | \ +grep "dl_dst=00:00:02:01:02:04" | wc -l], [0], [[0 ]]) # disconnect GW2 from the network, GW1 should take over @@ -13612,11 +13597,11 @@ as main ovs-vsctl del-port n1 $port bfd_dump # make sure that flows for handling the outside router port reside on gw2 now -OVS_WAIT_UNTIL([as gw1 ovs-ofctl dump-flows br-int table=24 | \ -grep 00:00:02:01:02:04 | wc -l], [0], [[1 +OVS_WAIT_FOR_OUTPUT([as gw1 ovs-ofctl dump-flows br-int table=33 | \ +grep "dl_dst=00:00:02:01:02:04" | wc -l], [0], [[1 ]]) -OVS_WAIT_UNTIL([as gw2 ovs-ofctl dump-flows br-int table=24 | \ -grep 00:00:02:01:02:04 | wc -l], [0], [[0 +OVS_WAIT_FOR_OUTPUT([as gw2 ovs-ofctl dump-flows br-int table=33 | \ +grep "dl_dst=00:00:02:01:02:04" | wc -l], [0], [[0 ]]) # check that the chassis redirect port has been reclaimed by the gw1 chassis