2 # SPDX-License-Identifier: GPL-2.0
4 ALL_TESTS
="ping_ipv4 ping_ipv6 learning flooding vlan_deletion extern_learn"
11 simple_if_init
$h1 192.0.2.1/24 2001:db8
:1::1/64
16 simple_if_fini
$h1 192.0.2.1/24 2001:db8
:1::1/64
21 simple_if_init
$h2 192.0.2.2/24 2001:db8
:1::2/64
26 simple_if_fini
$h2 192.0.2.2/24 2001:db8
:1::2/64
31 # 10 Seconds ageing time.
32 ip link add dev br0
type bridge vlan_filtering
1 ageing_time
1000 \
35 ip link
set dev
$swp1 master br0
36 ip link
set dev
$swp2 master br0
38 ip link
set dev br0 up
39 ip link
set dev
$swp1 up
40 ip link
set dev
$swp2 up
45 ip link
set dev
$swp2 down
46 ip link
set dev
$swp1 down
81 ping_test
$h1 192.0.2.2
86 ping6_test
$h1 2001:db8
:1::2
91 learning_test
"br0" $swp1 $h1 $h2
96 flood_test
$swp2 $h1 $h2
101 # Test that the deletion of a VLAN on a bridge port does not affect
103 log_info
"Add and delete a VLAN on bridge port $swp1"
105 bridge vlan add vid
10 dev
$swp1
106 bridge vlan del vid
10 dev
$swp1
114 local mac
=de
:ad
:be
:ef
:13:37
117 # Test that externally learned FDB entries can roam, but not age out
120 bridge fdb add de
:ad
:be
:ef
:13:37 dev
$swp1 master extern_learn vlan
1
122 bridge fdb show brport
$swp1 |
grep -q de
:ad
:be
:ef
:13:37
123 check_err $?
"Did not find FDB entry when should"
125 # Wait for 10 seconds after the ageing time to make sure the FDB entry
127 ageing_time
=$
(bridge_ageing_time_get br0
)
128 sleep $
((ageing_time
+ 10))
130 bridge fdb show brport
$swp1 |
grep -q de
:ad
:be
:ef
:13:37
131 check_err $?
"FDB entry was aged out when should not"
133 $MZ $h2 -c 1 -p 64 -a $mac -t ip
-q
135 bridge fdb show brport
$swp2 |
grep -q de
:ad
:be
:ef
:13:37
136 check_err $?
"FDB entry did not roam when should"
138 log_test
"Externally learned FDB entry - ageing & roaming"
140 bridge fdb del de
:ad
:be
:ef
:13:37 dev
$swp2 master vlan
1 &> /dev
/null
141 bridge fdb del de
:ad
:be
:ef
:13:37 dev
$swp1 master vlan
1 &> /dev
/null