From patchwork Fri Dec 22 15:47:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1879714 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=JGwahgZq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4SxWrz59SFz1ydZ for ; Sat, 23 Dec 2023 02:47:31 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B350042D29; Fri, 22 Dec 2023 15:47:29 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B350042D29 Authentication-Results: smtp4.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=JGwahgZq 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 e_a61YJqTG1I; Fri, 22 Dec 2023 15:47:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id B186342C6D; Fri, 22 Dec 2023 15:47:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B186342C6D Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8AA7CC0077; Fri, 22 Dec 2023 15:47:27 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 03739C0037 for ; Fri, 22 Dec 2023 15:47:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D1087403FB for ; Fri, 22 Dec 2023 15:47:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D1087403FB Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JGwahgZq 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 KLNL--r4W9Kh for ; Fri, 22 Dec 2023 15:47:24 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 9F72A40359 for ; Fri, 22 Dec 2023 15:47:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 9F72A40359 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703260043; 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; bh=5XRiT/47dGznj2lq9NIuHQ85MHt7TMUq3CQ4Y49bUpM=; b=JGwahgZqZhBqkTa/83xNkU1B9FqfGvYWLuX1EycFHG8YBHfT7sDTmpBxvZWV9vR50cYx/N FSbLHqxnrSDd00aLvr8JZgL4OY5Qp2M6eOa9nMNbMto+JShq/SRWMsY20D2tc5y5RfWrJq OuGWC3UDnQpjDOPtSxNV0PEivTZDn3U= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-617-yfKqaH_aOUaV5QJiAuDf1Q-1; Fri, 22 Dec 2023 10:47:21 -0500 X-MC-Unique: yfKqaH_aOUaV5QJiAuDf1Q-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-33688aa4316so966930f8f.2 for ; Fri, 22 Dec 2023 07:47:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703260040; x=1703864840; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5XRiT/47dGznj2lq9NIuHQ85MHt7TMUq3CQ4Y49bUpM=; b=AuZPb8M9DLmjG+0iG1KkZiGg21uVLhncMGkVzJDaExd6/mUdSDwCBTYiT22NL0AHOY 8MIpmRJtmYFvpLimRY2fxUf/NKA/AItxgQ5uNiqgy0F27V32HWEyNcr2f++kSax2ezVz vifFp7LKqV+aNighQygzgxIfkEbP8GfOpr6fpJUlWHvwsvp0gNDm5WmzYJoh/NRR3fz3 f7Ux6bqfQkSxgdK3OIj7Pw812J2qQbBj6CAuHhu4Wm6D9CG9W3HA/itIYX27Wq37XIeO UhzRRP+3Vujx6iWO9QdvO3Jq6HR5+RctHHvWfjQgmIBiu0Y2h40VbBaZyig9+PtZhqpF cW+Q== X-Gm-Message-State: AOJu0YxT1AxZajKQKuUX7PP8Mqq7ScYM0l4WnwbaZbOLw7ZnFAQz9Idx j+u0bd+S2VfjF8T7p2CCXyL+MGn2Q5fmbJx6JwcmOH/30Gis0BfTXBEWRFcsjEWUIH3zjBXOd8q gSCdK/vx4rFLul9XMNctIdXGbpEUUtrQdyjtrIp6Px21jEvKk0Yn288TgMAD/XM/Qr0m9uzKspQ rI7HcV/28SuAWVlFEXIgjL X-Received: by 2002:a05:6000:1c9:b0:336:7e39:a9c7 with SMTP id t9-20020a05600001c900b003367e39a9c7mr925883wrx.141.1703260040211; Fri, 22 Dec 2023 07:47:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IESHQoMAUFqMM7qxdz5UsjtdmxXs1kZ9L9qvbSd7amWTiXeWt2p1f93w4YIB6To5Ce86n9Umw== X-Received: by 2002:a05:6000:1c9:b0:336:7e39:a9c7 with SMTP id t9-20020a05600001c900b003367e39a9c7mr925871wrx.141.1703260039797; Fri, 22 Dec 2023 07:47:19 -0800 (PST) Received: from localhost (net-93-71-3-198.cust.vodafonedsl.it. [93.71.3.198]) by smtp.gmail.com with ESMTPSA id c14-20020adffb4e000000b0033687f3b9b5sm3975933wrs.93.2023.12.22.07.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 07:47:19 -0800 (PST) From: Lorenzo Bianconi To: ovs-dev@openvswitch.org Date: Fri, 22 Dec 2023 16:47:16 +0100 Message-ID: <2b8e2a1b2cb85365beda458a4c8c128866f1ac5b.1703259986.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: dceara@redhat.com Subject: [ovs-dev] [PATCH v2 ovn] test: add dedicated test for garp-max-timeout 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" Introduce a dedicated test for garp-max-timeout knob Signed-off-by: Lorenzo Bianconi --- tests/ovn.at | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/tests/ovn.at b/tests/ovn.at index 918f97a9e..deeb2a201 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -37464,3 +37464,72 @@ wait_for_ports_up OVN_CLEANUP([hv1]) AT_CLEANUP ]) + +OVN_FOR_EACH_NORTHD([ +AT_SETUP([gratuitous arp max timeout]) +AT_KEYWORDS([garp-timeout]) +TAG_UNSTABLE +AT_SKIP_IF([test $HAVE_TCPDUMP = no]) +ovn_start + +check ovn-nbctl ls-add ls0 +check ovn-nbctl lr-add lr0 +check ovn-nbctl lrp-add lr0 lr0-ls0 f0:00:00:00:00:01 192.168.0.1/24 +check ovn-nbctl lsp-add ls0 ls0-lr0 -- set Logical_Switch_Port ls0-lr0 \ + type=router options:router-port=lr0-ls0 addresses='"f0:00:00:00:00:01"' + +check ovn-nbctl lsp-add ls0 ln_port +check ovn-nbctl lsp-set-addresses ln_port unknown +check ovn-nbctl lsp-set-type ln_port localnet +check ovn-nbctl --wait=hv lsp-set-options ln_port network_name=physnet1 + +# Prepare packets +echo $(fmt_pkt "Ether(dst='ff:ff:ff:ff:ff:ff', src='f0:00:00:00:00:01')/ \ + ARP(op=2, hwsrc='f0:00:00:00:00:01', hwdst='00:00:00:00:00:00', psrc='192.168.0.1', pdst='192.168.0.1')") > arp_expected + +net_add n1 +sim_add hv1 +as hv1 +check ovs-vsctl \ + -- add-br br-phys \ + -- add-br br-eth0 + +ovn_attach n1 br-phys 192.168.0.10 + +AT_CHECK([ovs-vsctl set Open_vSwitch . external-ids:ovn-bridge-mappings=physnet1:br-eth0]) +AT_CHECK([ovs-vsctl add-port br-eth0 snoopvif -- set Interface snoopvif options:tx_pcap=hv1/snoopvif-tx.pcap options:rxq_pcap=hv1/snoopvif-rx.pcap]) + +# set garp max timeout to 2s +AT_CHECK([as hv1 ovs-vsctl set Open_vSwitch . external-ids:garp-max-timeout-sec=2]) + +# Wait until the patch ports are created in hv1 to connect br-int to br-eth0 +AT_CHECK([ovn-nbctl set logical_router lr0 options:chassis=hv1]) +OVN_WAIT_PATCH_PORT_FLOWS(["ln_port"], ["hv1"]) + +# sleep for 20s to get a garp every ~ 2s +sleep 22 + +n_arp=$(tcpdump -ner hv1/snoopvif-tx.pcap arp | wc -l) +AT_CHECK([test $n_arp -ge 10 -a $n_arp -lt 15]) + +# Temporarily remove lr0 chassis +# Wait for hv confirmation to make sure chassis is removed before we reset pcap +# Otherwise a garp might be sent after pcap have been reset but before chassis is removed +AT_CHECK([ovn-nbctl --wait=hv remove logical_router lr0 options chassis]) + +as hv1 reset_pcap_file snoopvif hv1/snoopvif +# set garp max timeout to 1s +AT_CHECK([as hv1 ovs-vsctl set Open_vSwitch . external-ids:garp-max-timeout-sec=1]) +hv1_uuid=$(ovn-sbctl --bare --columns _uuid list chassis hv1) +AT_CHECK([ovn-nbctl set logical_router lr0 options:chassis=hv1]) + +# sleep for 12s to get a garp every ~ 1s +sleep 12 + +n_arp=$(tcpdump -ner hv1/snoopvif-tx.pcap arp | wc -l) +AT_CHECK([test $n_arp -ge 10 -a $n_arp -lt 15]) + +OVN_CLEANUP([hv1]) + +AT_CLEANUP +])