Skip to content

Commit 40d269c

Browse files
pmachatakuba-moo
authored andcommitted
selftests: forwarding: Move several selftests
The tests in net/forwarding are generally expected to be HW-independent. There are however several tests that, while not depending on any HW in particular, nevertheless depend on being used on HW interfaces. Placing these selftests to net/forwarding is confusing, because the selftest will just report it can't be run on veth pairs. At the same time, placing them to a particular driver's selftests subdirectory would be wrong. Instead, add a new directory, drivers/net/hw, where these generic but HW independent selftests should be placed. Move over several such tests including one helper library. Since typically these tests will not be expected to run, omit the directory drivers/net/hw from the TARGETS list in selftests/Makefile. Retain a Makefile in the new directory itself, so that a user can make -C into that directory and act on those tests explicitly. Cc: Roger Quadros <[email protected]> Cc: Tobias Waldekranz <[email protected]> Cc: Danielle Ratson <[email protected]> Cc: Davide Caratti <[email protected]> Cc: Johannes Nixdorf <[email protected]> Suggested-by: Jakub Kicinski <[email protected]> Signed-off-by: Petr Machata <[email protected]> Link: https://lore.kernel.org/r/e11dae1f62703059e9fc2240004288ac7cc15756.1711464583.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 0faa565 commit 40d269c

File tree

13 files changed

+42
-18
lines changed

13 files changed

+42
-18
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-License-Identifier: GPL-2.0+ OR MIT
2+
3+
TEST_PROGS = \
4+
devlink_port_split.py \
5+
ethtool.sh \
6+
ethtool_extended_state.sh \
7+
ethtool_mm.sh \
8+
ethtool_rmon.sh \
9+
hw_stats_l3.sh \
10+
hw_stats_l3_gre.sh \
11+
loopback.sh \
12+
#
13+
14+
TEST_FILES := \
15+
ethtool_lib.sh \
16+
#
17+
18+
TEST_INCLUDES := \
19+
../../../net/lib.sh \
20+
../../../net/forwarding/lib.sh \
21+
../../../net/forwarding/ipip_lib.sh \
22+
../../../net/forwarding/tc_common.sh \
23+
#
24+
25+
include ../../../lib.mk

tools/testing/selftests/net/forwarding/ethtool.sh renamed to tools/testing/selftests/drivers/net/hw/ethtool.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ ALL_TESTS="
1010
different_speeds_autoneg_on
1111
"
1212
NUM_NETIFS=2
13-
source lib.sh
13+
lib_dir=$(dirname "$0")
14+
source "$lib_dir"/../../../net/forwarding/lib.sh
1415
source ethtool_lib.sh
1516

1617
h1_create()

tools/testing/selftests/net/forwarding/ethtool_extended_state.sh renamed to tools/testing/selftests/drivers/net/hw/ethtool_extended_state.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ ALL_TESTS="
88
"
99

1010
NUM_NETIFS=2
11-
source lib.sh
11+
lib_dir=$(dirname "$0")
12+
source "$lib_dir"/../../../net/forwarding/lib.sh
1213
source ethtool_lib.sh
1314

1415
TIMEOUT=$((WAIT_TIMEOUT * 1000)) # ms

tools/testing/selftests/net/forwarding/ethtool_mm.sh renamed to tools/testing/selftests/drivers/net/hw/ethtool_mm.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ ALL_TESTS="
1414
NUM_NETIFS=2
1515
REQUIRE_MZ=no
1616
PREEMPTIBLE_PRIO=0
17-
source lib.sh
17+
lib_dir=$(dirname "$0")
18+
source "$lib_dir"/../../../net/forwarding/lib.sh
1819

1920
traffic_test()
2021
{

tools/testing/selftests/net/forwarding/ethtool_rmon.sh renamed to tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ ALL_TESTS="
77
"
88

99
NUM_NETIFS=2
10-
source lib.sh
10+
lib_dir=$(dirname "$0")
11+
source "$lib_dir"/../../../net/forwarding/lib.sh
1112

1213
ETH_FCS_LEN=4
1314
ETH_HLEN=$((6+6+2))

tools/testing/selftests/net/forwarding/hw_stats_l3.sh renamed to tools/testing/selftests/drivers/net/hw/hw_stats_l3.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ ALL_TESTS="
4848
test_double_enable
4949
"
5050
NUM_NETIFS=4
51-
source lib.sh
51+
lib_dir=$(dirname "$0")
52+
source "$lib_dir"/../../../net/forwarding/lib.sh
5253

5354
h1_create()
5455
{

tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh renamed to tools/testing/selftests/drivers/net/hw/hw_stats_l3_gre.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ ALL_TESTS="
1212
test_stats_tx
1313
"
1414
NUM_NETIFS=6
15-
source lib.sh
16-
source ipip_lib.sh
15+
lib_dir=$(dirname "$0")
16+
source "$lib_dir"/../../../net/forwarding/lib.sh
17+
source "$lib_dir"/../../../net/forwarding/ipip_lib.sh
1718

1819
setup_prepare()
1920
{

tools/testing/selftests/net/forwarding/loopback.sh renamed to tools/testing/selftests/drivers/net/hw/loopback.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ ksft_skip=4
66

77
ALL_TESTS="loopback_test"
88
NUM_NETIFS=2
9-
source tc_common.sh
10-
source lib.sh
9+
lib_dir=$(dirname "$0")
10+
source "$lib_dir"/../../../net/forwarding/tc_common.sh
11+
source "$lib_dir"/../../../net/forwarding/lib.sh
1112

1213
h1_create()
1314
{
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
timeout=0

tools/testing/selftests/net/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ TEST_PROGS += reuseaddr_ports_exhausted.sh
2020
TEST_PROGS += txtimestamp.sh
2121
TEST_PROGS += vrf-xfrm-tests.sh
2222
TEST_PROGS += rxtimestamp.sh
23-
TEST_PROGS += devlink_port_split.py
2423
TEST_PROGS += drop_monitor_tests.sh
2524
TEST_PROGS += vrf_route_leaking.sh
2625
TEST_PROGS += bareudp.sh

tools/testing/selftests/net/forwarding/Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,12 @@ TEST_PROGS = bridge_fdb_learning_limit.sh \
1515
bridge_vlan_unaware.sh \
1616
custom_multipath_hash.sh \
1717
dual_vxlan_bridge.sh \
18-
ethtool_extended_state.sh \
19-
ethtool_mm.sh \
20-
ethtool_rmon.sh \
21-
ethtool.sh \
2218
gre_custom_multipath_hash.sh \
2319
gre_inner_v4_multipath.sh \
2420
gre_inner_v6_multipath.sh \
2521
gre_multipath_nh_res.sh \
2622
gre_multipath_nh.sh \
2723
gre_multipath.sh \
28-
hw_stats_l3.sh \
29-
hw_stats_l3_gre.sh \
3024
ip6_forward_instats_vrf.sh \
3125
ip6gre_custom_multipath_hash.sh \
3226
ip6gre_flat_key.sh \
@@ -44,7 +38,6 @@ TEST_PROGS = bridge_fdb_learning_limit.sh \
4438
ipip_hier_gre_keys.sh \
4539
ipip_hier_gre.sh \
4640
local_termination.sh \
47-
loopback.sh \
4841
mirror_gre_bound.sh \
4942
mirror_gre_bridge_1d.sh \
5043
mirror_gre_bridge_1d_vlan.sh \
@@ -113,7 +106,6 @@ TEST_PROGS = bridge_fdb_learning_limit.sh \
113106
vxlan_symmetric.sh
114107

115108
TEST_FILES := devlink_lib.sh \
116-
ethtool_lib.sh \
117109
fib_offload_lib.sh \
118110
forwarding.config.sample \
119111
ip6gre_lib.sh \

0 commit comments

Comments
 (0)