selftests: forwarding: Allow importing dependent libraries
authorPetr Machata <petrm@mellanox.com>
Thu, 5 Jul 2018 19:10:59 +0000 (21:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Jul 2018 11:29:34 +0000 (20:29 +0900)
The next patch introduces a new mlxsw-specific test that uses
mirror_gre_lib.sh and mirror_gre_topo_lib.sh.

However when sourcing their own deps, these libraries assume that the
test that's running is in the same directory. That's not the case for
driver-specific tests.

So change the libraries to source their deps through $relative_path.
That variable is set up by lib.sh, which should be imported by the test
in question in any case.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh

index 1c18e332cd4f2af3c7b0ca48dceb3e1634259377..fac486178ef727aa387450042050f02c65c0ff32 100644 (file)
@@ -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()
 {
index 25341956470840c9f36dd424164ffd10132235a0..39c03e2867f479560a25a622f1bdaa2f3fbbd289 100644 (file)
@@ -33,7 +33,7 @@
 #   |                                                                         |
 #   +-------------------------------------------------------------------------+
 
-source mirror_topo_lib.sh
+source "$relative_path/mirror_topo_lib.sh"
 
 mirror_gre_topo_h3_create()
 {