selftests: net: bridge: update IGMP/MLD membership interval value
authorNikolay Aleksandrov <nikolay@nvidia.com>
Fri, 29 Oct 2021 12:05:27 +0000 (15:05 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:44 +0000 (19:16 +0100)
[ Upstream commit 34d7ecb3d4f772eb00ce1f7195ae30886ddf4d2e ]

When I fixed IGMPv3/MLDv2 to use the bridge's multicast_membership_interval
value which is chosen by user-space instead of calculating it based on
multicast_query_interval and multicast_query_response_interval I forgot
to update the selftests relying on that behaviour. Now we have to
manually set the expected GMI value to perform the tests correctly and get
proper results (similar to IGMPv2 behaviour).

Fixes: fac3cb82a54a ("net: bridge: mcast: use multicast_membership_interval for IGMPv3")
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/net/forwarding/bridge_igmp.sh
tools/testing/selftests/net/forwarding/bridge_mld.sh

index 675eff45b03717007a8437695b7b5945d1f1467f..1162836f8f3293c14f47244badc208eb4ec675d7 100755 (executable)
@@ -482,10 +482,15 @@ v3exc_timeout_test()
        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
+       ip link set dev br0 type bridge mcast_query_interval 100 \
+                                       mcast_query_response_interval 100 \
+                                       mcast_membership_interval 300
 
        v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP
-       ip link set dev br0 type bridge mcast_query_interval 500 mcast_query_response_interval 500
+       ip link set dev br0 type bridge mcast_query_interval 500 \
+                                       mcast_query_response_interval 500 \
+                                       mcast_membership_interval 1500
+
        $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 \
@@ -517,7 +522,8 @@ v3exc_timeout_test()
        log_test "IGMPv3 group $TEST_GROUP exclude timeout"
 
        ip link set dev br0 type bridge mcast_query_interval 12500 \
-                                       mcast_query_response_interval 1000
+                                       mcast_query_response_interval 1000 \
+                                       mcast_membership_interval 26000
 
        v3cleanup $swp1 $TEST_GROUP
 }
index ffdcfa87ca2bae05b117635f2ef36d25e29340b8..e2b9ff773c6b603d84b01075c44754def58b4aad 100755 (executable)
@@ -479,10 +479,15 @@ mldv2exc_timeout_test()
        local X=("2001:db8:1::20" "2001:db8:1::30")
 
        # GMI should be 3 seconds
-       ip link set dev br0 type bridge mcast_query_interval 100 mcast_query_response_interval 100
+       ip link set dev br0 type bridge mcast_query_interval 100 \
+                                       mcast_query_response_interval 100 \
+                                       mcast_membership_interval 300
 
        mldv2exclude_prepare $h1
-       ip link set dev br0 type bridge mcast_query_interval 500 mcast_query_response_interval 500
+       ip link set dev br0 type bridge mcast_query_interval 500 \
+                                       mcast_query_response_interval 500 \
+                                       mcast_membership_interval 1500
+
        $MZ $h1 -c 1 $MZPKT_ALLOW2 -q
        sleep 3
        bridge -j -d -s mdb show dev br0 \
@@ -514,7 +519,8 @@ mldv2exc_timeout_test()
        log_test "MLDv2 group $TEST_GROUP exclude timeout"
 
        ip link set dev br0 type bridge mcast_query_interval 12500 \
-                                       mcast_query_response_interval 1000
+                                       mcast_query_response_interval 1000 \
+                                       mcast_membership_interval 26000
 
        mldv2cleanup $swp1
 }