diff options
author | Nikolay Aleksandrov <nikolay@nvidia.com> | 2021-11-25 17:08:54 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-11-27 03:43:13 +0300 |
commit | a45fe974173668c1cbd1e23eb9fabdb5b17ae0be (patch) | |
tree | b8f27c8fe8190b09867cd074e85f00cc0f29249c /tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh | |
parent | bdf1b2c05e09b239f553c0ee828e2f851f4a1b47 (diff) | |
download | linux-a45fe974173668c1cbd1e23eb9fabdb5b17ae0be.tar.xz |
selftests: net: bridge: add vlan mcast_membership_interval test
Add a test which changes the new per-vlan mcast_membership_interval and
verifies that a newly learned mdb entry would expire in that interval.
TEST: Vlan mcast_membership_interval global option default value [ OK ]
TEST: Vlan 10 mcast_membership_interval option changed to 200 [ OK ]
TEST: Vlan 10 mcast_membership_interval mdb entry expire [ OK ]
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh')
-rwxr-xr-x | tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh b/tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh index 0070d8292569..87dcd49b0a8d 100755 --- a/tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh +++ b/tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0 ALL_TESTS="vlmc_control_test vlmc_querier_test vlmc_igmp_mld_version_test \ - vlmc_last_member_test vlmc_startup_query_test" + vlmc_last_member_test vlmc_startup_query_test vlmc_membership_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -358,6 +358,32 @@ vlmc_startup_query_test() bridge vlan global set vid 10 dev br0 mcast_snooping 1 mcast_startup_query_count 2 } +vlmc_membership_test() +{ + RET=0 + local goutput=`bridge -j vlan global show` + echo -n $goutput | + jq -e ".[].vlans[] | select(.vlan == 10)" &>/dev/null + check_err $? "Could not find vlan 10's global options" + + echo -n $goutput | + jq -e ".[].vlans[] | select(.vlan == 10 and \ + .mcast_membership_interval == 26000) " &>/dev/null + check_err $? "Wrong default mcast_membership_interval global vlan option value" + log_test "Vlan mcast_membership_interval global option default value" + + RET=0 + bridge vlan global set vid 10 dev br0 mcast_snooping 1 mcast_membership_interval 200 + check_err $? "Could not set mcast_membership_interval in vlan 10" + log_test "Vlan 10 mcast_membership_interval option changed to 200" + + RET=0 + vlmc_v2join_test 1 + log_test "Vlan 10 mcast_membership_interval mdb entry expire" + + bridge vlan global set vid 10 dev br0 mcast_snooping 1 mcast_membership_interval 26000 +} + trap cleanup EXIT setup_prepare |