selftests: net: More small fixes
Subsystems (6)
cover selftests: net: More small fixes
Some small fixes for net selftests which follow from these recent commits:dd2d40acdbb2 ("selftests: bonding: Add more missing config options") 49078c1b80b6 ("selftests: forwarding: Remove executable bits from lib.sh")
Benjamin Poirier (5):
selftests: team: Add missing config options
selftests: bonding: Check initial state
selftests: net: Remove executable bits from library scripts
selftests: net: List helper scripts in TEST_FILES Makefile variable
selftests: forwarding: List helper scripts in TEST_FILES Makefile
variable
.../testing/selftests/drivers/net/bonding/lag_lib.sh | 11 +++++++++++ tools/testing/selftests/drivers/net/team/config | 4 +++- tools/testing/selftests/net/Makefile | 5 ++--- tools/testing/selftests/net/forwarding/Makefile | 2 +- tools/testing/selftests/net/net_helper.sh | 0 tools/testing/selftests/net/setup_loopback.sh | 0 6 files changed, 17 insertions(+), 5 deletions(-) mode change 100755 => 100644 tools/testing/selftests/net/net_helper.sh mode change 100755 => 100644 tools/testing/selftests/net/setup_loopback.sh
Signature · 1 line
2.43.0
PATCH 1/5 selftests: team: Add missing config options
Similar to commit dd2d40acdbb2 ("selftests: bonding: Add more missing config options"), add more networking-specific config options which are needed for team device tests.
For testing, I used the minimal config generated by virtme-ng and I added the options in the config file. Afterwards, the team device test passed.
--- tools/testing/selftests/drivers/net/team/config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/drivers/net/team/config +3 -1
@@ -1,3 +1,5 @@ +CONFIG_DUMMY=y +CONFIG_IPV6=y +CONFIG_MACVLAN=y CONFIG_NET_TEAM=y CONFIG_NET_TEAM_MODE_LOADBALANCE=y -CONFIG_MACVLAN=y
Signature · 1 line
2.43.0
PATCH 2/5 selftests: bonding: Check initial state
In reply to Benjamin PoirierThe purpose of the test_LAG_cleanup() function is to check that some hardware addresses are removed from underlying devices after they have been unenslaved. The test function simply checks that those addresses are not present at the end. However, if the addresses were never added to begin with due to some error in device setup, the test function currently passes. This is a false positive since in that situation the test did not actually exercise the intended functionality.
Add a check that the expected addresses are indeed present after device setup. This makes the test function more robust.
I noticed this problem when running the team/dev_addr_lists.sh test on a system without support for dummy and ipv6:
tools/testing/selftests/drivers/net/team# ./dev_addr_lists.sh
Error: Unknown device type.
Error: Unknown device type.
This program is not intended to be run as root. RTNETLINK answers: Operation not supported
TEST: team cleanup mode lacp [ OK ]
--- .../testing/selftests/drivers/net/bonding/lag_lib.sh | 11 +++++++++++ 1 file changed, 11 insertions(+)
tools/testing/selftests/drivers/net/bonding/lag_lib.sh +11 -0
@@ -48,6 +48,17 @@ test_LAG_cleanup() ip link add mv0 link "$name" up address "$ucaddr" type macvlan # Used to test dev->mc handling ip address add "$addr6" dev "$name" + + # Check that addresses were added as expected + (grep_bridge_fdb "$ucaddr" bridge fdb show dev dummy1 || + grep_bridge_fdb "$ucaddr" bridge fdb show dev dummy2) >/dev/null + check_err $? "macvlan unicast address not found on a slave" + + # mcaddr is added asynchronously by addrconf_dad_work(), use busywait + (busywait 10000 grep_bridge_fdb "$mcaddr" bridge fdb show dev dummy1 || + grep_bridge_fdb "$mcaddr" bridge fdb show dev dummy2) >/dev/null + check_err $? "IPv6 solicited-node multicast mac address not found on a slave" + ip link set dev "$name" down ip link del "$name"
Signature · 1 line
2.43.0
PATCH 3/5 selftests: net: Remove executable bits from library scripts
In reply to Benjamin Poiriersetup_loopback.sh and net_helper.sh are meant to be sourced from other scripts, not executed directly. Therefore, remove the executable bits from those files' permissions.
This change is similar to commit 49078c1b80b6 ("selftests: forwarding:
Remove executable bits from lib.sh")
--- tools/testing/selftests/net/net_helper.sh | 0 tools/testing/selftests/net/setup_loopback.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 tools/testing/selftests/net/net_helper.sh mode change 100755 => 100644 tools/testing/selftests/net/setup_loopback.sh
tools/testing/selftests/net/net_helper.sh +0 -0
tools/testing/selftests/net/setup_loopback.sh +0 -0
Signature · 1 line
2.43.0
PATCH 4/5 selftests: net: List helper scripts in TEST_FILES Makefile variable
In reply to Benjamin PoirierSome scripts are not tests themselves; they contain utility functions used by other tests. According to Documentation/dev-tools/kselftest.rst, such files should be listed in TEST_FILES. Move those utility scripts to TEST_FILES.
--- tools/testing/selftests/net/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
tools/testing/selftests/net/Makefile +2 -3
@@ -53,9 +53,7 @@ TEST_PROGS += bind_bhash.sh TEST_PROGS += ip_local_port_range.sh TEST_PROGS += rps_default_mask.sh TEST_PROGS += big_tcp.sh -TEST_PROGS_EXTENDED := in_netns.sh setup_loopback.sh setup_veth.sh -TEST_PROGS_EXTENDED += toeplitz_client.sh toeplitz.sh lib.sh -TEST_PROGS_EXTENDED += net_helper.sh +TEST_PROGS_EXTENDED := toeplitz_client.sh toeplitz.sh TEST_GEN_FILES = socket nettest TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy reuseport_addr_any TEST_GEN_FILES += tcp_mmap tcp_inq psock_snd txring_overwrite
@@ -97,6 +95,7 @@ TEST_PROGS += fq_band_pktlimit.sh TEST_PROGS += vlan_hw_filter.sh TEST_FILES := settings +TEST_FILES += in_netns.sh lib.sh net_helper.sh setup_loopback.sh setup_veth.sh include ../lib.mk
Signature · 1 line
2.43.0
PATCH 5/5 selftests: forwarding: List helper scripts in TEST_FILES Makefile variable
In reply to Benjamin PoirierSome scripts are not tests themselves; they contain utility functions used by other tests. According to Documentation/dev-tools/kselftest.rst, such files should be listed in TEST_FILES. Currently they are incorrectly listed in TEST_PROGS_EXTENDED so rename the variable.
--- tools/testing/selftests/net/forwarding/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/forwarding/Makefile +1 -1
@@ -112,7 +112,7 @@ TEST_PROGS = bridge_fdb_learning_limit.sh \ vxlan_symmetric_ipv6.sh \ vxlan_symmetric.sh -TEST_PROGS_EXTENDED := devlink_lib.sh \ +TEST_FILES := devlink_lib.sh \ ethtool_lib.sh \ fib_offload_lib.sh \ forwarding.config.sample \
Signature · 1 line
2.43.0
This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:
Hello:
This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:
Quoted 12 lines · On Wed, 31 Jan 2024 09:08:43 -0500 you wrote:
Some small fixes for net selftests which follow from these recent commits:
dd2d40acdbb2("selftests: bonding: Add more missing config options")49078c1b80b6("selftests: forwarding: Remove executable bits fromlib.sh")Benjamin Poirier (5):
selftests: team: Add missing config options
selftests: bonding: Check initial state
selftests: net: Remove executable bits from library scripts
selftests: net: List helper scripts inTEST_FILESMakefilevariable
selftests: forwarding: List helper scripts inTEST_FILESMakefile
variable
Quoted 1 line
[...]
Here is the summary with links:
- [net,1/5] selftests: team: Add missing config options
(no matching commit)
- [net,2/5] selftests: bonding: Check initial state
(no matching commit)
- [net,3/5] selftests: net: Remove executable bits from library scripts
https://git.kernel.org/bpf/bpf-next/c/cd1c194ffe28
- [net,4/5] selftests: net: List helper scripts in TEST_FILES Makefile variable (no matching commit)
- [net,5/5] selftests: forwarding: List helper scripts in TEST_FILES Makefile variable (no matching commit)
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Quoted 3 lines · On Wed, 31 Jan 2024 09:08:43 -0500 Benjamin Poirier wrote:
Some small fixes for net selftests which follow from these recent commits:
dd2d40acdbb2("selftests: bonding: Add more missing config options")49078c1b80b6("selftests: forwarding: Remove executable bits fromlib.sh")
Not so great that the team test was passing even tho it lacks so many configs...
TAP version 13
1..1
# timeout set to 45 # selftests: drivers/net/team: dev_addr_lists.sh # Error: Unknown device type. # Error: Unknown device type. # This program is not intended to be run as root. [ 17.601119] team0: Mode changed to "loadbalance" # RTNETLINK answers: Operation not supported # TEST: team cleanup mode lacp [ OK ] ok 1 selftests: drivers/net/team: dev_addr_lists.sh
:(
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 12 lines · On Wed, 31 Jan 2024 09:08:43 -0500 you wrote:
Some small fixes for net selftests which follow from these recent commits:
dd2d40acdbb2("selftests: bonding: Add more missing config options")49078c1b80b6("selftests: forwarding: Remove executable bits fromlib.sh")Benjamin Poirier (5):
selftests: team: Add missing config options
selftests: bonding: Check initial state
selftests: net: Remove executable bits from library scripts
selftests: net: List helper scripts inTEST_FILESMakefilevariable
selftests: forwarding: List helper scripts inTEST_FILESMakefile
variable
Quoted 1 line
[...]
Here is the summary with links:
- [net,1/5] selftests: team: Add missing config options
https://git.kernel.org/netdev/net/c/7b6fb3050d8f - [net,2/5] selftests: bonding: Check initial state https://git.kernel.org/netdev/net/c/8cc063ae1b3d - [net,3/5] selftests: net: Remove executable bits from library scripts (no matching commit) - [net,4/5] selftests: net: List helper scripts in TEST_FILES Makefile variable https://git.kernel.org/netdev/net/c/06efafd8608d - [net,5/5] selftests: forwarding: List helper scripts in TEST_FILES Makefile variable https://git.kernel.org/netdev/net/c/96cd5ac4c0e6
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html