Commit b4ce7b95 authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by Jakub Kicinski

selftests: net: bridge: add vlan mcast query and query response interval tests

Add tests which change the new per-vlan mcast_query_interval and verify
the new value is in effect, also add a test to change
mcast_query_response_interval's value.

TEST: Vlan mcast_query_interval global option default value         [ OK ]
TEST: Vlan 10 mcast_query_interval option changed to 200            [ OK ]
TEST: Vlan mcast_query_response_interval global option default value   [ OK ]
TEST: Vlan 10 mcast_query_response_interval option changed to 200   [ OK ]
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 4d8610ee
......@@ -3,7 +3,7 @@
ALL_TESTS="vlmc_control_test vlmc_querier_test vlmc_igmp_mld_version_test \
vlmc_last_member_test vlmc_startup_query_test vlmc_membership_test \
vlmc_querier_intvl_test"
vlmc_querier_intvl_test vlmc_query_intvl_test vlmc_query_response_intvl_test"
NUM_NETIFS=4
CHECK_TC="yes"
TEST_GROUP="239.10.10.10"
......@@ -422,6 +422,55 @@ vlmc_querier_intvl_test()
bridge vlan global set vid 10 dev br0 mcast_snooping 1 mcast_querier_interval 25500
}
vlmc_query_intvl_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_query_interval == 12500) " &>/dev/null
check_err $? "Wrong default mcast_query_interval global vlan option value"
log_test "Vlan mcast_query_interval global option default value"
RET=0
bridge vlan global set vid 10 dev br0 mcast_snooping 1 mcast_startup_query_count 0
bridge vlan global set vid 10 dev br0 mcast_snooping 1 mcast_query_interval 200
check_err $? "Could not set mcast_query_interval in vlan 10"
# 1 is sent immediately, then 2 more in the next 5 seconds
vlmc_check_query igmp 2 $swp1 3 5
check_err $? "Wrong number of tagged IGMPv2 general queries sent"
log_test "Vlan 10 mcast_query_interval option changed to 200"
bridge vlan global set vid 10 dev br0 mcast_snooping 1 mcast_startup_query_count 2
bridge vlan global set vid 10 dev br0 mcast_snooping 1 mcast_query_interval 12500
}
vlmc_query_response_intvl_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_query_response_interval == 1000) " &>/dev/null
check_err $? "Wrong default mcast_query_response_interval global vlan option value"
log_test "Vlan mcast_query_response_interval global option default value"
RET=0
bridge vlan global set vid 10 dev br0 mcast_snooping 1 mcast_query_response_interval 200
check_err $? "Could not set mcast_query_response_interval in vlan 10"
log_test "Vlan 10 mcast_query_response_interval option changed to 200"
bridge vlan global set vid 10 dev br0 mcast_snooping 1 mcast_query_response_interval 1000
}
trap cleanup EXIT
setup_prepare
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment