Skip to content

Commit cc7e3f6

Browse files
liuhangbindavem330
authored andcommitted
selftests: loopback.sh: skip this test if the driver does not support
The loopback feature is only supported on a few drivers like broadcom, mellanox, etc. The default veth driver has not supported it yet. To avoid returning failed and making the runner feel confused, let's just skip the test on drivers that not support loopback. Fixes: ad11340 ("selftests: Add loopback test") Signed-off-by: Hangbin Liu <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cd82dbf commit cc7e3f6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/testing/selftests/net/forwarding/loopback.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22
# SPDX-License-Identifier: GPL-2.0
33

4+
# Kselftest framework requirement - SKIP code is 4.
5+
ksft_skip=4
6+
47
ALL_TESTS="loopback_test"
58
NUM_NETIFS=2
69
source tc_common.sh
@@ -72,6 +75,11 @@ setup_prepare()
7275

7376
h1_create
7477
h2_create
78+
79+
if ethtool -k $h1 | grep loopback | grep -q fixed; then
80+
log_test "SKIP: dev $h1 does not support loopback feature"
81+
exit $ksft_skip
82+
fi
7583
}
7684

7785
cleanup()

0 commit comments

Comments
 (0)