Skip to content

Commit

Permalink
selftests: forwarding: Fix bridge MDB test flakiness
Browse files Browse the repository at this point in the history
After enabling a multicast querier on the bridge (like the test is
doing), the bridge will wait for the Max Response Delay before starting
to forward according to its MDB in order to let Membership Reports
enough time to be received and processed.

Currently, the test is waiting for exactly the default Max Response
Delay (10 seconds) which is racy and leads to failures [1].

Fix by reducing the Max Response Delay to 1 second.

[1]
 [...]
 # TEST: IPv4 host entries forwarding tests                            [FAIL]
 # Packet locally received after flood

Fixes: b6d00da ("selftests: forwarding: Add bridge MDB test")
Signed-off-by: Ido Schimmel <[email protected]>
Reviewed-by: Hangbin Liu <[email protected]>
Acked-by: Nikolay Aleksandrov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
idosch authored and kuba-moo committed Feb 9, 2024
1 parent 9359084 commit 7399e2c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/testing/selftests/net/forwarding/bridge_mdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1252,21 +1252,25 @@ fwd_test()
echo
log_info "# Forwarding tests"

# Set the Max Response Delay to 100 centiseconds (1 second) so that the
# bridge will start forwarding according to its MDB soon after a
# multicast querier is enabled.
ip link set dev br0 type bridge mcast_query_response_interval 100

# Forwarding according to MDB entries only takes place when the bridge
# detects that there is a valid querier in the network. Set the bridge
# as the querier and assign it a valid IPv6 link-local address to be
# used as the source address for MLD queries.
ip -6 address add fe80::1/64 nodad dev br0
ip link set dev br0 type bridge mcast_querier 1
# Wait the default Query Response Interval (10 seconds) for the bridge
# to determine that there are no other queriers in the network.
sleep 10

fwd_test_host
fwd_test_port

ip link set dev br0 type bridge mcast_querier 0
ip -6 address del fe80::1/64 dev br0
ip link set dev br0 type bridge mcast_query_response_interval 1000
}

ctrl_igmpv3_is_in_test()
Expand Down

0 comments on commit 7399e2c

Please sign in to comment.