selftests: mlxsw: router_bridge_lag: Add a new selftest
authorPetr Machata <petrm@nvidia.com>
Tue, 8 Aug 2023 13:18:16 +0000 (15:18 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 9 Aug 2023 22:27:51 +0000 (15:27 -0700)
Add a selftest to verify enslavement to a LAG with upper after fresh
devlink reload.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/373a7754daa4dac32759a45095f47b08a2a869c8.1691498735.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/mlxsw/router_bridge_lag.sh [new file with mode: 0755]

diff --git a/tools/testing/selftests/drivers/net/mlxsw/router_bridge_lag.sh b/tools/testing/selftests/drivers/net/mlxsw/router_bridge_lag.sh
new file mode 100755 (executable)
index 0000000..6ce317c
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+# Test enslavement to LAG with a clean slate.
+# See $lib_dir/router_bridge_lag.sh for further details.
+
+ALL_TESTS="
+       config_devlink_reload
+       config_enslave_h1
+       config_enslave_h2
+       config_enslave_h3
+       config_enslave_h4
+       config_enslave_swp1
+       config_enslave_swp2
+       config_enslave_swp3
+       config_enslave_swp4
+       config_wait
+       ping_ipv4
+       ping_ipv6
+"
+
+config_devlink_reload()
+{
+       log_info "Devlink reload"
+       devlink_reload
+}
+
+config_enslave_h1()
+{
+       config_enslave $h1 lag1
+}
+
+config_enslave_h2()
+{
+       config_enslave $h2 lag4
+}
+
+config_enslave_h3()
+{
+       config_enslave $h3 lag4
+}
+
+config_enslave_h4()
+{
+       config_enslave $h4 lag1
+}
+
+lib_dir=$(dirname $0)/../../../net/forwarding
+EXTRA_SOURCE="source $lib_dir/devlink_lib.sh"
+source $lib_dir/router_bridge_lag.sh