Skip to contentSkip to conversation

selftests: net: Add tests to verify team driver option set and get.

PATCH Applied Marc Harvey 2 participants 2 messages Sep 5, 2025 – Sep 11, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 selftests: net: Add tests to verify team driver option set and get.

There are currently no kernel tests that verify setting and getting options of the team driver.

In the future, options may be added that implicitly change other options, which will make it useful to have tests like these that show nothing breaks. There will be a follow up patch to this that adds new "rx_enabled" and "tx_enabled" options, which will implicitly affect the "enabled" option value and vice versa.

The tests use teamnl to first set options to specific values and then gets them to compare to the set values.

---
Changes in v3:
- Applied minor style changes based on v2 feedback.
- Link to v2: https://lore.kernel.org/netdev/[email protected]/

Changes in v2:
- Fixed shellcheck failures.
- Fixed test failing in vng by adding a config option to enable the
team driver's active backup mode.
- Link to v1: https://lore.kernel.org/netdev/[email protected]/

 .../selftests/drivers/net/team/Makefile       |   6 +-
 .../testing/selftests/drivers/net/team/config |   1 +
 .../selftests/drivers/net/team/options.sh     | 188 ++++++++++++++++++
 3 files changed, 193 insertions(+), 2 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/team/options.sh
tools/testing/selftests/drivers/net/team/Makefile +4 -2
index eaf6938f100e..89d854c7e674 100644
@@ -1,11 +1,13 @@
 # SPDX-License-Identifier: GPL-2.0
 # Makefile for net selftests
 
-TEST_PROGS := dev_addr_lists.sh propagation.sh
+TEST_PROGS := dev_addr_lists.sh propagation.sh options.sh
 
 TEST_INCLUDES := \
 	../bonding/lag_lib.sh \
 	../../../net/forwarding/lib.sh \
-	../../../net/lib.sh
+	../../../net/lib.sh \
+	../../../net/in_netns.sh \
+	../../../net/lib/sh/defer.sh
 
 include ../../../lib.mk
tools/testing/selftests/drivers/net/team/config +1 -0
index 636b3525b679..558e1d0cf565 100644
@@ -3,4 +3,5 @@ CONFIG_IPV6=y
 CONFIG_MACVLAN=y
 CONFIG_NETDEVSIM=m
 CONFIG_NET_TEAM=y
+CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=y
 CONFIG_NET_TEAM_MODE_LOADBALANCE=y
tools/testing/selftests/drivers/net/team/options.sh new file +188 -0

188 lines not on this page · raw message

Signature · 1 line
2.51.0.384.g4c02a37b29-goog
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 10 lines · On Fri, 5 Sep 2025 04:04:41 +0000 you wrote:

There are currently no kernel tests that verify setting and getting options of the team driver.

In the future, options may be added that implicitly change other options, which will make it useful to have tests like these that show nothing breaks. There will be a follow up patch to this that adds new "rx_enabled" and "tx_enabled" options, which will implicitly affect the "enabled" option value and vice versa.

[...]

Here is the summary with links:
- [net-next,v3] selftests: net: Add tests to verify team driver option set and get.

    https://git.kernel.org/netdev/net-next/c/db1b60066686

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html