Commit 4a24560a authored by Benjamin Poirier's avatar Benjamin Poirier Committed by David S. Miller

selftests: dsa: Replace test symlinks by wrapper script

The dsa tests which are symlinks of tests from net/forwarding/ (like
tc_actions.sh) become regular files after export (because `rsync
--copy-unsafe-links` is used) and expect to source lib.sh
(net/forwarding/lib.sh) from the same directory.

In the last patch of this series, net/forwarding/lib.sh will source lib.sh
from its parent directory (ie. net/lib.sh). This would not work for dsa
tests because net/lib.sh is not present under drivers/net/.

Since the tests in net/forwarding/ are not meant to be copied and run from
another directory, as a preparation for that last patch, replace the test
symlinks by a wrapper script which runs the original tests under
net/forwarding/. Following from that, the links to shared library scripts
in dsa/ are no longer used so remove them and add all the original files
needed from parent directories to TEST_INCLUDES.
Suggested-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Tested-by: default avatarPetr Machata <petrm@nvidia.com>
Reviewed-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Signed-off-by: default avatarBenjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 975b4a8b
......@@ -11,8 +11,21 @@ TEST_PROGS = bridge_locked_port.sh \
tc_actions.sh \
test_bridge_fdb_stress.sh
TEST_PROGS_EXTENDED := lib.sh tc_common.sh
TEST_FILES := \
run_net_forwarding_test.sh \
forwarding.config
TEST_FILES := forwarding.config
TEST_INCLUDES := \
../../../net/forwarding/bridge_locked_port.sh \
../../../net/forwarding/bridge_mdb.sh \
../../../net/forwarding/bridge_mld.sh \
../../../net/forwarding/bridge_vlan_aware.sh \
../../../net/forwarding/bridge_vlan_mcast.sh \
../../../net/forwarding/bridge_vlan_unaware.sh \
../../../net/forwarding/lib.sh \
../../../net/forwarding/local_termination.sh \
../../../net/forwarding/no_forwarding.sh \
../../../net/forwarding/tc_actions.sh \
../../../net/forwarding/tc_common.sh
include ../../../lib.mk
../../../net/forwarding/bridge_locked_port.sh
\ No newline at end of file
run_net_forwarding_test.sh
\ No newline at end of file
../../../net/forwarding/bridge_mdb.sh
\ No newline at end of file
run_net_forwarding_test.sh
\ No newline at end of file
../../../net/forwarding/bridge_mld.sh
\ No newline at end of file
run_net_forwarding_test.sh
\ No newline at end of file
../../../net/forwarding/bridge_vlan_aware.sh
\ No newline at end of file
run_net_forwarding_test.sh
\ No newline at end of file
../../../net/forwarding/bridge_vlan_mcast.sh
\ No newline at end of file
run_net_forwarding_test.sh
\ No newline at end of file
../../../net/forwarding/bridge_vlan_unaware.sh
\ No newline at end of file
run_net_forwarding_test.sh
\ No newline at end of file
../../../net/forwarding/lib.sh
\ No newline at end of file
../../../net/forwarding/local_termination.sh
\ No newline at end of file
run_net_forwarding_test.sh
\ No newline at end of file
../../../net/forwarding/no_forwarding.sh
\ No newline at end of file
run_net_forwarding_test.sh
\ No newline at end of file
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
libdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
testname=$(basename "${BASH_SOURCE[0]}")
source "$libdir"/forwarding.config
cd "$libdir"/../../../net/forwarding/ || exit 1
source "./$testname" "$@"
../../../net/forwarding/tc_actions.sh
\ No newline at end of file
run_net_forwarding_test.sh
\ No newline at end of file
../../../net/forwarding/tc_common.sh
\ No newline at end of file
......@@ -19,7 +19,7 @@ REQUIRE_JQ="no"
REQUIRE_MZ="no"
NETIF_CREATE="no"
lib_dir=$(dirname "$0")
source "$lib_dir"/lib.sh
source "$lib_dir"/../../../net/forwarding/lib.sh
cleanup() {
echo "Cleaning up"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment