From patchwork Mon Apr 26 09:34:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1470229 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: 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=Cs7g4WsH; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FTKVt67N0z9t0Y for ; Mon, 26 Apr 2021 19:35:02 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 55E8460811; Mon, 26 Apr 2021 09:35:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8HdTJE7CsQK1; Mon, 26 Apr 2021 09:34:59 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTP id 62EA4605E3; Mon, 26 Apr 2021 09:34:58 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1E596C000F; Mon, 26 Apr 2021 09:34:58 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5F7A8C000B for ; Mon, 26 Apr 2021 09:34:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 410D66067A for ; Mon, 26 Apr 2021 09:34:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S2bTYZ0xV1HW for ; Mon, 26 Apr 2021 09:34:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 3E2CF605E3 for ; Mon, 26 Apr 2021 09:34:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619429694; 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=iMa80BA1DVdUbAChlx97PPRYvNRiETFzRStdl1bRZP4=; b=Cs7g4WsHCSV/ReAPbjjyAR16c8EQ+HytRJeyKiqAM9lwWWuqFNKoR6wDHZeldV70RyGlu9 9RrOyM+BjcvAoSSy9SQ+FxlTLaDH4BBazQU+4SCdGLkdXKi1r4qtbqaXh56mLBEmTBbl8J 1x58/CcXN6gSAX5PWq27i/HpuwiGZ2Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-390-o5kmBhJTO0SdxBTOs47CwA-1; Mon, 26 Apr 2021 05:34:52 -0400 X-MC-Unique: o5kmBhJTO0SdxBTOs47CwA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 43032343A5 for ; Mon, 26 Apr 2021 09:34:51 +0000 (UTC) Received: from dceara.remote.csb (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D6CA1972B for ; Mon, 26 Apr 2021 09:34:50 +0000 (UTC) From: Dumitru Ceara To: ovs-dev@openvswitch.org Date: Mon, 26 Apr 2021 11:34:47 +0200 Message-Id: <20210426093447.30825-1-dceara@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dceara@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] tests: Improve test "IGMP snoop/querier/relay". 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" Commit b38e10f4b1bf ("tests: Miscellaneous improvements.") improved the "MLD snoop/querier/relay" test case making it less likely to fail due to test issues. Apply the same fixes to the "IGMP snoop/querier/relay" test case. Reported-at: https://bugzilla.redhat.com/1941067 Fixes: 605535f9adf2 ("OVN: Add ovn-northd IGMP support") Signed-off-by: Dumitru Ceara --- tests/ovn.at | 76 +++++++++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 33 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index 3d0a7f63f..9f38ec6ec 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -17923,6 +17923,27 @@ check ovs-vsctl -- add-port br-int hv2-vif4 -- \ ofport-request=1 ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys:br-phys +AT_CAPTURE_FILE([exp]) +AT_CAPTURE_FILE([rcv]) +check_packets() { + > exp + > rcv + if test "$1" = --uniq; then + sort="sort -u"; shift + else + sort=sort + fi + for tuple in "$@"; do + set $tuple; pcap=$1 type=$2 + echo "--- $pcap" | tee -a exp >> rcv + $sort "$type" >> exp + $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $pcap | $sort >> rcv + echo | tee -a exp >> rcv + done + + $at_diff exp rcv >/dev/null +} + OVN_POPULATE_ARP # Enable IGMP snooping on sw1. @@ -17939,21 +17960,16 @@ ovn-sbctl dump-flows > sbflows AT_CAPTURE_FILE([expected]) AT_CAPTURE_FILE([received]) > expected -> received -for i in 1 2; do - for j in 1 2; do - pcap=hv$i/vif$j-tx.pcap - echo "--- $pcap" | tee -a expected >> received - $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $pcap | sort >> received - echo | tee -a expected >> received - done -done -check $at_diff -F'^---' expected received +OVS_WAIT_UNTIL( + [check_packets 'hv1/vif1-tx.pcap expected' \ + 'hv1/vif2-tx.pcap expected' \ + 'hv2/vif1-tx.pcap expected' \ + 'hv2/vif2-tx.pcap expected'], + [$at_diff -F'^---' exp rcv]) check ovn-nbctl --wait=hv sync AT_CAPTURE_FILE([sbflows2]) -cp ovn-sb/ovn-sb.db ovn-sb2.db ovn-sbctl dump-flows > sbflows2 # Inject IGMP Join for 239.0.1.68 on sw1-p11. @@ -17971,7 +17987,6 @@ wait_row_count IGMP_Group 2 address=239.0.1.68 check ovn-nbctl --wait=hv sync AT_CAPTURE_FILE([sbflows3]) -cp ovn-sb/ovn-sb.db ovn-sb3.db ovn-sbctl dump-flows > sbflows3 AS_BOX([IGMP traffic test 1]) @@ -17988,22 +18003,6 @@ store_ip_multicast_pkt \ $(ip_to_hex 10 0 0 42) $(ip_to_hex 239 0 1 68) 1e 20 ca70 11 \ e518e518000a3b3a0000 expected -AT_CAPTURE_FILE([exp]) -AT_CAPTURE_FILE([rcv]) -check_packets() { - > exp - > rcv - for tuple in "$@"; do - set $tuple; pcap=$1 type=$2 - echo "--- $pcap" | tee -a exp >> rcv - sort "$type" >> exp - $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $pcap | sort >> rcv - echo | tee -a exp >> rcv - done - - $at_diff exp rcv >/dev/null -} - OVS_WAIT_UNTIL( [check_packets 'hv1/vif1-tx.pcap expected' \ 'hv2/vif1-tx.pcap expected' \ @@ -18094,15 +18093,26 @@ check ovn-nbctl set Logical_Switch sw2 \ other_config:mcast_ip4_src="20.0.0.254" AS_BOX([IGMP traffic test 4]) -# Wait for 1 query interval (1 sec) and check that two queries are generated. +# Check that multiple queries are generated over time. > expected store_igmp_v3_query 0000000002fe $(ip_to_hex 20 0 0 254) 84dd expected store_igmp_v3_query 0000000002fe $(ip_to_hex 20 0 0 254) 84dd expected -OVS_WAIT_UNTIL( - [check_packets 'hv1/vif3-tx.pcap expected' \ - 'hv2/vif3-tx.pcap expected'], - [$at_diff -F'^---' exp rcv]) +for count in 1 2 3; do + as hv1 reset_pcap_file hv1-vif1 hv1/vif1 + as hv1 reset_pcap_file hv1-vif2 hv1/vif2 + as hv1 reset_pcap_file hv1-vif3 hv1/vif3 + as hv1 reset_pcap_file hv1-vif4 hv1/vif4 + as hv2 reset_pcap_file hv2-vif1 hv2/vif1 + as hv2 reset_pcap_file hv2-vif2 hv2/vif2 + as hv2 reset_pcap_file hv2-vif3 hv2/vif3 + as hv2 reset_pcap_file hv2-vif4 hv2/vif4 + OVS_WAIT_UNTIL( + [check_packets --uniq \ + 'hv1/vif3-tx.pcap expected' \ + 'hv2/vif3-tx.pcap expected'], + [$at_diff -F'^---' exp rcv]) +done # Disable IGMP querier on sw2. check ovn-nbctl set Logical_Switch sw2 \