Skip to contentSkip to conversation

selftests: loopback.sh: skip this test if the driver does not support

PATCH Applied Hangbin Liu 3 participants 3 messages Jan 3, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 ad11340994d5 ("selftests: Add loopback test")
---
 tools/testing/selftests/net/forwarding/loopback.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
tools/testing/selftests/net/forwarding/loopback.sh +8 -0
index 6e4626ae71b0..8f4057310b5b 100755
@@ -1,6 +1,9 @@
 #!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
 ALL_TESTS="loopback_test"
 NUM_NETIFS=2
 source tc_common.sh
@@ -72,6 +75,11 @@ setup_prepare()
 
 	h1_create
 	h2_create
+
+	if ethtool -k $h1 | grep loopback | grep -q fixed; then
+		log_test "SKIP: dev $h1 does not support loopback feature"
+		exit $ksft_skip
+	fi
 }
 
 cleanup()
Signature · 1 line
2.19.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Hangbin Liu

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 ad11340994d5 ("selftests: Add loopback test")
maintainer Applied
#2 lore raw
In reply to Hangbin Liu

From: Hangbin Liu <[email protected]>
Date: Fri, 3 Jan 2020 15:41:24 +0800

Quoted 7 lines

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 ad11340994d5 ("selftests: Add loopback test")

Applied, thanks.