From patchwork Tue Oct 27 18:59:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861453 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB08DC4363A for ; Tue, 27 Oct 2020 19:00:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A4D5208B8 for ; Tue, 27 Oct 2020 19:00:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="yAQv4R8r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1817099AbgJ0TAx (ORCPT ); Tue, 27 Oct 2020 15:00:53 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:41551 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371355AbgJ0TAI (ORCPT ); Tue, 27 Oct 2020 15:00:08 -0400 Received: by mail-wr1-f68.google.com with SMTP id s9so3112875wro.8 for ; Tue, 27 Oct 2020 12:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qug/l2PaHPdn5nmmo5MAN4jJnMHDysyaTDj3MD0cWk8=; b=yAQv4R8rgsLyHmAPm5o97IiojoAcx5+7ufwQVOSCinvt1RK0kxjCmtYzdoTwaAxiou H6764HMhlANaqp75yBugcbRLxBenWlYjL1RNs/AsO3qN6EG2Gnqi4Jh4ZRD+RhtCFIe3 m7WKVivxJCNzzQkJkhyQqAnbbjUHQgmf9KyG+lIcXEjB6Qh+6uUZMHNiUX82WdN1oQRB Bl37O8AaW0AjdVaylhO0oyAylaFTbNwLNhz6BGZVQA92XSxulTg/eQTyCoXxSC/uLQZ2 aFtorS94NL2uFpOTsjL6rSA15nxmKDWko6YzsdR3uE10HG+zWjn4a3gg3Dnky701E9Fh cuMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qug/l2PaHPdn5nmmo5MAN4jJnMHDysyaTDj3MD0cWk8=; b=QGAaWuThkqDQEOsztE4bs7yEgr62tzrOdVUTMicZH57sVmd+5q3CIcDBCdTOA59Amk 2yNMjbpN/Fn1AZrVGX63mZpJzF9JJtaYD8QQynQY4zUKPfn25bZHKrcfiIgPcKX+rVi9 QHl2StDrey6AJux0CnuLhOKEeBUvLvdpUP1F7szOMzjuYsxw0JLdKp6PI9ARSGcuaIET zkbZnaPs6MAfZgvjJbAtYjWEYXG1j+SbO3XfX+vfwBDOCp8TgYvhLRiC7VcEDn8ise63 ivauD60uusCoYezovWE69hIUyS2f/iEXnUUbNmgViQ1MfWSfBDh6lVaEKny/e6uowDHw dWEA== X-Gm-Message-State: AOAM532UR3/Yo/6s17rDXIwfLnFKoyx53xUm7xYgAFSG8zeM2idYJVrs ETMcfDG++XQ5UIQdgCZBjQwZn9OIvMxMqH/G X-Google-Smtp-Source: ABdhPJw3dbU05kDu9XZ1JYoYS3bQsbXcEpPRJ+5nT0Cj2GCgiJCFERh1UrhYdAvjEY2KTjzvS651kQ== X-Received: by 2002:adf:c3c6:: with SMTP id d6mr4586243wrg.206.1603825206322; Tue, 27 Oct 2020 12:00:06 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:05 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 01/16] selftests: net: bridge: rename current igmp tests to igmpv2 Date: Tue, 27 Oct 2020 20:59:19 +0200 Message-Id: <20201027185934.227040-2-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov To prepare the bridge_igmp.sh for IGMPv3 we need to rename the current test to IGMPv2. Signed-off-by: Nikolay Aleksandrov --- tools/testing/selftests/net/forwarding/bridge_igmp.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 88d2472ba151..481198300b72 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -1,7 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 -ALL_TESTS="reportleave_test" +ALL_TESTS="v2reportleave_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -110,7 +110,7 @@ mcast_packet_test() return $seen } -reportleave_test() +v2reportleave_test() { RET=0 ip address add dev $h2 $TEST_GROUP/32 autojoin @@ -118,12 +118,12 @@ reportleave_test() sleep 5 bridge mdb show dev br0 | grep $TEST_GROUP 1>/dev/null - check_err $? "Report didn't create mdb entry for $TEST_GROUP" + check_err $? "IGMPv2 report didn't create mdb entry for $TEST_GROUP" mcast_packet_test $TEST_GROUP_MAC $TEST_GROUP $h1 $h2 check_fail $? "Traffic to $TEST_GROUP wasn't forwarded" - log_test "IGMP report $TEST_GROUP" + log_test "IGMPv2 report $TEST_GROUP" RET=0 bridge mdb show dev br0 | grep $TEST_GROUP 1>/dev/null @@ -139,7 +139,7 @@ reportleave_test() mcast_packet_test $TEST_GROUP_MAC $TEST_GROUP $h1 $h2 check_err $? "Traffic to $TEST_GROUP was forwarded without mdb entry" - log_test "IGMP leave $TEST_GROUP" + log_test "IGMPv2 leave $TEST_GROUP" } trap cleanup EXIT From patchwork Tue Oct 27 18:59:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861455 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C9B0C4363A for ; Tue, 27 Oct 2020 19:01:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E95B021D24 for ; Tue, 27 Oct 2020 19:01:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="Pbbgzu7U" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829212AbgJ0TBE (ORCPT ); Tue, 27 Oct 2020 15:01:04 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:45061 "EHLO mail-wr1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371356AbgJ0TAK (ORCPT ); Tue, 27 Oct 2020 15:00:10 -0400 Received: by mail-wr1-f53.google.com with SMTP id e17so3085440wru.12 for ; Tue, 27 Oct 2020 12:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tLPWNUeiDX6YqJv0P1s9lGNPu+RgfZ8zS9WrTNhZtwU=; b=Pbbgzu7Uim9URoVPsODKBzIRpIWNZUV/sc1OsVCs/ctmhcIQJuqP1Da07kJ2ti9/rK zwadkwjLlxDK6vSMPMNy7hOKGF9z/TVWXc++pM9nsU6I2AuCe/CIsrnng25YCjNkjb4f nyOsGMfA8wywQAx2ipPq2e+Cm42KAUKXLliz5jwbRyp1GGAZtlPV0gPBOKSl6pt+XRkh jhlsFvNWPtpOonDa/1z7uV3cBIFFMK7HjMxd29Pc6KJwjY0diRy6Y9jWj3DpTW9TVLii jpwVVOEsvNW0ITz2hhefUMxxEdpP8Qt870u1sEdMawZhO0x30jL4RKpm3No+NrtAJE0S WLTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tLPWNUeiDX6YqJv0P1s9lGNPu+RgfZ8zS9WrTNhZtwU=; b=F5NKwBvaYg5eMtIoSMmyBb0GblSMJKsJEIYMMIYsHHGyfXE+KU7ymyTqQoA6qSGz2c hL6HIjvCSzUodmkFKkWIicDnI5Xl60CXBfzDeGtNIL8FIiTo4B5xFQIDcsX+n2zjmDfC mzo3srsIQPu1P1BfKi+/mvbpay2Pr6FNbSVlljLKVjotKcIVj58pPvGvaaW0ZJFB9mAU OvfSlwgizTn4qR6fJAY5p0MMpET6dWwNxYMujNc7hriITYvlmnryQd/BR8OOLAxo9w5I xEQJ5you028sgsnBfkwgmLKOqp7DsC8ENUYyyZEtS2j4n8bypTBS2lNCvvS1GQXByKFX 5eZQ== X-Gm-Message-State: AOAM530hqO1OfUcYszSUJvU16o7MOnmD8rETUCALvtRFnuXtJGejDzsJ SpBlQV9RZ9DWGX9hm2Y/Fv5sCf02/6P0Gov6 X-Google-Smtp-Source: ABdhPJzG/OSgYLmz2HBNiIC8mB9c1vzZDllDh54O3gAqpvWndh4V2M5gurPd/JiO/Om2Nd0bKkjvbA== X-Received: by 2002:adf:94e6:: with SMTP id 93mr4299190wrr.190.1603825207449; Tue, 27 Oct 2020 12:00:07 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:07 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 02/16] selftests: net: bridge: igmp: add support for packet source address Date: Tue, 27 Oct 2020 20:59:20 +0200 Message-Id: <20201027185934.227040-3-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov Add support for one more argument which specifies the source address to use. It will be later used for IGMPv3 S,G entry testing. Signed-off-by: Nikolay Aleksandrov --- .../testing/selftests/net/forwarding/bridge_igmp.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 481198300b72..1c19459dbc58 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -83,9 +83,10 @@ cleanup() mcast_packet_test() { local mac=$1 - local ip=$2 - local host1_if=$3 - local host2_if=$4 + local src_ip=$2 + local ip=$3 + local host1_if=$4 + local host2_if=$5 local seen=0 # Add an ACL on `host2_if` which will tell us whether the packet @@ -94,7 +95,7 @@ mcast_packet_test() tc filter add dev $host2_if ingress protocol ip pref 1 handle 101 \ flower dst_mac $mac action drop - $MZ $host1_if -c 1 -p 64 -b $mac -B $ip -t udp "dp=4096,sp=2048" -q + $MZ $host1_if -c 1 -p 64 -b $mac -A $src_ip -B $ip -t udp "dp=4096,sp=2048" -q sleep 1 tc -j -s filter show dev $host2_if ingress \ @@ -120,7 +121,7 @@ v2reportleave_test() bridge mdb show dev br0 | grep $TEST_GROUP 1>/dev/null check_err $? "IGMPv2 report didn't create mdb entry for $TEST_GROUP" - mcast_packet_test $TEST_GROUP_MAC $TEST_GROUP $h1 $h2 + mcast_packet_test $TEST_GROUP_MAC 192.0.2.1 $TEST_GROUP $h1 $h2 check_fail $? "Traffic to $TEST_GROUP wasn't forwarded" log_test "IGMPv2 report $TEST_GROUP" @@ -136,7 +137,7 @@ v2reportleave_test() bridge mdb show dev br0 | grep $TEST_GROUP 1>/dev/null check_fail $? "Leave didn't delete mdb entry for $TEST_GROUP" - mcast_packet_test $TEST_GROUP_MAC $TEST_GROUP $h1 $h2 + mcast_packet_test $TEST_GROUP_MAC 192.0.2.1 $TEST_GROUP $h1 $h2 check_err $? "Traffic to $TEST_GROUP was forwarded without mdb entry" log_test "IGMPv2 leave $TEST_GROUP" From patchwork Tue Oct 27 18:59:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861459 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E760BC4363A for ; Tue, 27 Oct 2020 19:01:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A63F820878 for ; Tue, 27 Oct 2020 19:01:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="P4jRtSiv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829206AbgJ0TBA (ORCPT ); Tue, 27 Oct 2020 15:01:00 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41556 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371357AbgJ0TAM (ORCPT ); Tue, 27 Oct 2020 15:00:12 -0400 Received: by mail-wr1-f65.google.com with SMTP id s9so3113073wro.8 for ; Tue, 27 Oct 2020 12:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a8a/oVFoV9MTiz2akf3h4usj7NJQcCNmdh3b+TKbrQA=; b=P4jRtSivE3zFaJhLu81Q2XNew3IIJiT+Px3Whj9g1g8Gc7u3qcaobFj+YtwCNzgSSs bo8/7GN+l7b3fv3p3sWA2JZy8UXUxtly4N3B3zPvjQR1pdN/IVrQ1FeDuifm+bibZmge j/SvIb2kbVUtNsodCKc879jyO1WDZPwI/+7Jo4MkjSpcwzVFBujXq+tZl655OLydnq88 OR/k0qUg3B/RDIvTRZyEA4zUbLE3exjfJh1yGXSXi753GzDTqdyAMNZzQGHpR5VIWkvh 6F2C1sBxCrTzh022tfqYSSsKeSxdVQBHKJT8HwqC2s/KSMIhucdtCW3A8YwyoCntzkPy 9YjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a8a/oVFoV9MTiz2akf3h4usj7NJQcCNmdh3b+TKbrQA=; b=iNexRAmkbtZco+jwfyx+nzPageMV3ACttg649gq/x87udQEzpx14gJXVYV60epfkJZ AHXZSJtwTBIl59WmYMmQmH9emP1Bww2U9bfiiT3oVvf6dtv4SkBKtYnp7kmkbG/0yoAu Wc903XYFnKGeO50NO/kpS+QOMlyPq3O7vX6vZj552VjijsYfa1sYy8xE6B6DaEE9GG5f Uu9CWwHqAkqS/y8bdN6IkKbfk1fERLs4GmqxkLx7ivT2Zal+kD6ZdinpUe/1liUaPXu3 PWZBlQ8JG+f8/+nRgAw9ffLyL4JD2q9NxRlE94qMjsxWpOOriDr8wzqKbCFs++PxxVCy qGaQ== X-Gm-Message-State: AOAM530EXoiyRbcv828JZ6SM2APO43q4DLxr00vi74TUXm4vBIPdF5M0 wA5Qnf5TILpCBhbh11nkJAc7mrl3obflewyA X-Google-Smtp-Source: ABdhPJy6oZTZKiqP/ci+0HGrgHauw0AUcqHOwQrQTf7wYMyuZtDGcv00BLROWYVJvzm94AUKlbObSg== X-Received: by 2002:adf:f1cd:: with SMTP id z13mr4456623wro.197.1603825209356; Tue, 27 Oct 2020 12:00:09 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:08 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 03/16] selftests: net: bridge: igmp: check for specific udp ip protocol Date: Tue, 27 Oct 2020 20:59:21 +0200 Message-Id: <20201027185934.227040-4-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov We have to specifically check for udp protocol in addition to the mac address because in IGMPv3 tests group-specific queries will use the same mac address. Signed-off-by: Nikolay Aleksandrov --- tools/testing/selftests/net/forwarding/bridge_igmp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 1c19459dbc58..5562aef14c0a 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -93,7 +93,7 @@ mcast_packet_test() # was received by it or not. tc qdisc add dev $host2_if ingress tc filter add dev $host2_if ingress protocol ip pref 1 handle 101 \ - flower dst_mac $mac action drop + flower ip_proto udp dst_mac $mac action drop $MZ $host1_if -c 1 -p 64 -b $mac -A $src_ip -B $ip -t udp "dp=4096,sp=2048" -q sleep 1 From patchwork Tue Oct 27 18:59:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861457 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56F31C388F9 for ; Tue, 27 Oct 2020 19:00:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DB1B208B8 for ; Tue, 27 Oct 2020 19:00:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="ZLJj6Z3o" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829199AbgJ0TA4 (ORCPT ); Tue, 27 Oct 2020 15:00:56 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:32969 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371358AbgJ0TAN (ORCPT ); Tue, 27 Oct 2020 15:00:13 -0400 Received: by mail-wr1-f68.google.com with SMTP id b8so3160751wrn.0 for ; Tue, 27 Oct 2020 12:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W8178pAv6uDZvuBR8Wd4aVbByEM9iWD9JrBfg6O4nCE=; b=ZLJj6Z3orbJ+wULGft+hxYNzeLu0dElfr6eP44nItmYtg2ZpXuVRpD4ikfpOk5Hrr+ vJOPhyXUuR7P0hvBiyIBcWQz0c36R8pjYFZ5unQM6APXma7LMwiJoI1nS+Ixnh8hlm2j p9DSk4Tqno9xp4/X2G5I9ocH6Oi2+sgYlgMLfUB6UO5ldL5Qm5Q0YS63U3ASShTdi2hA cudHgyLzAs/Z0YbECGOV5XO767qC4L1TMrjSUIKxDO7ooJCdGwy1J8tC9NkZMjU86TSG okweKJ+iu2hdtmuq3rN71PX8W27PdtXDswETnO5Gm+0XKnp33MrowprW1bUgDJ/2KV0x 67pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W8178pAv6uDZvuBR8Wd4aVbByEM9iWD9JrBfg6O4nCE=; b=FOHtYy4RrtAl4w6NIl/OPqi6uMvia1FbXq020IE27INJUJJqtDenQiKlNMAQCY+EOz rom0MlUNHKfyjCXv4UoDm13ca1WhsBl2ZRRJv4EYzW6aYAB58Giu/0etmMXlMSeC12N0 vC5r32bEd2WmdWYl0R3b+l7iC01jqTyJN7xtOhXBS0ZjuVN48mlsGY/H++nnXPIz0SYs 76oCopX4gakCYbNCm9NxwNAhNnzo8IkOaLyTyK+tL2Zs5wWBJ+pm7K2q/XRWb8BZVNGE gS5PQxmi/tKSoa0RrVj4RW7cXuwaadT6y+/FfjVgfSYaQYThch69g9KWh2FEjaLAqlbF A2/A== X-Gm-Message-State: AOAM533te4X4Yu3v0RVzicFRu1cKDSZEwh0LDq0sf8wqehUpJV2pEn07 IGrUnOnVdT766BA930XaRfJIFpv/xhlWpC9h X-Google-Smtp-Source: ABdhPJwlp72VfrmJW+ImKhnPmyj3OZMtZSFRGMIIX+1N2LfBXruPyt+pw5NIMJyevtxNZGPofAAcJg== X-Received: by 2002:adf:bc4a:: with SMTP id a10mr4513195wrh.253.1603825210774; Tue, 27 Oct 2020 12:00:10 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:10 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 04/16] selftests: net: bridge: igmp: add IGMPv3 entries' state helpers Date: Tue, 27 Oct 2020 20:59:22 +0200 Message-Id: <20201027185934.227040-5-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov Add helpers which will be used in subsequent tests, they are: - check_sg_entries: check for proper source list and S,G entry existence - check_sg_fwding: check for proper traffic forwarding/blocking - check_sg_state: check for proper blocked/forwarding entry state Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 5562aef14c0a..19c1f46d1151 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -143,6 +143,73 @@ v2reportleave_test() log_test "IGMPv2 leave $TEST_GROUP" } +check_sg_entries() +{ + local report=$1; shift + local slist=("$@") + local sarg="" + + for src in "${slist[@]}"; do + sarg="${sarg} and .source_list[].address == \"$src\"" + done + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and .source_list != null $sarg)" &>/dev/null + check_err $? "Wrong *,G entry source list after $report report" + + for sgent in "${slist[@]}"; do + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and .src == \"$sgent\")" &>/dev/null + check_err $? "Missing S,G entry ($sgent, $TEST_GROUP)" + done +} + +check_sg_fwding() +{ + local should_fwd=$1; shift + local sources=("$@") + + for src in "${sources[@]}"; do + local retval=0 + + mcast_packet_test $TEST_GROUP_MAC $src $TEST_GROUP $h2 $h1 + retval=$? + if [ $should_fwd -eq 1 ]; then + check_fail $retval "Didn't forward traffic from S,G ($src, $TEST_GROUP)" + else + check_err $retval "Forwarded traffic for blocked S,G ($src, $TEST_GROUP)" + fi + done +} + +check_sg_state() +{ + local is_blocked=$1; shift + local sources=("$@") + local should_fail=1 + + if [ $is_blocked -eq 1 ]; then + should_fail=0 + fi + + for src in "${sources[@]}"; do + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and .source_list != null) | + .source_list[] | + select(.address == \"$src\") | + select(.timer == \"0.00\")" &>/dev/null + check_err_fail $should_fail $? "Entry $src has zero timer" + + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and .src == \"$src\" and \ + .flags[] == \"blocked\")" &>/dev/null + check_err_fail $should_fail $? "Entry $src has blocked flag" + done +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861493 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEF17C4363A for ; Tue, 27 Oct 2020 19:01:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6917921556 for ; Tue, 27 Oct 2020 19:01:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="docZ8N+i" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S371358AbgJ0TBP (ORCPT ); Tue, 27 Oct 2020 15:01:15 -0400 Received: from mail-wm1-f49.google.com ([209.85.128.49]:55097 "EHLO mail-wm1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371359AbgJ0TAP (ORCPT ); Tue, 27 Oct 2020 15:00:15 -0400 Received: by mail-wm1-f49.google.com with SMTP id w23so2390023wmi.4 for ; Tue, 27 Oct 2020 12:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pTc77R4pvCO6vD2QlG7YIVyPR4T/3LpBX7VL/VP1Nug=; b=docZ8N+iqBRaKPIQhMh5bpZeYwNCA11NL3jzp+RmYXhx/nnbloIoK8ZWsofY54lkSi OPccisFD1IY4Cur2HWYvcbQlhhl3cwjwztpEHFHRa6d1NwucsOzkcYxFFbjb+g6D1RLP 5hsj4wsMfdo3OalkSx0tll9DTDcGKhsRb52eXYfuxh2kynfpp+/w94w9mpNXtZUw4be1 2/wpilNZYVqP9c3h4/0TXDUq+ncNjvvnbz/+Op8mscApAAkxsMXR2dMQRmURyZtRK54c diukgujEuDxNrXsfU6saB19jv7EkLe3gilQDfjB0X3FByRzjWav6cIKZbkzL8BFWfgTC kemw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pTc77R4pvCO6vD2QlG7YIVyPR4T/3LpBX7VL/VP1Nug=; b=jmMnXuv2+VNUlch6ru7HYlLft24W7FKmeXo6bK8qzrguyZA5Dl9Lz63t76XhEmvEix f5j4+Qtu2tt1HAtCjRnE9hauT6W+pgvma5piiVaucHGzYX6SNV7yrZ4TRaa3oPFrc1pu AO6HJuGBQeMs0p2rkWQ3qeEJZS2cA76Hw0zNAkFDoXWwUa1IxySBpWMCxCIJ3V5PHL1E pLWcWf+NeXuF23m6mtPudfdWHWniuEdrEZGo6rC2kfGWBaAO4QcuNK7fEoHtm6FE80mw gr3Cfiuq+U7uZwwvXe5HsrfUHGxYQDwE22cApiyhOsOnulXAU/KBKWrKc34TCijPessv L/gQ== X-Gm-Message-State: AOAM5319scWUSHzHbtzL9gwLyJeec3Ol2AqZqionAs5wKeijLE/Gm45o Yzs2eX211NJYUTM1WQ1sXG+fXVKXpLsUa6A9 X-Google-Smtp-Source: ABdhPJyOhYhUsRfgbvQiyEdCo4xyzoFNA+4GrRwG9tUfLK9m80zXpr3OCn6kFdrwF34lYyrfIt9rzg== X-Received: by 2002:a7b:c305:: with SMTP id k5mr4371742wmj.102.1603825212082; Tue, 27 Oct 2020 12:00:12 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:11 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 05/16] selftests: net: bridge: add tests for igmpv3 is_include and inc -> allow reports Date: Tue, 27 Oct 2020 20:59:23 +0200 Message-Id: <20201027185934.227040-6-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov First we test is_include/include mode then we build on that with allow effectively achieving: state report result action INCLUDE (A) ALLOW (B) INCLUDE (A+B) (B)=GMI Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 82 ++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 19c1f46d1151..e9999e346ea6 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -1,11 +1,20 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 -ALL_TESTS="v2reportleave_test" +ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" TEST_GROUP_MAC="01:00:5e:0a:0a:0a" + +ALL_GROUP="224.0.0.1" +ALL_MAC="01:00:5e:00:00:01" + +# IGMPv3 is_in report: grp 239.10.10.10 is_include 192.0.2.1,192.0.2.2,192.0.2.3 +MZPKT_IS_INC="22:00:9d:de:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00:02:02:c0:00:02:03" +# IGMPv3 allow report: grp 239.10.10.10 allow 192.0.2.10,192.0.2.11,192.0.2.12 +MZPKT_ALLOW="22:00:99:c3:00:00:00:01:05:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" + source lib.sh h1_create() @@ -210,6 +219,77 @@ check_sg_state() done } +v3include_prepare() +{ + local host1_if=$1 + local mac=$2 + local group=$3 + local X=("192.0.2.1" "192.0.2.2" "192.0.2.3") + + ip link set dev br0 type bridge mcast_igmp_version 3 + check_err $? "Could not change bridge IGMP version to 3" + + $MZ $host1_if -b $mac -c 1 -B $group -t ip "proto=2,p=$MZPKT_IS_INC" -q + sleep 1 + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and .source_list != null)" &>/dev/null + check_err $? "Missing *,G entry with source list" + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and .filter_mode == \"include\")" &>/dev/null + check_err $? "Wrong *,G entry filter mode" + check_sg_entries "is_include" "${X[@]}" +} + +v3cleanup() +{ + local port=$1 + local group=$2 + + bridge mdb del dev br0 port $port grp $group + ip link set dev br0 type bridge mcast_igmp_version 2 +} + +v3include_test() +{ + RET=0 + local X=("192.0.2.1" "192.0.2.2" "192.0.2.3") + + v3include_prepare $h1 $ALL_MAC $ALL_GROUP + + check_sg_state 0 "${X[@]}" + + check_sg_fwding 1 "${X[@]}" + check_sg_fwding 0 "192.0.2.100" + + log_test "IGMPv3 report $TEST_GROUP is_include" + + v3cleanup $swp1 $TEST_GROUP +} + +v3inc_allow_test() +{ + RET=0 + local X=("192.0.2.10" "192.0.2.11" "192.0.2.12") + + v3include_prepare $h1 $ALL_MAC $ALL_GROUP + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_ALLOW" -q + sleep 1 + check_sg_entries "allow" "${X[@]}" + + check_sg_state 0 "${X[@]}" + + check_sg_fwding 1 "${X[@]}" + check_sg_fwding 0 "192.0.2.100" + + log_test "IGMPv3 report $TEST_GROUP include -> allow" + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861485 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80477C4363A for ; Tue, 27 Oct 2020 19:01:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C4AD21556 for ; Tue, 27 Oct 2020 19:01:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="EaoDx91o" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S371426AbgJ0TBV (ORCPT ); Tue, 27 Oct 2020 15:01:21 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36361 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371361AbgJ0TAQ (ORCPT ); Tue, 27 Oct 2020 15:00:16 -0400 Received: by mail-wr1-f68.google.com with SMTP id x7so3130160wrl.3 for ; Tue, 27 Oct 2020 12:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6HkZ/6PSGeiabpA/B/b1jjSowyj9GrVJsqEVL3OW8Gg=; b=EaoDx91o8fUnm+lClViM5aHRXCtgSqhpTvwagt0QiZHxRXIG3ecz2TV5FXYqwvZy/7 WfTOwmHr9FuytAtR4t1WHSoXgJWOhZaLPmgD9oaoP8s9KZ0/JLVLSfbp219p549kTkAL huDVbXJvA+dein2g84RfRSCUYq2fWYegvCM3M/WMH4VZZSKzR7jBiKCKYXUQWjpzpfrX 4KsjZLQxfUaspFK+Nyv4FH6+k40pEpnHgjqtJxfa4b2MZgyHeZC6wG8CBU8ZkUwfUYWg NenQfUaYyhQdjCpZCr3bZ5g2f/eX94etr3sLMzInM41du1AKFkUE75yDjge2ZDwITFAe v2bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6HkZ/6PSGeiabpA/B/b1jjSowyj9GrVJsqEVL3OW8Gg=; b=KR3jOGKJO6dCB0RwVvU47lK3UbeLJt7CHGssYbwwlDZx2OZ2kvgEkHnAuPrTAJT6xg 6G3I74ORAvj9ocGRzXDdwNw+ZZ/oPvUgARVwQvRuEaWhAlXnO4bv+LnLKHNet5p+POru at7+f+F9VQdl/1d6lV+UqPTPUMlT6Kql/BRGtLR9gzXeN/h8n9ZWz8JAoKUBymnKlidu qrbF+W/dIup5izaQeGpdaj0Ix89EG6cakQno61q/Jyul7Q4ckDxfBsIBvD7ocA/u3NZi 0kXKrs9zP5wbNF8UTn+YSubDLw5FsUkamtZFqmkp/fXDgxlTIgfAReEVw2fSCq1gHUde 9BzA== X-Gm-Message-State: AOAM532GJV7zAHn25UPIfLBrHK8HjBV3K2shI7jiwOk21Fxn2XrZV2jb CTEnrABHSo1nMGky7x+2IIsec5K3v9GEZu2i X-Google-Smtp-Source: ABdhPJwVyXBlPxDCcS/ezwgZhQ9U5RFWEwJvAKWbxEftL+IxAF+WoSxAwD3UCUVXxJDFlvwjeKaD0w== X-Received: by 2002:adf:a557:: with SMTP id j23mr4716801wrb.95.1603825213429; Tue, 27 Oct 2020 12:00:13 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:12 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 06/16] selftests: net: bridge: add test for igmpv3 inc -> is_include report Date: Tue, 27 Oct 2020 20:59:24 +0200 Message-Id: <20201027185934.227040-7-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action INCLUDE (A) IS_IN (B) INCLUDE (A+B) (B)=GMI Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index e9999e346ea6..added5c69e8b 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -1,7 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 -ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test" +ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -12,6 +12,8 @@ ALL_MAC="01:00:5e:00:00:01" # IGMPv3 is_in report: grp 239.10.10.10 is_include 192.0.2.1,192.0.2.2,192.0.2.3 MZPKT_IS_INC="22:00:9d:de:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00:02:02:c0:00:02:03" +# IGMPv3 is_in report: grp 239.10.10.10 is_include 192.0.2.10,192.0.2.11,192.0.2.12 +MZPKT_IS_INC2="22:00:9d:c3:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" # IGMPv3 allow report: grp 239.10.10.10 allow 192.0.2.10,192.0.2.11,192.0.2.12 MZPKT_ALLOW="22:00:99:c3:00:00:00:01:05:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" @@ -290,6 +292,27 @@ v3inc_allow_test() v3cleanup $swp1 $TEST_GROUP } +v3inc_is_include_test() +{ + RET=0 + local X=("192.0.2.10" "192.0.2.11" "192.0.2.12") + + v3include_prepare $h1 $ALL_MAC $ALL_GROUP + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_IS_INC2" -q + sleep 1 + check_sg_entries "is_include" "${X[@]}" + + check_sg_state 0 "${X[@]}" + + check_sg_fwding 1 "${X[@]}" + check_sg_fwding 0 "192.0.2.100" + + log_test "IGMPv3 report $TEST_GROUP include -> is_include" + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861499 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8E07C55179 for ; Tue, 27 Oct 2020 19:01:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A087021527 for ; Tue, 27 Oct 2020 19:01:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="nocgw/xf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S371419AbgJ0TBT (ORCPT ); Tue, 27 Oct 2020 15:01:19 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35482 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371363AbgJ0TAR (ORCPT ); Tue, 27 Oct 2020 15:00:17 -0400 Received: by mail-wr1-f68.google.com with SMTP id n15so3145922wrq.2 for ; Tue, 27 Oct 2020 12:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eYSlfHy2do06FrpDILVFhyJwEe8Ff8TXqbs1TkvRaIw=; b=nocgw/xfVwwoDjAjQ31KC5TBrwADhL2dJhYVpsDe6nRPDw0ZKWhyVCyeoBrtmHldN8 TEBuh6LUFvtpb09qZwBq3md71I2+FEkmdJE8hPw472nYt8eGabksZHC2oeY+4oIO2n/T UOhBp/YDKfmkGF2k3zsI76rgZ+p2J/8aeP+s6t1vvyKmyMcDXkB2NpaoDsbKILs2ikpF dmz3rSEm4mKFFhbFhwU2L8TRgGL+1iuQBOhKXstRPyfkSQ/CNcoWeBwPcg2svEW01EGa RLqFRHVr469yOGlaHMgGM8+nQ7i5i2E3IuQNcP6kwDO3vRr9W2aHjTwRltZku4D+aTIA yOSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eYSlfHy2do06FrpDILVFhyJwEe8Ff8TXqbs1TkvRaIw=; b=gqMSywMGJj5BjZ9xoq2YsQaw9GSTltkguYbOp2wbltQl9Hxu/maFKL7PxG+qRyFR8u +sgOnD8oWOrNdmuE6x/o3TGxql5v9X8E5u8jWcicuchjIxO1S0UUG6i6gFjfiXXyh/vJ 90h5ArzMQr8+bJVI7+exiOo/k6kgjh4hVOga14roiUenj6jJWSOLWAlDn9ApjLUe8+aP 8fvyiNlONum4nxBMrujTYfg8xmqPckH5eOJCwMHzsxmpahuCqsaUHJyVX0Wh60K2eYHV BxK35W+sY5LQuws3Uay861DjfnHP8gg2HGI4uBwXbUEKxVezmcw6LceQhX5sWLf+r1kq bM8Q== X-Gm-Message-State: AOAM5339X8JWDaV5zL2NUKOREpaH8M7c5a9C+/eVfJuSSoQmDpgZH80m GxsoicwtgTLbaCofZBwZcp9JBAyZoEONor+s X-Google-Smtp-Source: ABdhPJxIQAZSVVyNAoP6ud8NkOxkxwUErE0BTsdVKLdYGr/l1bOhmh/adiFe/AJbCpSkUa4M+suhJg== X-Received: by 2002:adf:fe8b:: with SMTP id l11mr4665168wrr.9.1603825214566; Tue, 27 Oct 2020 12:00:14 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:14 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 07/16] selftests: net: bridge: add test for igmpv3 inc -> is_exclude report Date: Tue, 27 Oct 2020 20:59:25 +0200 Message-Id: <20201027185934.227040-8-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action INCLUDE (A) IS_EX (B) EXCLUDE (A*B,B-A) (B-A)=0 Delete (A-B) Group Timer=GMI Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index added5c69e8b..34d2c4370fa6 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -1,7 +1,8 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 -ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test" +ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ + v3inc_is_exclude_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -16,6 +17,8 @@ MZPKT_IS_INC="22:00:9d:de:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00: MZPKT_IS_INC2="22:00:9d:c3:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" # IGMPv3 allow report: grp 239.10.10.10 allow 192.0.2.10,192.0.2.11,192.0.2.12 MZPKT_ALLOW="22:00:99:c3:00:00:00:01:05:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" +# IGMPv3 is_ex report: grp 239.10.10.10 is_exclude 192.0.2.1,192.0.2.2,192.0.2.20,192.0.2.21 +MZPKT_IS_EXC="22:00:da:b6:00:00:00:01:02:00:00:04:ef:0a:0a:0a:c0:00:02:01:c0:00:02:02:c0:00:02:14:c0:00:02:15" source lib.sh @@ -313,6 +316,42 @@ v3inc_is_include_test() v3cleanup $swp1 $TEST_GROUP } +v3inc_is_exclude_test() +{ + RET=0 + local X=("192.0.2.1" "192.0.2.2") + local Y=("192.0.2.20" "192.0.2.21") + + v3include_prepare $h1 $ALL_MAC $ALL_GROUP + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_IS_EXC" -q + sleep 1 + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and .filter_mode == \"exclude\")" &>/dev/null + check_err $? "Wrong *,G entry filter mode" + + check_sg_entries "is_exclude" "${X[@]}" "${Y[@]}" + + check_sg_state 0 "${X[@]}" + check_sg_state 1 "${Y[@]}" + + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and + .source_list[].address == \"192.0.2.3\")" &>/dev/null + check_fail $? "Wrong *,G entry source list, 192.0.2.3 entry still exists" + + check_sg_fwding 1 "${X[@]}" 192.0.2.100 + check_sg_fwding 0 "${Y[@]}" + + log_test "IGMPv3 report $TEST_GROUP include -> is_exclude" + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861489 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAB07C55178 for ; Tue, 27 Oct 2020 19:01:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5671121527 for ; Tue, 27 Oct 2020 19:01:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="oolbQbp+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S371414AbgJ0TBR (ORCPT ); Tue, 27 Oct 2020 15:01:17 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37168 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371364AbgJ0TAS (ORCPT ); Tue, 27 Oct 2020 15:00:18 -0400 Received: by mail-wr1-f66.google.com with SMTP id w1so3136156wrm.4 for ; Tue, 27 Oct 2020 12:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JzKJIP19qAr7tycB0lsJIxtVUIVBOP2rnZUT6EMgcEg=; b=oolbQbp+RAdedRw2nl+g+MjzgZviiwdPjEqDHPDZCSGcD3xrCoiLMsyr3koqNz8Ktw CLZzaS0+/Tqq85mwNfhRvB7Ss1MgrTNj4FrzV+k5qb6Wjp3iL4yvaLLsDJ/TRdi83ELD RhQJ2kOtqYB8yjj6WXeHSG3RlK8TRnBHX9PZvBKTA9KNcX6feOUfAa73W2GqEKR5Y2Ca SmgigMaPSmu1cabKPV7Z2fZt5zXoVYVkaa3ebFI1GMC4QY+7+UvWWVPMP8wUHGY6qOhg b6VUwZc3qGoNXesQZStDnyF51OyheA0lpUR3MVCdaPOyuDUR7GLXgy4hEC0tElvRBPKV dy5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JzKJIP19qAr7tycB0lsJIxtVUIVBOP2rnZUT6EMgcEg=; b=YuvqG9qtL8v8Bx9cHu5kfIxr5vuPbaz+8qUIvgyo4H70SoDWCvR40wPsPR/p3u3PuK vHWjeeaZ8GAZ88QfFfU4XS4GYbGXdMCpHSkV57KYZtRgXH75Ze6k+4WIG1Aw9i7hR4Jr aGENr3/N1nh+B8K5rw3zyWsvKe9z3/IybuYYuMlJYyvWJp/5TD1OxJZV5M3ozYH2hzy0 7HKLombLj4tQl7N719beHT5dYqI+4qJ08K/rtqWOsXAJ/wH2ey+2q7xe+LyCu2+utvG9 xMkoB9NdiW9uTYzsv2ayEvS+x7d2yaYpo8uRdw/TX/kSKzmKKF/kObfj/lQWlYZ94ibV SmDg== X-Gm-Message-State: AOAM53126YU2NsMXmN4Vlwc3KCJ9+IXCT2CokXF1Rqgt1Nl7gPiHGWjG C5i/3qxQfyZpGQzV97WVLI0jp7HLFnlssb/P X-Google-Smtp-Source: ABdhPJzgvwtSVBngsQIJw0RAb4dfZsKGeznf5cPLM5c7KM64w0zdnWtACQQSyHWUPLNLlOKVbBcP8Q== X-Received: by 2002:adf:f4d2:: with SMTP id h18mr4229152wrp.99.1603825215763; Tue, 27 Oct 2020 12:00:15 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:15 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 08/16] selftests: net: bridge: add test for igmpv3 inc -> to_exclude report Date: Tue, 27 Oct 2020 20:59:26 +0200 Message-Id: <20201027185934.227040-9-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action INCLUDE (A) TO_EX (B) EXCLUDE (A*B,B-A) (B-A)=0 Delete (A-B) Send Q(G,A*B) Group Timer=GMI Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 34d2c4370fa6..36f10a3168cc 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0 ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ - v3inc_is_exclude_test" + v3inc_is_exclude_test v3inc_to_exclude_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -19,6 +19,8 @@ MZPKT_IS_INC2="22:00:9d:c3:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00 MZPKT_ALLOW="22:00:99:c3:00:00:00:01:05:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" # IGMPv3 is_ex report: grp 239.10.10.10 is_exclude 192.0.2.1,192.0.2.2,192.0.2.20,192.0.2.21 MZPKT_IS_EXC="22:00:da:b6:00:00:00:01:02:00:00:04:ef:0a:0a:0a:c0:00:02:01:c0:00:02:02:c0:00:02:14:c0:00:02:15" +# IGMPv3 to_ex report: grp 239.10.10.10 to_exclude 192.0.2.1,192.0.2.20,192.0.2.30 +MZPKT_TO_EXC="22:00:9a:b1:00:00:00:01:04:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00:02:14:c0:00:02:1e" source lib.sh @@ -352,6 +354,53 @@ v3inc_is_exclude_test() v3cleanup $swp1 $TEST_GROUP } +v3inc_to_exclude_test() +{ + RET=0 + local X=("192.0.2.1") + local Y=("192.0.2.20" "192.0.2.30") + + v3include_prepare $h1 $ALL_MAC $ALL_GROUP + + ip link set dev br0 type bridge mcast_last_member_interval 500 + check_err $? "Could not change mcast_last_member_interval to 5s" + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_TO_EXC" -q + sleep 1 + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and .filter_mode == \"exclude\")" &>/dev/null + check_err $? "Wrong *,G entry filter mode" + + check_sg_entries "to_exclude" "${X[@]}" "${Y[@]}" + + check_sg_state 0 "${X[@]}" + check_sg_state 1 "${Y[@]}" + + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and + .source_list[].address == \"192.0.2.2\")" &>/dev/null + check_fail $? "Wrong *,G entry source list, 192.0.2.2 entry still exists" + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and + .source_list[].address == \"192.0.2.21\")" &>/dev/null + check_fail $? "Wrong *,G entry source list, 192.0.2.21 entry still exists" + + check_sg_fwding 1 "${X[@]}" 192.0.2.100 + check_sg_fwding 0 "${Y[@]}" + + log_test "IGMPv3 report $TEST_GROUP include -> to_exclude" + + ip link set dev br0 type bridge mcast_last_member_interval 100 + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861497 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08F88C4363A for ; Tue, 27 Oct 2020 19:01:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B05AB20878 for ; Tue, 27 Oct 2020 19:01:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="NRIRVoOb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S371439AbgJ0TB2 (ORCPT ); Tue, 27 Oct 2020 15:01:28 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37875 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371371AbgJ0TAV (ORCPT ); Tue, 27 Oct 2020 15:00:21 -0400 Received: by mail-wm1-f65.google.com with SMTP id c16so2551943wmd.2 for ; Tue, 27 Oct 2020 12:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Asc85PeAu34wOOUcZ5M4BI/jMYTqZqHRSKn8fRmFp+Q=; b=NRIRVoObB74sv3K3+hxR4HW1wX78cjMhupA5bRlj+8nJTuZ9MYgojs81gDBM/niY8o Fj8uKXZvLxaYYc+zsO30MLCgqwiLldUeQcuQSnmi1cXFKwjixQtgv4YmXz+GUnIDuoXD hQPQRuynPvAlIS7vM6kQXZXmB1vm2wxxnunCFknDQ5agLf8twnBnsjpVZLtZCBbNlL9/ 9a/xzzZoOdyfHLU4GBQhlHP2kGjZHetDc+miIswIDLqIic8HaSiDVO2y4t6YoR4W560W /odot+qz7elCLafQIH1RKcnCowgo1G7Fo2G+mU5RGZoiOmXiBreP5RzpM/e8lSeBhKGO tkaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Asc85PeAu34wOOUcZ5M4BI/jMYTqZqHRSKn8fRmFp+Q=; b=UzZAWeibJw+64t+9Bu1Ud7UMJdrsiRzFneh3YnGD1lA9W4l5zyhwbCGs/L4S5zCU2A vm10wVHx/Hv9POnbyjBKDW/wYgbACegJa3nEFrCxaqlYLUL6RopSx2ynC7oIDsVI44io 5/OY9PvDbwQKQc0+mxUEWz9oNA6YWIUT1J9cP78cxP8nr3fEmPEpg2ozXE3NctMw+Gow uAB9k6MO69hqa1OOXbOjE6i1DdM/VF3xNoS2BOdoP5C6h5J8oy/53u2epmToE35QxCl7 yoXtsyRYIlsu1bdVFsU+a0OVqCr5c2qaaslnVhbWSMbDEfqkbnvW9gF9WA9EGtukzvo9 LFDw== X-Gm-Message-State: AOAM531696dcZZnbBRrxrsEgEB1g3MbWRISOhxwG1eDaaR5emP/TpOn1 l5kO8xrbzsCLq7qcJiV87asQ0wa5+tgCAcHJ X-Google-Smtp-Source: ABdhPJz6HKK/h/k1yqee0HneGTNOMuCc/QnrFT6p+vKJyGWponzQy7Xl18wdF9hms41zfsEiVhmL5Q== X-Received: by 2002:a7b:cf04:: with SMTP id l4mr4297731wmg.33.1603825217071; Tue, 27 Oct 2020 12:00:17 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:16 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 09/16] selftests: net: bridge: add test for igmpv3 exc -> allow report Date: Tue, 27 Oct 2020 20:59:27 +0200 Message-Id: <20201027185934.227040-10-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action EXCLUDE (X,Y) ALLOW (A) EXCLUDE (X+A,Y-A) (A)=GMI Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 83 +++++++++++++------ 1 file changed, 59 insertions(+), 24 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 36f10a3168cc..d786e75abe2c 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0 ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ - v3inc_is_exclude_test v3inc_to_exclude_test" + v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -17,6 +17,8 @@ MZPKT_IS_INC="22:00:9d:de:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00: MZPKT_IS_INC2="22:00:9d:c3:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" # IGMPv3 allow report: grp 239.10.10.10 allow 192.0.2.10,192.0.2.11,192.0.2.12 MZPKT_ALLOW="22:00:99:c3:00:00:00:01:05:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" +# IGMPv3 allow report: grp 239.10.10.10 allow 192.0.2.20,192.0.2.30 +MZPKT_ALLOW2="22:00:5b:b4:00:00:00:01:05:00:00:02:ef:0a:0a:0a:c0:00:02:14:c0:00:02:1e" # IGMPv3 is_ex report: grp 239.10.10.10 is_exclude 192.0.2.1,192.0.2.2,192.0.2.20,192.0.2.21 MZPKT_IS_EXC="22:00:da:b6:00:00:00:01:02:00:00:04:ef:0a:0a:0a:c0:00:02:01:c0:00:02:02:c0:00:02:14:c0:00:02:15" # IGMPv3 to_ex report: grp 239.10.10.10 to_exclude 192.0.2.1,192.0.2.20,192.0.2.30 @@ -250,6 +252,38 @@ v3include_prepare() check_sg_entries "is_include" "${X[@]}" } +v3exclude_prepare() +{ + local host1_if=$1 + local mac=$2 + local group=$3 + local pkt=$4 + local X=("192.0.2.1" "192.0.2.2") + local Y=("192.0.2.20" "192.0.2.21") + + v3include_prepare $host1_if $mac $group + + $MZ $host1_if -c 1 -b $mac -B $group -t ip "proto=2,p=$MZPKT_IS_EXC" -q + sleep 1 + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and .filter_mode == \"exclude\")" &>/dev/null + check_err $? "Wrong *,G entry filter mode" + + check_sg_entries "is_exclude" "${X[@]}" "${Y[@]}" + + check_sg_state 0 "${X[@]}" + check_sg_state 1 "${Y[@]}" + + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and + .source_list[].address == \"192.0.2.3\")" &>/dev/null + check_fail $? "Wrong *,G entry source list, 192.0.2.3 entry still exists" +} + v3cleanup() { local port=$1 @@ -321,30 +355,8 @@ v3inc_is_include_test() v3inc_is_exclude_test() { RET=0 - local X=("192.0.2.1" "192.0.2.2") - local Y=("192.0.2.20" "192.0.2.21") - - v3include_prepare $h1 $ALL_MAC $ALL_GROUP - - $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_IS_EXC" -q - sleep 1 - bridge -j -d -s mdb show dev br0 \ - | jq -e ".[].mdb[] | \ - select(.grp == \"$TEST_GROUP\" and \ - .source_list != null and .filter_mode == \"exclude\")" &>/dev/null - check_err $? "Wrong *,G entry filter mode" - - check_sg_entries "is_exclude" "${X[@]}" "${Y[@]}" - check_sg_state 0 "${X[@]}" - check_sg_state 1 "${Y[@]}" - - bridge -j -d -s mdb show dev br0 \ - | jq -e ".[].mdb[] | \ - select(.grp == \"$TEST_GROUP\" and \ - .source_list != null and - .source_list[].address == \"192.0.2.3\")" &>/dev/null - check_fail $? "Wrong *,G entry source list, 192.0.2.3 entry still exists" + v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP check_sg_fwding 1 "${X[@]}" 192.0.2.100 check_sg_fwding 0 "${Y[@]}" @@ -401,6 +413,29 @@ v3inc_to_exclude_test() v3cleanup $swp1 $TEST_GROUP } +v3exc_allow_test() +{ + RET=0 + local X=("192.0.2.1" "192.0.2.2" "192.0.2.20" "192.0.2.30") + local Y=("192.0.2.21") + + v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_ALLOW2" -q + sleep 1 + check_sg_entries "allow" "${X[@]}" "${Y[@]}" + + check_sg_state 0 "${X[@]}" + check_sg_state 1 "${Y[@]}" + + check_sg_fwding 1 "${X[@]}" 192.0.2.100 + check_sg_fwding 0 "${Y[@]}" + + log_test "IGMPv3 report $TEST_GROUP exclude -> allow" + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861495 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF452C388F9 for ; Tue, 27 Oct 2020 19:01:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A857320878 for ; Tue, 27 Oct 2020 19:01:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="y044UhrU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829220AbgJ0TBZ (ORCPT ); Tue, 27 Oct 2020 15:01:25 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36372 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371380AbgJ0TAV (ORCPT ); Tue, 27 Oct 2020 15:00:21 -0400 Received: by mail-wr1-f68.google.com with SMTP id x7so3130404wrl.3 for ; Tue, 27 Oct 2020 12:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eh7WAxMOPKXXzFs26VQMmI3KTTBmFoUGd5NShuFmYTI=; b=y044UhrUzUTQHrbOmghMxJAowA7TXmIo5m0dxTpVuGY6BerjGF90KmoVYELavc/tRo zR7ON80BmM2fNY3m+UvIMxRue0crw0AtRBP0tXW7b/pIAiYc4hrWmj4LoVifM4RD8n3w 2pRRBVb8WwUvUsRf86eoZQAGdSPInowb+xCnFEX1BNxoAFSB/IDD1A6OuOuXVfIhAR3r goLXAVUKtP5LBjZtUaJmHcHM0e9T2FSu5a63xdNcNXos4oCb32r0WL9rB1gp/Ljdl8pF QYtY4EfHaPtMJ9khsNFAzfiecSeTMP1FQaD+3ck3b2vjQgkv8nrdPbHspMAFN0NhjUB/ V1fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eh7WAxMOPKXXzFs26VQMmI3KTTBmFoUGd5NShuFmYTI=; b=bZat/IyUyrMZ3XisUh7HN5b6PkaVtl3IrD3qH9wyzfSFCX0EXLtbaEcbtLbDU/Paeh lFDPUD+TBY3dNu3J0p7AtkkKix2ujrSFLTPnDkhuCYVzusXlZEx4kiHBNeMJZctb0Fbw dfXoO4C3zewC9H/oY4YPF9Ore0PldTowC25T8xehAgFoWZdVRMzn5Dk+26r7G/9z6rMX 8ZyjLVTzFHjvmaJfktuJIk7opGm5cKeiz85LOwoYqpnrqtmj5n/ZrviE5FObblF0psd3 PA2YUj0p+FzP7be0ShWXcJ+ZEG8VKmql3dkg9EuDrZeffrulS4hWbDr24sTcYGZiYUqy 4PpQ== X-Gm-Message-State: AOAM533Fdlq9kZngFSVdoz1NV7qO4FMHJ7GJd94fk+4XDVXr06Cf+CN0 qQN01rOkVNJ3GIZhi4IIhN1nmn4YumccIXjv X-Google-Smtp-Source: ABdhPJwsDoeyXL33OZHujXDCVYr7wQXd77jty6Brgedv4cdnELOfAEC7WuNO5OrheGMnlibYKylEKw== X-Received: by 2002:a5d:5748:: with SMTP id q8mr4418940wrw.299.1603825218168; Tue, 27 Oct 2020 12:00:18 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:17 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 10/16] selftests: net: bridge: add test for igmpv3 exc -> is_include report Date: Tue, 27 Oct 2020 20:59:28 +0200 Message-Id: <20201027185934.227040-11-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action EXCLUDE (X,Y) IS_IN (A) EXCLUDE (X+A,Y-A) (A)=GMI Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index d786e75abe2c..b2b0f7d7e860 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0 ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ - v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test" + v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test v3exc_is_include_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -15,6 +15,8 @@ ALL_MAC="01:00:5e:00:00:01" MZPKT_IS_INC="22:00:9d:de:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00:02:02:c0:00:02:03" # IGMPv3 is_in report: grp 239.10.10.10 is_include 192.0.2.10,192.0.2.11,192.0.2.12 MZPKT_IS_INC2="22:00:9d:c3:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" +# IGMPv3 is_in report: grp 239.10.10.10 is_include 192.0.2.20,192.0.2.30 +MZPKT_IS_INC3="22:00:5f:b4:00:00:00:01:01:00:00:02:ef:0a:0a:0a:c0:00:02:14:c0:00:02:1e" # IGMPv3 allow report: grp 239.10.10.10 allow 192.0.2.10,192.0.2.11,192.0.2.12 MZPKT_ALLOW="22:00:99:c3:00:00:00:01:05:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" # IGMPv3 allow report: grp 239.10.10.10 allow 192.0.2.20,192.0.2.30 @@ -436,6 +438,29 @@ v3exc_allow_test() v3cleanup $swp1 $TEST_GROUP } +v3exc_is_include_test() +{ + RET=0 + local X=("192.0.2.1" "192.0.2.2" "192.0.2.20" "192.0.2.30") + local Y=("192.0.2.21") + + v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_IS_INC3" -q + sleep 1 + check_sg_entries "is_include" "${X[@]}" "${Y[@]}" + + check_sg_state 0 "${X[@]}" + check_sg_state 1 "${Y[@]}" + + check_sg_fwding 1 "${X[@]}" 192.0.2.100 + check_sg_fwding 0 "${Y[@]}" + + log_test "IGMPv3 report $TEST_GROUP exclude -> is_include" + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861505 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40ECAC55179 for ; Tue, 27 Oct 2020 19:01:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA9B421D41 for ; Tue, 27 Oct 2020 19:01:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="KmGEcWTD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829215AbgJ0TBX (ORCPT ); Tue, 27 Oct 2020 15:01:23 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:32985 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371381AbgJ0TAW (ORCPT ); Tue, 27 Oct 2020 15:00:22 -0400 Received: by mail-wr1-f66.google.com with SMTP id b8so3161224wrn.0 for ; Tue, 27 Oct 2020 12:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eDTIDQ54v3hNLISIhSoICwr0iuL2p884XIbh/Sf6EKU=; b=KmGEcWTDbqnHdqrNBpRKUInzMHv+8ZUJruW6v/H03R6LZoawPwpuXxsUUwwKPR3VGU UUporxwy+TgwVoLAykrTEBArjA7iV1HgFfyn/prCeDWc9UmrDG4EBWJj+mjLOMk8Uvjx fsELqDbhoyJS9kMBHmRUAXMaSHAhorADYmfd6MEgq+ApxowwjXX/PO+UrwzGkitn6xzL 40hLEpBeuUvXzmoYorTksBtVBwie0VyVXCodvAzACqm+0wkRxWC6C5kDpr3qnsfQyH93 DtBIuMW60mB/PbKoTw1gpVefxMtCp8pd947xJ8ccuOwvbHy2FpyRlNoyDx7vQVd3aKhZ QQRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eDTIDQ54v3hNLISIhSoICwr0iuL2p884XIbh/Sf6EKU=; b=NgOYK5ibtmeomSqkGA89HKeIt696eVVExWCVMOr9lmJuwgJC2CazXvTIKP7Ji08Z2T o1goHxgsgZh2boYM4WdwnzwOwX1CLiWPDvtjw3xYysYF9zZT1eJjQbinn2KSjX4lWljD tYMuTsSpyN4nSTpwyvDynVIwoqMYftGKkRlyIe+DXG96ETSg/9wuN0cNg5Ppto/JIe/6 NsNXxowA+URilOkTzClZBnO9B9HYPOzxE6UTxHA3HgNPD9PlkB3J6Sy+G453ziR7Bwgx 904MUijFlTcWElDPPV+BsjdzGTq2yixfZIBQV8wmRlwAn0ToQ9Ur19SLZgvS99NaNXig 8nwA== X-Gm-Message-State: AOAM530gVyZ5bWcbsD5DMiXxtOLjYhGbitsAall8AxNFZX7NoU3mii7s 5RRTA/6QOtlbK1tEEB/4mkmKFqXoTt0AzuNd X-Google-Smtp-Source: ABdhPJzVoVoeLcMMm7ezUBF93U4f4/e8VwW037i0ic+ZzNql6LkMaAp+ueBwletke7z9/jks/K3mOA== X-Received: by 2002:adf:ce8a:: with SMTP id r10mr4717292wrn.188.1603825219281; Tue, 27 Oct 2020 12:00:19 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:18 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 11/16] selftests: net: bridge: add test for igmpv3 exc -> is_exclude report Date: Tue, 27 Oct 2020 20:59:29 +0200 Message-Id: <20201027185934.227040-12-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action EXCLUDE (X,Y) IS_EX (A) EXCLUDE (A-Y,Y*A) (A-X-Y)=GMI Delete (X-A) Delete (Y-A) Group Timer=GMI Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index b2b0f7d7e860..91b0b26428f6 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -2,7 +2,8 @@ # SPDX-License-Identifier: GPL-2.0 ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ - v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test v3exc_is_include_test" + v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test v3exc_is_include_test \ + v3exc_is_exclude_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -23,6 +24,8 @@ MZPKT_ALLOW="22:00:99:c3:00:00:00:01:05:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:0 MZPKT_ALLOW2="22:00:5b:b4:00:00:00:01:05:00:00:02:ef:0a:0a:0a:c0:00:02:14:c0:00:02:1e" # IGMPv3 is_ex report: grp 239.10.10.10 is_exclude 192.0.2.1,192.0.2.2,192.0.2.20,192.0.2.21 MZPKT_IS_EXC="22:00:da:b6:00:00:00:01:02:00:00:04:ef:0a:0a:0a:c0:00:02:01:c0:00:02:02:c0:00:02:14:c0:00:02:15" +# IGMPv3 is_ex report: grp 239.10.10.10 is_exclude 192.0.2.20,192.0.2.30 +MZPKT_IS_EXC2="22:00:5e:b4:00:00:00:01:02:00:00:02:ef:0a:0a:0a:c0:00:02:14:c0:00:02:1e" # IGMPv3 to_ex report: grp 239.10.10.10 to_exclude 192.0.2.1,192.0.2.20,192.0.2.30 MZPKT_TO_EXC="22:00:9a:b1:00:00:00:01:04:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00:02:14:c0:00:02:1e" @@ -461,6 +464,29 @@ v3exc_is_include_test() v3cleanup $swp1 $TEST_GROUP } +v3exc_is_exclude_test() +{ + RET=0 + local X=("192.0.2.30") + local Y=("192.0.2.20") + + v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_IS_EXC2" -q + sleep 1 + check_sg_entries "is_exclude" "${X[@]}" "${Y[@]}" + + check_sg_state 0 "${X[@]}" + check_sg_state 1 "${Y[@]}" + + check_sg_fwding 1 "${X[@]}" 192.0.2.100 + check_sg_fwding 0 "${Y[@]}" + + log_test "IGMPv3 report $TEST_GROUP exclude -> is_exclude" + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861503 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC83DC388F9 for ; Tue, 27 Oct 2020 19:01:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56DD821556 for ; Tue, 27 Oct 2020 19:01:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="uFAh3qD+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829243AbgJ0TBh (ORCPT ); Tue, 27 Oct 2020 15:01:37 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33989 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371382AbgJ0TAX (ORCPT ); Tue, 27 Oct 2020 15:00:23 -0400 Received: by mail-wr1-f67.google.com with SMTP id i1so3157412wro.1 for ; Tue, 27 Oct 2020 12:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GkauxuTNWiSF9oMdr/Q/tgJ/GE3iMvf1VO5Jw7M5+xs=; b=uFAh3qD+tDMpttSW6AZo2oHmMqnlE/L9/+Hto2jryq9hxQWSn7IW0ju6HGCycstPp0 H0f6qtJqmac7tUfLC4b7nNKIFi/021FZUX0STCsIysgbaN6NIOgUZEHytzNwAAXZmDSV Qr1esn/thg3+Dx1UYG4ul1cmqB/LNJCUvpPHK4bzXBNUeUfWGViXsSr2GcxNob8IZiRW k6BDsH4PovXv/VUBlcOloRE4WEStDzZLFH4YcDG3Z/kEBRD9o5ZY7DeP+RE0BjOZpimq 4MDQNQU6jjdhSNsZ+f9MH8JGza0NaBmOOC5D9JIeP5NWqYwwuUNhWBR1yod++gkD1shl GXQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GkauxuTNWiSF9oMdr/Q/tgJ/GE3iMvf1VO5Jw7M5+xs=; b=FXwdUYuoAUdcC+bGB8d69aaeF0XrSY87UvmMzOdMDH0iiG11Qw2NBpOBX5IQNo9+18 CLq69+Q8SYmJ9wkeYtiB0S7XdjSRZAI60zGbSyYJHjwEnFeKDhC/wZIT2ZlUgb3M2uMy ax5DD1m7abO5wR0mLKMjPq8CZMkdLitVRd94Nw1/aaEYGVo6JCBSSQ/vDEGbLUDyDOJF JITRKi8SzmWNgJQhi5Ys3TFi7e32YJEWko9guW4/6Cg4vxuuVp/Ag+2DvNCEZEkK+Sqm RHJ+ZxMP8DUI5p2CyRr4aAV3eJPq5hc0Tue1eSmDtHLSWB1VUOI+009Vt1o+DtG1L3up WzTg== X-Gm-Message-State: AOAM532xGVGZeR7WQZobuArELl2eZhdYcl13O9DD91b+hi1g8KyS931p +otCBGwOUpLOHL7x61BIEfpiICUaDghnxExc X-Google-Smtp-Source: ABdhPJzeAzyPZ503wQzC31NBDWhLz0G6RpVsHLo4W4PaX1fa3CRC6CqBBsE/4zLiXLtFF2amELEfwg== X-Received: by 2002:adf:bc4a:: with SMTP id a10mr4513962wrh.253.1603825220478; Tue, 27 Oct 2020 12:00:20 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:20 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 12/16] selftests: net: bridge: add test for igmpv3 exc -> to_exclude report Date: Tue, 27 Oct 2020 20:59:30 +0200 Message-Id: <20201027185934.227040-13-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action EXCLUDE (X,Y) TO_EX (A) EXCLUDE (A-Y,Y*A) (A-X-Y)=Group Timer Delete (X-A) Delete (Y-A) Send Q(G,A-Y) Group Timer=GMI Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 91b0b26428f6..3cfc30b88285 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -3,7 +3,7 @@ ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test v3exc_is_include_test \ - v3exc_is_exclude_test" + v3exc_is_exclude_test v3exc_to_exclude_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -487,6 +487,34 @@ v3exc_is_exclude_test() v3cleanup $swp1 $TEST_GROUP } +v3exc_to_exclude_test() +{ + RET=0 + local X=("192.0.2.1" "192.0.2.30") + local Y=("192.0.2.20") + + v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP + + ip link set dev br0 type bridge mcast_last_member_interval 500 + check_err $? "Could not change mcast_last_member_interval to 5s" + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_TO_EXC" -q + sleep 1 + check_sg_entries "to_exclude" "${X[@]}" "${Y[@]}" + + check_sg_state 0 "${X[@]}" + check_sg_state 1 "${Y[@]}" + + check_sg_fwding 1 "${X[@]}" 192.0.2.100 + check_sg_fwding 0 "${Y[@]}" + + log_test "IGMPv3 report $TEST_GROUP exclude -> to_exclude" + + ip link set dev br0 type bridge mcast_last_member_interval 100 + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861501 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 016A4C388F9 for ; Tue, 27 Oct 2020 19:01:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AF9CD21D41 for ; Tue, 27 Oct 2020 19:01:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="PTJAjWIX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S371443AbgJ0TBb (ORCPT ); Tue, 27 Oct 2020 15:01:31 -0400 Received: from mail-wm1-f49.google.com ([209.85.128.49]:52914 "EHLO mail-wm1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371395AbgJ0TAY (ORCPT ); Tue, 27 Oct 2020 15:00:24 -0400 Received: by mail-wm1-f49.google.com with SMTP id c194so2387463wme.2 for ; Tue, 27 Oct 2020 12:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hkVjZ+YIjaJPktJubl8CMRKBr4zOyIIs4Cgi4AHtLdg=; b=PTJAjWIXqOo10ByygiLJ17DkXHRBd0InDc1XoZkYKuJDCetemkNTNVfz90gu14BKh7 0BrMoX5uDOM0VJX9WcgZ4lqupcvM6DzRH9vBAbuq+/OfpLCjfR9dpU4gkopT3DAZuME9 M7qalhxnqYzcc7QCLJxbxNqFxk2HzsZcTviDPVGh2Tf3Ut4p6hHK8xrIPbjiTx2ANOKf Ooa/o+G7i9+OwYkAkt5+4gnJnAxAuGqioCvIJ8483O0aLVk5aN5JgDb0CIVPPstjHnXo 9KA90zhtNs/+EP5N8JDxEOcu7xn0Ste9Ck3JDQRrIJh7brvgRhMCyyJ1m5m+WXJbtMBq 0d8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hkVjZ+YIjaJPktJubl8CMRKBr4zOyIIs4Cgi4AHtLdg=; b=dCx1x+p7nvxE6ImwVRQ+NkSW+zCy3NBWl3NUB3ldmirsrqGkRw5fexpA2CRNqt8tL0 /M0OUtMQlxWUdI8yK7cxy8JnD2akyTG4//XuH6LQLDvy0fX8RPpQ7XC2lyamFNMUCXcM xr6RdresKaOcwcfIIsDk2qddl238/lVZwF43eKNmlcCS3jn6hbTvg8vlLdXD5jmf+BgP TvOLgzLrsUojDleXVkrW4LM+kzjNThHXUkP1M2YhrGx2GR2yS9aThRmw7R7NNaColdhs WvdPKp92qqcYVmW36KXntGoSOvEcs4r25AOjAZAKMY+lAvzzJ+P7QEddQBNW3SmKUxxE lshw== X-Gm-Message-State: AOAM532j8ux7Eafx8uqQi9UbPwfx3nrYxNxO1KX1amy4t+1rLitvtO8N OkOFHj1UIFkxOeOtJEjwgPOgVeCPiBoXmZ/a X-Google-Smtp-Source: ABdhPJzykSANs+MMEVckVqeXmwguDl6k4AlfnQ9uUtkIG4KhetLOK2QqJDR7NQLT6HotSLqdyArmsw== X-Received: by 2002:a1c:9641:: with SMTP id y62mr4356126wmd.145.1603825221626; Tue, 27 Oct 2020 12:00:21 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:21 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 13/16] selftests: net: bridge: add test for igmpv3 inc -> block report Date: Tue, 27 Oct 2020 20:59:31 +0200 Message-Id: <20201027185934.227040-14-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action INCLUDE (A) BLOCK (B) INCLUDE (A) Send Q(G,A*B) Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 3cfc30b88285..3772c7a066c9 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -3,7 +3,7 @@ ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test v3exc_is_include_test \ - v3exc_is_exclude_test v3exc_to_exclude_test" + v3exc_is_exclude_test v3exc_to_exclude_test v3inc_block_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -28,6 +28,8 @@ MZPKT_IS_EXC="22:00:da:b6:00:00:00:01:02:00:00:04:ef:0a:0a:0a:c0:00:02:01:c0:00: MZPKT_IS_EXC2="22:00:5e:b4:00:00:00:01:02:00:00:02:ef:0a:0a:0a:c0:00:02:14:c0:00:02:1e" # IGMPv3 to_ex report: grp 239.10.10.10 to_exclude 192.0.2.1,192.0.2.20,192.0.2.30 MZPKT_TO_EXC="22:00:9a:b1:00:00:00:01:04:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00:02:14:c0:00:02:1e" +# IGMPv3 block report: grp 239.10.10.10 block 192.0.2.1,192.0.2.20,192.0.2.30 +MZPKT_BLOCK="22:00:98:b1:00:00:00:01:06:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00:02:14:c0:00:02:1e" source lib.sh @@ -515,6 +517,35 @@ v3exc_to_exclude_test() v3cleanup $swp1 $TEST_GROUP } +v3inc_block_test() +{ + RET=0 + local X=("192.0.2.2" "192.0.2.3") + + v3include_prepare $h1 $ALL_MAC $ALL_GROUP + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_BLOCK" -q + # make sure the lowered timers have expired (by default 2 seconds) + sleep 3 + check_sg_entries "block" "${X[@]}" + + check_sg_state 0 "${X[@]}" + + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and + .source_list[].address == \"192.0.2.1\")" &>/dev/null + check_fail $? "Wrong *,G entry source list, 192.0.2.1 entry still exists" + + check_sg_fwding 1 "${X[@]}" + check_sg_fwding 0 "192.0.2.100" + + log_test "IGMPv3 report $TEST_GROUP include -> block" + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861491 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C925C55179 for ; Tue, 27 Oct 2020 19:01:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 481E020878 for ; Tue, 27 Oct 2020 19:01:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="OxLVWQZt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829224AbgJ0TBa (ORCPT ); Tue, 27 Oct 2020 15:01:30 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36867 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371396AbgJ0TAZ (ORCPT ); Tue, 27 Oct 2020 15:00:25 -0400 Received: by mail-wm1-f67.google.com with SMTP id c16so2552192wmd.2 for ; Tue, 27 Oct 2020 12:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rXvOjoiXH/uQM8+37yEq6MrhKgtwR9L0eCrT9iLe6Qo=; b=OxLVWQZtWHZlEulGIv4IbCCbNIE6gv5fH5OiotJy3xUlgg589tHOt+uawVwbXKZbIx snj1C4jhT6jyqLp5+sU2OAEFt8jByqWjEbYqkgSsrnXNy8L0YXQMlP91joSQY7cpnJun cSaY7t0DuugTuLZXI8J904bPjZkD5x+Gj+n7w2VwnCrq3PrECOKew+v9cwQkqgEC3yJ7 VSl6DQp5WpmkjgrcQJFkVVTDwxlkTcdo+/4PjrvswJ670GbRCPzxVCNVSV5oCeXCu6na 1Jbwuud5wkAGyroCRHHS/iFhfGkMDMd1YyeelAR29PMr5sbyOF0Rqfza8qGEcpXintVb 0QNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rXvOjoiXH/uQM8+37yEq6MrhKgtwR9L0eCrT9iLe6Qo=; b=bKfSivUjAXtBsJfL3STLtdjF/1vR4tVTo5XQ9/mqwMjVhmLmes6oKk9iN+w7mRIfj1 u/3xHxmJhwiBlxeefKVeQEU08eHzI4EJwL7jyhgo9h7BI/zytrf/vm73T7xTDnWEexQz dc+DL2dZwu/vaW/LwlUmEekqnu7W0jKbdXuHraUnXZISzRa3U3otQw2mRxeoN/nO1bBH KpT0hHqku19+bjprHLwpApBBmdJuTbhbxrJVtRJNGP187F111cJUM09A2RujshimDEzh S/4ey/LzA1Qp2G8EIptQHo4Efc5LVLZucxcCAihLSOOJQ9+TC7vAX54rxpvy4IY+xXKK Ow5Q== X-Gm-Message-State: AOAM530wv7YuiYHg7/FQIPagcOZ3o4PC1HwAcSNbIiVtDbRPqUmFbT6A FxJyK/0l6nKHNyncElmtDqfLOmSLp1911cpP X-Google-Smtp-Source: ABdhPJwAcaW1ba5rriVUYmgUsDy++FgCYJBlbpV9zOSafij9Xtz9VWEdU0OfSNh/DKOasbFGUHRYmw== X-Received: by 2002:a7b:c113:: with SMTP id w19mr4437014wmi.25.1603825222840; Tue, 27 Oct 2020 12:00:22 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:22 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 14/16] selftests: net: bridge: add test for igmpv3 exc -> block report Date: Tue, 27 Oct 2020 20:59:32 +0200 Message-Id: <20201027185934.227040-15-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action EXCLUDE (X,Y) BLOCK (A) EXCLUDE (X+(A-Y),Y) (A-X-Y)=Group Timer Send Q(G,A-Y) Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 3772c7a066c9..45c5619666d8 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -3,7 +3,7 @@ ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test v3exc_is_include_test \ - v3exc_is_exclude_test v3exc_to_exclude_test v3inc_block_test" + v3exc_is_exclude_test v3exc_to_exclude_test v3inc_block_test v3exc_block_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -546,6 +546,34 @@ v3inc_block_test() v3cleanup $swp1 $TEST_GROUP } +v3exc_block_test() +{ + RET=0 + local X=("192.0.2.1" "192.0.2.2" "192.0.2.30") + local Y=("192.0.2.20" "192.0.2.21") + + v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP + + ip link set dev br0 type bridge mcast_last_member_interval 500 + check_err $? "Could not change mcast_last_member_interval to 5s" + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_BLOCK" -q + sleep 1 + check_sg_entries "block" "${X[@]}" "${Y[@]}" + + check_sg_state 0 "${X[@]}" + check_sg_state 1 "${Y[@]}" + + check_sg_fwding 1 "${X[@]}" 192.0.2.100 + check_sg_fwding 0 "${Y[@]}" + + log_test "IGMPv3 report $TEST_GROUP exclude -> block" + + ip link set dev br0 type bridge mcast_last_member_interval 100 + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861483 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7E8BC55178 for ; Tue, 27 Oct 2020 19:01:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 898C221527 for ; Tue, 27 Oct 2020 19:01:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="B3t+dQ/Z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829235AbgJ0TBf (ORCPT ); Tue, 27 Oct 2020 15:01:35 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41585 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371397AbgJ0TA0 (ORCPT ); Tue, 27 Oct 2020 15:00:26 -0400 Received: by mail-wr1-f67.google.com with SMTP id s9so3113833wro.8 for ; Tue, 27 Oct 2020 12:00:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KUwIDVuHZxC8CM1QJ43pGK3dXQdVN5CV0sqGlBsC+08=; b=B3t+dQ/ZMMRClgJdoY14DL/k5UGsWQP38sZjmzFQd7RLR7qkuQk1EBXLiJTRJiNrw1 92oddnXE7M1avb9oEjN7p0/QVObZam7DxopYI2EMEgwOqD/lF4/4XlUzN1uVP3VKwtAK A1nsyIgF8xK/rugo4ODblyeV5Ssif8cVlEX3P+QMmD7bB66QKv29bWbBF1cD7qDg3wxA hyVxOj3YE165ebEvHl/uVkq741DDXaVuyn2rJ7kadooQ676fORbYxOrJbiw5Y1BdsWaH 0B8S4plE5OurnFsB+DlwItxmK9ERr6G1gcHsPL8o+RVQnEc3LmC9aCR78P627mD7ZnYz kH0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KUwIDVuHZxC8CM1QJ43pGK3dXQdVN5CV0sqGlBsC+08=; b=eTM4LjNEwQwfE+BI5cSVj9MPuW4JHGUl4xHwiMvp7sE0P6rVPorpdVI9y7mZM0p2c3 pOu62vY1fwvOppyQIdVuMZKqyR9RzyMzETPfScsV8SlJuYbXzMPsaBnhYo2WwRUNU4TG k/eVoV9ofg1x1aHTzzh+UX0OtZ7tv8x/ptGUvDw9y332EakMGTn3rFu7M8Mo01CiwC+i KebKJailTMWURK/R7cIXFzIKXtgan6o/MKRUTJWWOEo8VJOqJUJX4dLyJ87ViYsIcDh2 OBKVZ8ph6Zi6yQOJeBLJavSZ8WQ6+1fMPU/6HZ/l4j8bzt6AEXQjjRk34U5SGM4ggAuN OXfw== X-Gm-Message-State: AOAM530bVhoqtSQgq4s7AOMqpYTT1r/d1HyjXj4afhktagegw4TV5BXg pP1pvwVTvGMfcijbp3wmwMyT8QYnK1PvIaib X-Google-Smtp-Source: ABdhPJzvT/ZlEfqgxAcgH92K0h8DlZLP1JqONyLOH87tppbgYxW9DPuab304ZhyFExvldGBnhee+oA== X-Received: by 2002:adf:80c8:: with SMTP id 66mr4566237wrl.415.1603825223987; Tue, 27 Oct 2020 12:00:23 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:23 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 15/16] selftests: net: bridge: add test for igmpv3 exclude timeout Date: Tue, 27 Oct 2020 20:59:33 +0200 Message-Id: <20201027185934.227040-16-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov Test that when a group in exclude mode expires it changes mode to include and the blocked entries are deleted. Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 45c5619666d8..db0a03e30868 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -3,7 +3,8 @@ ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test v3exc_is_include_test \ - v3exc_is_exclude_test v3exc_to_exclude_test v3inc_block_test v3exc_block_test" + v3exc_is_exclude_test v3exc_to_exclude_test v3inc_block_test v3exc_block_test \ + v3exc_timeout_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -574,6 +575,52 @@ v3exc_block_test() v3cleanup $swp1 $TEST_GROUP } +v3exc_timeout_test() +{ + RET=0 + local X=("192.0.2.20" "192.0.2.30") + + # GMI should be 3 seconds + ip link set dev br0 type bridge mcast_query_interval 100 mcast_query_response_interval 100 + + v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP + ip link set dev br0 type bridge mcast_query_interval 500 mcast_query_response_interval 500 + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_ALLOW2" -q + sleep 3 + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and .filter_mode == \"include\")" &>/dev/null + check_err $? "Wrong *,G entry filter mode" + + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and + .source_list[].address == \"192.0.2.1\")" &>/dev/null + check_fail $? "Wrong *,G entry source list, 192.0.2.1 entry still exists" + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and + .source_list[].address == \"192.0.2.2\")" &>/dev/null + check_fail $? "Wrong *,G entry source list, 192.0.2.2 entry still exists" + + check_sg_entries "allow" "${X[@]}" + + check_sg_state 0 "${X[@]}" + + check_sg_fwding 1 "${X[@]}" + check_sg_fwding 0 192.0.2.100 + + log_test "IGMPv3 group $TEST_GROUP exclude timeout" + + ip link set dev br0 type bridge mcast_query_interval 12500 \ + mcast_query_response_interval 1000 + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 11861487 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F722C4363A for ; Tue, 27 Oct 2020 19:01:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED2B821527 for ; Tue, 27 Oct 2020 19:01:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="OpuUHStq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829227AbgJ0TBe (ORCPT ); Tue, 27 Oct 2020 15:01:34 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36871 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371399AbgJ0TA2 (ORCPT ); Tue, 27 Oct 2020 15:00:28 -0400 Received: by mail-wm1-f67.google.com with SMTP id c16so2552288wmd.2 for ; Tue, 27 Oct 2020 12:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HWwH1mzK26OWStIyr7YQx947cp92x7ujWn8BN7kPbwM=; b=OpuUHStqMculoVADiWHShDs8jkbf6mK4yTc4KiX2t5Tru35iyhx3OjPGf4omufYeJq 48Vha9bTSNQ45A6ZbF97QFusOaeyQ5pzXRWZ0Xnbulxx8HIoCbsX9e6GC98u7nLDLkyy NtvzKZEc9WEvGEPNL3D3/TOah2z7SRiLsW91bmPgqDzy9zgi3oJS7GOqPZZH1da+rwo1 SJtGDzjkc/ZB9nABYEHVPuzazu7Xz+qwytjWc3VetNZjerP0G/QiiUDKHWNEomjhWJzZ etO5OfBG4tyTCvLJy5cm6N/nNGlzoKyqshPzi52Nxo4nEr9ma8U0UGgAnm493MKwl3gC Bb7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HWwH1mzK26OWStIyr7YQx947cp92x7ujWn8BN7kPbwM=; b=S+uz+xBei/1un7ZOhKdHFgt1O2OLCW9+ti4oPSNHA4dziywoz3WoONo6QPaBOmgkc9 ccv130vbt8A3y9Mcw0aWMkpLTBK+QJstbTs8KH8uYsFVIGHjCA3+puYPKHo4DvTEurSN d6AC/x6hbnq/+q+VIjaeP+ry+LCFbQEXPmDK6zmqUAEIW2Gia8XNsWoffGQeynOzR1Ti LLH8Uqo0BMJcRBXTVp39UDYnu2LV9tPhmAmtEjfwQun5dukiKEWKk6PPwDfba9aUHJnH WJ6I44DrCACqx5vNr8qXW0RM/gELH9pjeu1KbedW5CA1t92APng+OL7G3aJgLkzbgh3E krBQ== X-Gm-Message-State: AOAM5320kNIPP/tNBoIyj407lCJoN606rM/DbMnKGYQ68BUnep+YZrJM swYxey5ScGPk0j5cLfcCUd5xgH0Jl+GjT80E X-Google-Smtp-Source: ABdhPJxxo103u+lxleVTEnlhpF+mLQdkEkTDFatbmlZ4/KjzqV69h9H52pHB2LImZcZmsTNPIa/tmw== X-Received: by 2002:a7b:cc09:: with SMTP id f9mr4166353wmh.93.1603825225122; Tue, 27 Oct 2020 12:00:25 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:24 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 16/16] selftests: net: bridge: add test for igmpv3 *,g auto-add Date: Tue, 27 Oct 2020 20:59:34 +0200 Message-Id: <20201027185934.227040-17-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Nikolay Aleksandrov When we have *,G ports in exclude mode and a new S,G,port is added the kernel has to automatically create an S,G entry for each exclude port to get proper forwarding. Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index db0a03e30868..0e71abdd7a03 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -4,7 +4,7 @@ ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test v3exc_is_include_test \ v3exc_is_exclude_test v3exc_to_exclude_test v3inc_block_test v3exc_block_test \ - v3exc_timeout_test" + v3exc_timeout_test v3star_ex_auto_add_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -621,6 +621,35 @@ v3exc_timeout_test() v3cleanup $swp1 $TEST_GROUP } +v3star_ex_auto_add_test() +{ + RET=0 + + v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP + + $MZ $h2 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_IS_INC" -q + sleep 1 + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and .src == \"192.0.2.3\" and \ + .port == \"$swp1\")" &>/dev/null + check_err $? "S,G entry for *,G port doesn't exist" + + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and .src == \"192.0.2.3\" and \ + .port == \"$swp1\" and \ + .flags[] == \"added_by_star_ex\")" &>/dev/null + check_err $? "Auto-added S,G entry doesn't have added_by_star_ex flag" + + check_sg_fwding 1 192.0.2.3 + + log_test "IGMPv3 S,G port entry automatic add to a *,G port" + + v3cleanup $swp1 $TEST_GROUP + v3cleanup $swp2 $TEST_GROUP +} + trap cleanup EXIT setup_prepare