]> git.dujemihanovic.xyz Git - linux.git/commitdiff
selftests: net: local_termination: add one more test for VLAN-aware bridges
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 15 Aug 2024 00:06:57 +0000 (03:06 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Aug 2024 08:59:31 +0000 (09:59 +0100)
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>
tools/testing/selftests/net/forwarding/local_termination.sh

index af284edaf4014f0bd0485619ea920c842e437fc5..5aa364b40e335f17e604e2b972d4db10e63d6506 100755 (executable)
@@ -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