* [PATCH net-next] selftests: forwarding: Fix importing dependent libraries
@ 2018-06-05 13:07 Petr Machata
2018-06-05 13:15 ` Petr Machata
0 siblings, 1 reply; 2+ messages in thread
From: Petr Machata @ 2018-06-05 13:07 UTC (permalink / raw)
To: netdev, linux-kselftest; +Cc: davem, shuah, idosch
When libraries are sourced from elsewhere from the tree, such as the
testing/selftests/drivers/net/mlxsw subdirectory, sourcing their own
dependencies directly by name doesn't work. Thus running mirror_gre.sh
from that subdirectory results in the following cascade of errors:
./../../../net/forwarding/mirror_gre_lib.sh: line 3: mirror_lib.sh: No such file or directory
./../../../net/forwarding/mirror_gre_topo_lib.sh: line 36: mirror_topo_lib.sh: No such file or directory
./../../../net/forwarding/mirror_gre_topo_lib.sh: line 80: mirror_topo_h1_create: command not found
./../../../net/forwarding/mirror_gre_topo_lib.sh: line 81: mirror_topo_h2_create: command not found
./../../../net/forwarding/mirror_gre_topo_lib.sh: line 40: mirror_topo_h3_create: command not found
[...]
Fix by relying on $relative_path, set up by lib.sh, which should be
imported by the test in question anyway, and source the file using
relative path appropriate for the subdirectory.
Fixes: d5ea2bfc806a ("selftests: forwarding: mirror_gre_lib: Extract generic functions")
Fixes: 74ed089d48a4 ("selftests: forwarding: Split mirror_gre_topo_lib.sh")
Signed-off-by: Petr Machata <petrm@mellanox.com>
---
tools/testing/selftests/net/forwarding/mirror_gre_lib.sh | 2 +-
tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
index 619b469..1388845 100644
--- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
-source mirror_lib.sh
+source "$relative_path/mirror_lib.sh"
quick_test_span_gre_dir_ips()
{
diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh
index 2534195..39c03e2 100644
--- a/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh
@@ -33,7 +33,7 @@
# | |
# +-------------------------------------------------------------------------+
-source mirror_topo_lib.sh
+source "$relative_path/mirror_topo_lib.sh"
mirror_gre_topo_h3_create()
{
--
2.4.11
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] selftests: forwarding: Fix importing dependent libraries
2018-06-05 13:07 [PATCH net-next] selftests: forwarding: Fix importing dependent libraries Petr Machata
@ 2018-06-05 13:15 ` Petr Machata
0 siblings, 0 replies; 2+ messages in thread
From: Petr Machata @ 2018-06-05 13:15 UTC (permalink / raw)
To: netdev; +Cc: linux-kselftest, davem, shuah, idosch
Petr Machata <petrm@mellanox.com> writes:
> When libraries are sourced from elsewhere from the tree, such as the
> testing/selftests/drivers/net/mlxsw subdirectory, sourcing their own
Sorry, I didn't realize the mirror_bridge.sh is not upstream yet. This
patch is thus immaterial, it will be sent together with the test when it
becomes relevant.
Please ignore.
Thanks,
Petr
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-05 13:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05 13:07 [PATCH net-next] selftests: forwarding: Fix importing dependent libraries Petr Machata
2018-06-05 13:15 ` Petr Machata
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).