selftests/net/forwarding: teamd command not found
authorAlessandro Zanni <alessandro.zanni87@gmail.com>
Tue, 14 Jan 2025 00:33:16 +0000 (01:33 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 15 Jan 2025 22:14:40 +0000 (14:14 -0800)
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>
tools/testing/selftests/drivers/net/mlxsw/rif_bridge.sh
tools/testing/selftests/drivers/net/mlxsw/rif_lag.sh
tools/testing/selftests/drivers/net/mlxsw/rif_lag_vlan.sh
tools/testing/selftests/net/forwarding/lib.sh
tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh
tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh
tools/testing/selftests/net/forwarding/router_bridge_1d_lag.sh
tools/testing/selftests/net/forwarding/router_bridge_lag.sh

index b79542a..4a11bf1 100755 (executable)
@@ -12,6 +12,7 @@ ALL_TESTS="
        bridge_rif_remaster_port
 "
 
+REQUIRE_TEAMD="yes"
 NUM_NETIFS=2
 source $lib_dir/lib.sh
 source $lib_dir/devlink_lib.sh
index e28f978..b8bbe94 100755 (executable)
@@ -10,6 +10,7 @@ ALL_TESTS="
        lag_rif_nomaster_addr
 "
 
+REQUIRE_TEAMD="yes"
 NUM_NETIFS=2
 source $lib_dir/lib.sh
 source $lib_dir/devlink_lib.sh
index 6318cfa..d1a9d37 100755 (executable)
@@ -10,6 +10,7 @@ ALL_TESTS="
        lag_rif_nomaster_addr
 "
 
+REQUIRE_TEAMD="yes"
 NUM_NETIFS=2
 source $lib_dir/lib.sh
 source $lib_dir/devlink_lib.sh
index 1fd40ba..8de80ac 100644 (file)
@@ -68,6 +68,7 @@ declare -A NETIFS=(
 : "${REQUIRE_JQ:=yes}"
 : "${REQUIRE_MZ:=yes}"
 : "${REQUIRE_MTOOLS:=no}"
+: "${REQUIRE_TEAMD:=no}"
 
 # Whether to override MAC addresses on interfaces participating in the test.
 : "${STABLE_MAC_ADDRS:=no}"
@@ -321,6 +322,9 @@ fi
 if [[ "$REQUIRE_MZ" = "yes" ]]; then
        require_command $MZ
 fi
+if [[ "$REQUIRE_TEAMD" = "yes" ]]; then
+       require_command $TEAMD
+fi
 if [[ "$REQUIRE_MTOOLS" = "yes" ]]; then
        # https://github.com/troglobit/mtools
        require_command msend
index fe4d7c9..a20d22d 100755 (executable)
@@ -49,6 +49,7 @@ ALL_TESTS="
        test_mirror_gretap_second
 "
 
+REQUIRE_TEAMD="yes"
 NUM_NETIFS=6
 source lib.sh
 source mirror_lib.sh
index 1261e6f..ff70495 100755 (executable)
@@ -53,6 +53,7 @@ ALL_TESTS="
        test_mirror_gretap_second
 "
 
+REQUIRE_TEAMD="yes"
 NUM_NETIFS=6
 source lib.sh
 source mirror_lib.sh
index e064b94..16583a4 100755 (executable)
@@ -109,6 +109,7 @@ ALL_TESTS="
        ping_ipv4
        ping_ipv6
 "
+REQUIRE_TEAMD="yes"
 NUM_NETIFS=8
 source lib.sh
 
index f05ffe2..2a4cd1a 100755 (executable)
@@ -76,6 +76,7 @@
        ping_ipv4
        ping_ipv6
     "}
+REQUIRE_TEAMD="yes"
 NUM_NETIFS=8
 : ${lib_dir:=.}
 source $lib_dir/lib.sh