Skip to content

Commit

Permalink
selftests: mlxsw: extack: Test creation of multiple VLAN-aware bridges
Browse files Browse the repository at this point in the history
The driver supports a single VLAN-aware bridge. Test that the
enslavement of a port to the second VLAN-aware bridge fails with an
extack.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Feb 17, 2020
1 parent bdc58be commit 6c4e61f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tools/testing/selftests/drivers/net/mlxsw/extack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ALL_TESTS="
netdev_pre_up_test
vxlan_vlan_add_test
vxlan_bridge_create_test
bridge_create_test
"
NUM_NETIFS=2
source $lib_dir/lib.sh
Expand Down Expand Up @@ -137,6 +138,28 @@ vxlan_bridge_create_test()
ip link del dev vx1
}

bridge_create_test()
{
RET=0

ip link add name br1 up type bridge vlan_filtering 1
ip link add name br2 up type bridge vlan_filtering 1

ip link set dev $swp1 master br1
check_err $?

# Only one VLAN-aware bridge is supported, so this should fail with
# an extack.
ip link set dev $swp2 master br2 2>&1 > /dev/null \
| grep -q mlxsw_spectrum
check_err $?

log_test "extack - multiple VLAN-aware bridges creation"

ip link del dev br2
ip link del dev br1
}

trap cleanup EXIT

setup_prepare
Expand Down

0 comments on commit 6c4e61f

Please sign in to comment.