From patchwork Mon Sep 18 16:47:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1836336 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=DIt3K2av; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rq9hh475yz1ypc for ; Tue, 19 Sep 2023 02:48:04 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 20EFA41692; Mon, 18 Sep 2023 16:48:02 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 20EFA41692 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=DIt3K2av 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 4SJkablFoYd3; Mon, 18 Sep 2023 16:48:00 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id EE64041767; Mon, 18 Sep 2023 16:47:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org EE64041767 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 84CDDC0DE2; Mon, 18 Sep 2023 16:47:50 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2586BC0DDF for ; Mon, 18 Sep 2023 16:47:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 374B241A2A for ; Mon, 18 Sep 2023 16:47:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 374B241A2A 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=DIt3K2av 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 vt0Ri-rZ1aoY for ; Mon, 18 Sep 2023 16:47:19 +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 18EF041B08 for ; Mon, 18 Sep 2023 16:47:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 18EF041B08 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695055637; 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=4LXToguijVp+hD7xshzCXASECwYfk2/Tp6DYKeAQ73A=; b=DIt3K2avHDJuoBIB4/LL4pbcYz+PmCpt+18g/+uZDNNdsW7+i8fIvS8ACqD9FmUG6KbaFe UYkv3RY6fp8traZ5HHZoeh86FMmp7gaAg4XiekySLVcOI5P5IgqhGpUz3hujv2Z9xD2eax 1FJJYpVFDKAlF4yzIJw+wdQZdHH4qEg= 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-lxcK6T1gN9WpoFzVBRqh6g-1; Mon, 18 Sep 2023 12:47:16 -0400 X-MC-Unique: lxcK6T1gN9WpoFzVBRqh6g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 91518811E7B for ; Mon, 18 Sep 2023 16:47:15 +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 7903EC15BB8; Mon, 18 Sep 2023 16:47:15 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Mon, 18 Sep 2023 18:47:09 +0200 Message-Id: <20230918164714.3144984-11-xsimonar@redhat.com> In-Reply-To: <20230918164714.3144984-1-xsimonar@redhat.com> References: <20230918164714.3144984-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 10/15] tests: move trim_zeros() to ovn-macros 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" trim_zeros was redefined multiple times in ovn.at, and was undefined for one test. Signed-off-by: Xavier Simonart --- tests/ovn-macros.at | 4 ++++ tests/ovn.at | 53 --------------------------------------------- 2 files changed, 4 insertions(+), 53 deletions(-) diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at index 7c0abdece..400469c88 100644 --- a/tests/ovn-macros.at +++ b/tests/ovn-macros.at @@ -882,6 +882,10 @@ wake_up_ovsdb() { AT_CHECK([kill -CONT $(cat $1/ovsdb-server.pid)]) } +trim_zeros() { + sed 's/\(00\)\{1,\}$//' +} + OVS_END_SHELL_HELPERS m4_define([OVN_POPULATE_ARP], [AT_CHECK(ovn_populate_arp__, [0], [ignore])]) diff --git a/tests/ovn.at b/tests/ovn.at index 31e41c012..8ebf55580 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -7326,10 +7326,6 @@ check ovn-nbctl --wait=hv sync # Start with 0 because the first request will not have NXT_RESUME n_resume=0 -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} - # This shell function sends a DHCPv6 request packet # test_dhcpv6 INPORT SRC_MAC SRC_LLA DHCPv6_MSG_TYPE OFFER_IP OUTPORT... # The OUTPORTs (zero or more) list the VIFs on which the original DHCPv6 @@ -9049,10 +9045,6 @@ packet=${dst_mac}${src_mac}08004500001c0000000040110000${src_ip}${dst_ip}0035111 # Send IP packet destined to 8.8.8.8 from lsp1lp2 as hv1 ovs-appctl netdev-dummy/receive hv1-ls1lp2 $packet -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} - # ARP packet should be received with Target IP Address set to 192.168.1.254 and # not 8.8.8.8 @@ -9108,9 +9100,6 @@ AT_CAPTURE_FILE([sbflows]) # Wait for packet to be received. OVS_WAIT_UNTIL([test `wc -c < "hv1/snoopvif-tx.pcap"` -ge 140]) -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros |sort | uniq > packets AT_CHECK([sort packets], [0], [dnl fffffffffffff0000000000108060001080006040001f00000000001c0a80001000000000000c0a80001 @@ -9307,9 +9296,6 @@ ovn-nbctl list logical_router_port lrp0 ovn-nbctl show # Wait for packet to be received. OVS_WAIT_UNTIL([test `wc -c < "hv1/snoopvif-tx.pcap"` -ge 50]) -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | sort | uniq > packets expected="fffffffffffff0000000000108060001080006040001f00000000001c0a80001000000000000c0a80001" echo $expected > expout @@ -9330,9 +9316,6 @@ ovn-nbctl lsp-set-options lrp0-rp router-port=lrp0 nat-addresses="router" exclud # Wait for packets to be received. OVS_WAIT_UNTIL([test `wc -c < "hv1/snoopvif-tx.pcap"` -ge 250]) -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros > packets g0="fffffffffffff0000000000108060001080006040001f00000000001c0a80001000000000000c0a80001" @@ -10751,10 +10734,6 @@ OVN_POPULATE_ARP wait_for_ports_up check ovn-nbctl --wait=hv sync -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} - # Send ip packets between foo1 and bar1 # (East-west traffic should flow normally) src_mac="f00000010203" @@ -12187,9 +12166,6 @@ OVN_WAIT_PATCH_PORT_FLOWS(["ln_port"], ["hv2"]) # Wait for packets to be received. OVS_WAIT_UNTIL([test `wc -c < "hv1/snoopvif-tx.pcap"` -ge 100]) -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros > packets expected="fffffffffffff0000000000108060001080006040001f00000000001c0a80001000000000000c0a80001" echo $expected > expout @@ -12221,10 +12197,6 @@ OVN_WAIT_PATCH_PORT_FLOWS(["ln_port"], ["hv3"]) # Re-add nat-addresses option ovn-nbctl lsp-set-options lrp0-rp router-port=lrp0 nat-addresses="router" -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} - garp_1="fffffffffffff0000000000308060001080006040001f00000000003c0a80003000000000000c0a80003" echo $garp_1 > expected_out garp_2="fffffffffffff0000000000408060001080006040001f00000000004c0a80004000000000000c0a80004" @@ -13835,10 +13807,6 @@ as hv1 reset_pcap_file snoopvif hv1/snoopvif # add nat-addresses option ovn-nbctl --wait=hv lsp-set-options lrp0-rp router-port=lrp0 nat-addresses="router" -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} - only_broadcast_from_lrp1() { grep "fffffffffffff00000000001" } @@ -13869,10 +13837,6 @@ ovn-nbctl --wait=hv \ as hv3 reset_pcap_file br-phys_n1 hv3/br-phys_n1 as hv1 reset_pcap_file snoopvif hv1/snoopvif -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} - OVN_CHECK_PACKETS_CONTAIN([hv1/snoopvif-tx.pcap], [expected_out], "trim_zeros") OVN_CHECK_PACKETS_CONTAIN([hv3/br-phys_n1-tx.pcap], [expected_out], "trim_zeros") $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv2/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv2_br_phys_tx @@ -13907,10 +13871,6 @@ ovn-nbctl --wait=hv lsp-set-options lrp0-rp router-port=lrp0 nat-addresses="rout OVS_WAIT_UNTIL([test 1 = `ovn-sbctl --bare --columns nat_addresses find port_binding \ logical_port=lrp0-rp | grep is_chassis | wc -l`]) -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} - garp="fffffffffffff00000000001810007de08060001080006040001f00000000001c0a80064000000000000c0a80064" echo $garp > expected_out @@ -14256,10 +14216,6 @@ wc -l], [0], [4 chassis_uuid=$(fetch_column Chassis _uuid name=hv1) wait_row_count Port_Binding 1 logical_port=cr-ip6_public chassis=$chassis_uuid -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} - # Test the IPv6 Neighbor Solicitation (NS) - nd_ns action for unknown MAC # addresses. ovn-controller should generate an IPv6 NS request for IPv6 # packets whose MAC is unknown (in the ARP_REQUEST router pipeline stage. @@ -19729,11 +19685,6 @@ test_dhcp() { as hv1 ovs-appctl netdev-dummy/receive hv${inport}-ext${inport} $request } - -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} - # This shell function sends a DHCPv6 request packet # test_dhcpv6 INPORT SRC_MAC SRC_LLA DHCPv6_MSG_TYPE OFFER_IP OUTPORT... # The OUTPORTs (zero or more) list the VIFs on which the original DHCPv6 @@ -31365,10 +31316,6 @@ send_icmp_packet() { as hv$hv ovs-appctl netdev-dummy/receive hv$hv-vif$inport $packet } -trim_zeros() { - sed 's/\(00\)\{1,\}$//' -} - AS_BOX([Wait for all ports to be up]) wait_for_ports_up