diff mbox series

[RFC,net-next,08/10] selftests: team: Add lib.sh scripts to TEST_INCLUDES

Message ID 20231222135836.992841-9-bpoirier@nvidia.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series selftests: Add TEST_INCLUDES directive and adjust tests to use it | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers fail 1 blamed authors not CCed: pabeni@redhat.com; 3 maintainers not CCed: linux-kselftest@vger.kernel.org pabeni@redhat.com jiri@resnulli.us
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest fail Script net_forwarding_lib.sh not found in tools/testing/selftests/drivers/net/team/Makefile
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch warning WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Benjamin Poirier Dec. 22, 2023, 1:58 p.m. UTC
Since commit 25ae948b4478 ("selftests/net: add lib.sh"), when exporting the
team test and running it, the test fails to import net/lib.sh. This prints
an error message but since the test does not use functions from net/lib.sh,
this does not affect the test result.

Example:
	# make install TARGETS="drivers/net/team"
	# kselftest_install/run_kselftest.sh
	TAP version 13
	1..1
	# timeout set to 45
	# selftests: drivers/net/team: dev_addr_lists.sh
	# ./net_forwarding_lib.sh: line 38: /src/linux/tools/testing/selftests/kselftest_install/drivers/net/team/../lib.sh:
	 No such file or directory
	# This program is not intended to be run as root.
	# TEST: team cleanup mode lacp                                        [ OK ]
	ok 1 selftests: drivers/net/team: dev_addr_lists.sh

In order to avoid the error message, net/forwarding/lib.sh is exported and
included via its relative path and net/lib.sh is also exported.

Fixes: 25ae948b4478 ("selftests/net: add lib.sh")
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
---
 tools/testing/selftests/drivers/net/team/Makefile            | 5 ++++-
 tools/testing/selftests/drivers/net/team/dev_addr_lists.sh   | 2 +-
 .../testing/selftests/drivers/net/team/net_forwarding_lib.sh | 1 -
 3 files changed, 5 insertions(+), 3 deletions(-)
 delete mode 120000 tools/testing/selftests/drivers/net/team/net_forwarding_lib.sh
diff mbox series

Patch

diff --git a/tools/testing/selftests/drivers/net/team/Makefile b/tools/testing/selftests/drivers/net/team/Makefile
index 6a86e61e8bfe..d31af127ca29 100644
--- a/tools/testing/selftests/drivers/net/team/Makefile
+++ b/tools/testing/selftests/drivers/net/team/Makefile
@@ -5,6 +5,9 @@  TEST_PROGS := dev_addr_lists.sh
 
 TEST_FILES := \
 	lag_lib.sh \
-	net_forwarding_lib.sh
+
+TEST_INCLUDES := \
+	net/forwarding/lib.sh \
+	net/lib.sh
 
 include ../../../lib.mk
diff --git a/tools/testing/selftests/drivers/net/team/dev_addr_lists.sh b/tools/testing/selftests/drivers/net/team/dev_addr_lists.sh
index 33913112d5ca..bea2565486f7 100755
--- a/tools/testing/selftests/drivers/net/team/dev_addr_lists.sh
+++ b/tools/testing/selftests/drivers/net/team/dev_addr_lists.sh
@@ -11,7 +11,7 @@  ALL_TESTS="
 REQUIRE_MZ=no
 NUM_NETIFS=0
 lib_dir=$(dirname "$0")
-source "$lib_dir"/net_forwarding_lib.sh
+source "$lib_dir"/../../../net/forwarding/lib.sh
 
 source "$lib_dir"/lag_lib.sh
 
diff --git a/tools/testing/selftests/drivers/net/team/net_forwarding_lib.sh b/tools/testing/selftests/drivers/net/team/net_forwarding_lib.sh
deleted file mode 120000
index 39c96828c5ef..000000000000
--- a/tools/testing/selftests/drivers/net/team/net_forwarding_lib.sh
+++ /dev/null
@@ -1 +0,0 @@ 
-../../../net/forwarding/lib.sh
\ No newline at end of file