Skip to content

Commit

Permalink
selftests/net/forwarding: teamd command not found
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alessandro Zanni authored and Jakub Kicinski committed Jan 15, 2025
1 parent 2974e66 commit 7a649f3
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/drivers/net/mlxsw/rif_bridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/drivers/net/mlxsw/rif_lag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/drivers/net/mlxsw/rif_lag_vlan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions tools/testing/selftests/net/forwarding/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ ALL_TESTS="
test_mirror_gretap_second
"

REQUIRE_TEAMD="yes"
NUM_NETIFS=6
source lib.sh
source mirror_lib.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ ALL_TESTS="
test_mirror_gretap_second
"

REQUIRE_TEAMD="yes"
NUM_NETIFS=6
source lib.sh
source mirror_lib.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ ALL_TESTS="
ping_ipv4
ping_ipv6
"
REQUIRE_TEAMD="yes"
NUM_NETIFS=8
source lib.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
ping_ipv4
ping_ipv6
"}
REQUIRE_TEAMD="yes"
NUM_NETIFS=8
: ${lib_dir:=.}
source $lib_dir/lib.sh
Expand Down

0 comments on commit 7a649f3

Please sign in to comment.