Commit 479a2b76 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

selftests: forwarding: Add a test case for externally learned FDB entries

Test that externally learned FDB entries can roam, but not age out.
Signed-off-by: 's avatarIdo Schimmel <idosch@mellanox.com>
Reviewed-by: 's avatarPetr Machata <petrm@mellanox.com>
Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
parent 72159272
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
ALL_TESTS="ping_ipv4 ping_ipv6 learning flooding vlan_deletion"
ALL_TESTS="ping_ipv4 ping_ipv6 learning flooding vlan_deletion extern_learn"
NUM_NETIFS=4
CHECK_TC="yes"
source lib.sh
......@@ -109,6 +109,38 @@ vlan_deletion()
ping_ipv6
}
extern_learn()
{
local mac=de:ad:be:ef:13:37
local ageing_time
# Test that externally learned FDB entries can roam, but not age out
RET=0
bridge fdb add de:ad:be:ef:13:37 dev $swp1 master extern_learn vlan 1
bridge fdb show brport $swp1 | grep -q de:ad:be:ef:13:37
check_err $? "Did not find FDB entry when should"
# Wait for 10 seconds after the ageing time to make sure the FDB entry
# was not aged out
ageing_time=$(bridge_ageing_time_get br0)
sleep $((ageing_time + 10))
bridge fdb show brport $swp1 | grep -q de:ad:be:ef:13:37
check_err $? "FDB entry was aged out when should not"
$MZ $h2 -c 1 -p 64 -a $mac -t ip -q
bridge fdb show brport $swp2 | grep -q de:ad:be:ef:13:37
check_err $? "FDB entry did not roam when should"
log_test "Externally learned FDB entry - ageing & roaming"
bridge fdb del de:ad:be:ef:13:37 dev $swp2 master vlan 1 &> /dev/null
bridge fdb del de:ad:be:ef:13:37 dev $swp1 master vlan 1 &> /dev/null
}
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