Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/net/forwarding: teamd command not found

Running "make kselftest TARGETS=net/forwarding" results in
multiple ccurrences of the same error:
- ./lib.sh: line 787: teamd: command not found

This patch adds the variable $REQUIRE_TEAMD in every test that uses the
command teamd and checks the $REQUIRE_TEAMD variable in the file "lib.sh"
to skip the test if the command is not installed.

Signed-off-by: Alessandro Zanni <alessandro.zanni87@gmail.com>
Link: https://patch.msgid.link/20250114003323.97207-1-alessandro.zanni87@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Alessandro Zanni and committed by
Jakub Kicinski
7a649f39 2974e66b

+11
+1
tools/testing/selftests/drivers/net/mlxsw/rif_bridge.sh
··· 12 12 bridge_rif_remaster_port 13 13 " 14 14 15 + REQUIRE_TEAMD="yes" 15 16 NUM_NETIFS=2 16 17 source $lib_dir/lib.sh 17 18 source $lib_dir/devlink_lib.sh
+1
tools/testing/selftests/drivers/net/mlxsw/rif_lag.sh
··· 10 10 lag_rif_nomaster_addr 11 11 " 12 12 13 + REQUIRE_TEAMD="yes" 13 14 NUM_NETIFS=2 14 15 source $lib_dir/lib.sh 15 16 source $lib_dir/devlink_lib.sh
+1
tools/testing/selftests/drivers/net/mlxsw/rif_lag_vlan.sh
··· 10 10 lag_rif_nomaster_addr 11 11 " 12 12 13 + REQUIRE_TEAMD="yes" 13 14 NUM_NETIFS=2 14 15 source $lib_dir/lib.sh 15 16 source $lib_dir/devlink_lib.sh
+4
tools/testing/selftests/net/forwarding/lib.sh
··· 68 68 : "${REQUIRE_JQ:=yes}" 69 69 : "${REQUIRE_MZ:=yes}" 70 70 : "${REQUIRE_MTOOLS:=no}" 71 + : "${REQUIRE_TEAMD:=no}" 71 72 72 73 # Whether to override MAC addresses on interfaces participating in the test. 73 74 : "${STABLE_MAC_ADDRS:=no}" ··· 321 320 fi 322 321 if [[ "$REQUIRE_MZ" = "yes" ]]; then 323 322 require_command $MZ 323 + fi 324 + if [[ "$REQUIRE_TEAMD" = "yes" ]]; then 325 + require_command $TEAMD 324 326 fi 325 327 if [[ "$REQUIRE_MTOOLS" = "yes" ]]; then 326 328 # https://github.com/troglobit/mtools
+1
tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh
··· 49 49 test_mirror_gretap_second 50 50 " 51 51 52 + REQUIRE_TEAMD="yes" 52 53 NUM_NETIFS=6 53 54 source lib.sh 54 55 source mirror_lib.sh
+1
tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh
··· 53 53 test_mirror_gretap_second 54 54 " 55 55 56 + REQUIRE_TEAMD="yes" 56 57 NUM_NETIFS=6 57 58 source lib.sh 58 59 source mirror_lib.sh
+1
tools/testing/selftests/net/forwarding/router_bridge_1d_lag.sh
··· 109 109 ping_ipv4 110 110 ping_ipv6 111 111 " 112 + REQUIRE_TEAMD="yes" 112 113 NUM_NETIFS=8 113 114 source lib.sh 114 115
+1
tools/testing/selftests/net/forwarding/router_bridge_lag.sh
··· 76 76 ping_ipv4 77 77 ping_ipv6 78 78 "} 79 + REQUIRE_TEAMD="yes" 79 80 NUM_NETIFS=8 80 81 : ${lib_dir:=.} 81 82 source $lib_dir/lib.sh