Skip to content

Commit 5b8e741

Browse files
vladimirolteandavem330
authored andcommitted
selftests: net: local_termination: add one more test for VLAN-aware bridges
The current bridge() test is for packet reception on a VLAN-unaware bridge. Some things are different enough with VLAN-aware bridges that it's worth renaming this test into vlan_unaware_bridge(), and add a new vlan_aware_bridge() test. The two will share the same implementation: bridge() becomes a common function, which receives $vlan_filtering as an argument. Rename it to test_bridge() at the same time, because just bridge() pollutes the global namespace and we cannot invoke the binary with the same name from the iproute2 package currently. Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent df7cf5c commit 5b8e741

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

tools/testing/selftests/net/forwarding/local_termination.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# SPDX-License-Identifier: GPL-2.0
33

4-
ALL_TESTS="standalone bridge"
4+
ALL_TESTS="standalone vlan_unaware_bridge vlan_aware_bridge"
55
NUM_NETIFS=2
66
PING_COUNT=1
77
REQUIRE_MTOOLS=yes
@@ -233,7 +233,9 @@ h2_destroy()
233233

234234
bridge_create()
235235
{
236-
ip link add br0 type bridge
236+
local vlan_filtering=$1
237+
238+
ip link add br0 type bridge vlan_filtering $vlan_filtering
237239
ip link set br0 address $BRIDGE_ADDR
238240
ip link set br0 up
239241

@@ -277,10 +279,12 @@ standalone()
277279
h1_destroy
278280
}
279281

280-
bridge()
282+
test_bridge()
281283
{
284+
local vlan_filtering=$1
285+
282286
h1_create
283-
bridge_create
287+
bridge_create $vlan_filtering
284288
macvlan_create br0
285289

286290
run_test $h1 br0
@@ -290,6 +294,16 @@ bridge()
290294
h1_destroy
291295
}
292296

297+
vlan_unaware_bridge()
298+
{
299+
test_bridge 0
300+
}
301+
302+
vlan_aware_bridge()
303+
{
304+
test_bridge 1
305+
}
306+
293307
cleanup()
294308
{
295309
pre_cleanup

0 commit comments

Comments
 (0)