From patchwork Mon Jan 8 09:37:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1883585 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=eln48BL4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::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 4T7prz5M5Mz1xqk for ; Mon, 8 Jan 2024 20:38:11 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4C7A0821ED; Mon, 8 Jan 2024 09:38:08 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4C7A0821ED 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=eln48BL4 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 IQqBqnD9oV1b; Mon, 8 Jan 2024 09:38:07 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 7DA6A81E6C; Mon, 8 Jan 2024 09:38:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7DA6A81E6C Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4D07DC0077; Mon, 8 Jan 2024 09:38:06 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3E21EC0037 for ; Mon, 8 Jan 2024 09:38:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 1593540642 for ; Mon, 8 Jan 2024 09:38:05 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 1593540642 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=eln48BL4 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 8l68u-BeG0XM for ; Mon, 8 Jan 2024 09:38:04 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id EAF7740641 for ; Mon, 8 Jan 2024 09:38:03 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org EAF7740641 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704706682; 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=RdmHZytVK8HgTKL6K4oUOrsCobjcGsAhWYSmSnDJp74=; b=eln48BL4N+l4zOg0FQEoxJJXd+5UluWspVlWddv+FcTcbbRS5p7QTeQNPxonRPwW5EwZ8A LH0hlw6EwhsUUXYHTSU/vBJw/xv0tPSJs9kFQ5rsXMmVUf19iSHPPETu+LPFQcsJL6IlO3 lDA2cX2ckgcxVn8VUxROlLXDm5yQ6cQ= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-336-z13HEkelPKmOC8axuoiB2g-1; Mon, 08 Jan 2024 04:38:01 -0500 X-MC-Unique: z13HEkelPKmOC8axuoiB2g-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-40d85858181so16090775e9.1 for ; Mon, 08 Jan 2024 01:38:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704706680; x=1705311480; 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=RdmHZytVK8HgTKL6K4oUOrsCobjcGsAhWYSmSnDJp74=; b=I6UhJEHHhP/A8dchsAO9f1WBq7XtX5swMB+iG0sqUMIHUmTFaRFOldbG7KoPBAdCF6 uh7/BX1NpnS8P1PZaNWpS3nCL97I2ltKduzh4paE68taWW6F1Un0SNxtEDFyhna+D1Vy Y+Nf2lcTW+rSFJW90KdL5x0GKnMll3WQgMfEFOoUHKLOp9pvdBHyFzilG8aAB9JDh+ZI enHIgzyVoyaCGRsbhgzIesGs4DX9JJMyxurbcBtFEa072ar/V66vRYJ+unYI+nClodR2 aV0qlIVZLUc8r5coN3EtonsAWwS9By2lSNLsgvvu6b5C0i5pFgvh+Yblmm3rAXoMGgPy AP1g== X-Gm-Message-State: AOJu0YxlqRyo4rIxvOrACT3e4lyfOatBI9KDNDsZFuV4Y5khkCMflm99 M2oZcI63qFsRW+6z9rfKd0Abk/tr/uqebAfXcy0n15fnpvW0bXzI8MpO12xSrr/jZEmLWihEF1G q7YZhng4jt921MFtEOc9aYTKhKLZzbOA/JHMwlH+0SMe7ZcwVX88xqUQjqjJi6dTa7XAYP/GJVU LY4pVDfkj+U/CllMB4/gvo X-Received: by 2002:a05:600c:538f:b0:40e:4049:1c1f with SMTP id hg15-20020a05600c538f00b0040e40491c1fmr1551364wmb.1.1704706680125; Mon, 08 Jan 2024 01:38:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0mKAglxyXZF5EkGKwiV1EPqA0o3ZCcwHN5UJdwJzihR4xyyk5973yRRQwQNwQtmm+p2Yz0w== X-Received: by 2002:a05:600c:538f:b0:40e:4049:1c1f with SMTP id hg15-20020a05600c538f00b0040e40491c1fmr1551352wmb.1.1704706679715; Mon, 08 Jan 2024 01:37:59 -0800 (PST) Received: from localhost (net-93-71-3-198.cust.vodafonedsl.it. [93.71.3.198]) by smtp.gmail.com with ESMTPSA id l15-20020a5d410f000000b00336e43e8e57sm7277596wrp.58.2024.01.08.01.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 01:37:59 -0800 (PST) From: Lorenzo Bianconi To: ovs-dev@openvswitch.org Date: Mon, 8 Jan 2024 10:37:52 +0100 Message-ID: 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 v3 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 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/tests/ovn.at b/tests/ovn.at index 5615ba1a9..6093e0ed9 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -37524,3 +37524,68 @@ wait_for_ports_up OVN_CLEANUP([hv1]) AT_CLEANUP ]) + +OVN_FOR_EACH_NORTHD([ +AT_SETUP([gratuitous arp max timeout]) +AT_KEYWORDS([slowtest]) +TAG_UNSTABLE +AT_SKIP_IF([test $HAVE_TCPDUMP = no]) +AT_SKIP_IF([test $HAVE_SCAPY = 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 + +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 12s to get a garp every ~ 2s +sleep 12 + +n_arp=$(tcpdump -ner hv1/snoopvif-tx.pcap arp | wc -l) +AT_CHECK([test $n_arp -ge 5 -a $n_arp -lt 10]) + +# 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]) +AT_CHECK([ovn-nbctl set logical_router lr0 options:chassis=hv1]) + +# sleep for 7s to get a garp every ~ 1s +sleep 7 + +n_arp=$(tcpdump -ner hv1/snoopvif-tx.pcap arp | wc -l) +AT_CHECK([test $n_arp -ge 5 -a $n_arp -lt 10]) + +OVN_CLEANUP([hv1]) + +AT_CLEANUP +])