summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2024-08-15 02:06:57 +0200
committerDavid S. Miller <davem@davemloft.net>2024-08-16 10:59:31 +0200
commit5b8e74182ed3d4f1c38c626e6120275ca9d92bee (patch)
treedd70ea62477592034df55485420c67c8fdfeca9b /tools
parentselftests: net: local_termination: parameterize test name (diff)
downloadlinux-5b8e74182ed3d4f1c38c626e6120275ca9d92bee.tar.xz
linux-5b8e74182ed3d4f1c38c626e6120275ca9d92bee.zip
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 <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/net/forwarding/local_termination.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/tools/testing/selftests/net/forwarding/local_termination.sh b/tools/testing/selftests/net/forwarding/local_termination.sh
index af284edaf401..5aa364b40e33 100755
--- a/tools/testing/selftests/net/forwarding/local_termination.sh
+++ b/tools/testing/selftests/net/forwarding/local_termination.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
-ALL_TESTS="standalone bridge"
+ALL_TESTS="standalone vlan_unaware_bridge vlan_aware_bridge"
NUM_NETIFS=2
PING_COUNT=1
REQUIRE_MTOOLS=yes
@@ -233,7 +233,9 @@ h2_destroy()
bridge_create()
{
- ip link add br0 type bridge
+ local vlan_filtering=$1
+
+ ip link add br0 type bridge vlan_filtering $vlan_filtering
ip link set br0 address $BRIDGE_ADDR
ip link set br0 up
@@ -277,10 +279,12 @@ standalone()
h1_destroy
}
-bridge()
+test_bridge()
{
+ local vlan_filtering=$1
+
h1_create
- bridge_create
+ bridge_create $vlan_filtering
macvlan_create br0
run_test $h1 br0
@@ -290,6 +294,16 @@ bridge()
h1_destroy
}
+vlan_unaware_bridge()
+{
+ test_bridge 0
+}
+
+vlan_aware_bridge()
+{
+ test_bridge 1
+}
+
cleanup()
{
pre_cleanup