[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <a1c56680a5041ae337a6a44a7091bd8f781c1970.1702295081.git.petrm@nvidia.com>
Date: Mon, 11 Dec 2023 13:01:06 +0100
From: Petr Machata <petrm@...dia.com>
To: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, <netdev@...r.kernel.org>
CC: Shuah Khan <shuah@...nel.org>, Petr Machata <petrm@...dia.com>,
<mlxsw@...dia.com>, Hangbin Liu <liuhangbin@...il.com>
Subject: [PATCH net-next] selftests: forwarding: Import top-level lib.sh through $lib_dir
The commit cited below moved code from net/forwarding/lib.sh to net/lib.sh,
and had the former source the latter. This causes issues with selftests
from directories other than net/forwarding/, in particular drivers/net/...
For those files, the line "source ../lib.sh" would look for lib.sh in the
directory above the script file's one, which is incorrect. The way these
selftests source net/forwarding/lib.sh is like this:
lib_dir=$(dirname $0)/../../../net/forwarding
source $lib_dir/lib.sh
Reuse the variable lib_dir, if set, in net/forwarding/lib.sh to source
net/lib.sh as well.
Fixes: 25ae948b4478 ("selftests/net: add lib.sh")
Cc: Hangbin Liu <liuhangbin@...il.com>
Signed-off-by: Petr Machata <petrm@...dia.com>
---
tools/testing/selftests/net/forwarding/lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index 038b7d956722..0feb4e400110 100755
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -38,7 +38,7 @@ if [[ -f $relative_path/forwarding.config ]]; then
source "$relative_path/forwarding.config"
fi
-source ../lib.sh
+source ${lib_dir-.}/../lib.sh
##############################################################################
# Sanity checks
--
2.41.0
Powered by blists - more mailing lists