summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPetr Machata <petrm@nvidia.com>2023-08-08 15:18:16 +0200
committerJakub Kicinski <kuba@kernel.org>2023-08-09 15:27:51 -0700
commitaae5bb8d18d8ca00d658720710a490eebaf9087d (patch)
tree74b9c171737cd8ca325f74b623b5e81c5c9aec1c /tools
parenta76ca8afd45af103fc61217eebe90cae7c02cf6c (diff)
selftests: mlxsw: router_bridge_lag: Add a new selftest
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>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/drivers/net/mlxsw/router_bridge_lag.sh50
1 files changed, 50 insertions, 0 deletions
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
index 000000000000..6ce317cfaf9b
--- /dev/null
+++ b/tools/testing/selftests/drivers/net/mlxsw/router_bridge_lag.sh
@@ -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