The test 'ethtool-features.sh' failed with the below output:
TAP version 13 1..1 # timeout set to 600 # selftests: drivers/net/netdevsim: ethtool-features.sh # Warning: file ethtool-features.sh is not executable # ethtool: bad command line argument(s) # For more information run ethtool -h # ethtool: bad command line argument(s) # For more information run ethtool -h # ethtool: bad command line argument(s) # For more information run ethtool -h # ethtool: bad command line argument(s) # For more information run ethtool -h # ethtool: bad command line argument(s) # For more information run ethtool -h # ethtool: bad command line argument(s) # For more information run ethtool -h # ethtool: bad command line argument(s) # For more information run ethtool -h # ethtool: bad command line argument(s) # For more information run ethtool -h # ethtool: bad command line argument(s) # For more information run ethtool -h # ethtool: bad command line argument(s) # For more information run ethtool -h # FAILED 10/10 checks not ok 1 selftests: drivers/net/netdevsim: ethtool-features.sh # exit=1
Similar to commit 18378b0e49d9 ("selftests/damon: Add executable permission to test scripts"), the script 'ethtool-features.sh' has no executable permission, which leads to the warning 'file ethtool-features.sh is not executable'.
Old version ethtool (my ethtool version is 5.16) does not support command 'ethtool --json -k enp1s0', which leads to the output 'ethtool: bad command line argument(s)'.
This patch adds executable permission to script 'ethtool-features.sh', and check 'ethtool --json -k' support. After this patch:
TAP version 13 1..1 # timeout set to 600 # selftests: drivers/net/netdevsim: ethtool-features.sh # SKIP: No --json -k support in ethtool ok 1 selftests: drivers/net/netdevsim: ethtool-features.sh
Fixes: 0189270117c3 ("selftests: netdevsim: add a test checking ethtool features") Signed-off-by: Wang Liang wangliang74@huawei.com --- .../selftests/drivers/net/netdevsim/ethtool-features.sh | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 tools/testing/selftests/drivers/net/netdevsim/ethtool-features.sh
diff --git a/tools/testing/selftests/drivers/net/netdevsim/ethtool-features.sh b/tools/testing/selftests/drivers/net/netdevsim/ethtool-features.sh old mode 100644 new mode 100755 index bc210dc6ad2d..f771dc6839ea --- a/tools/testing/selftests/drivers/net/netdevsim/ethtool-features.sh +++ b/tools/testing/selftests/drivers/net/netdevsim/ethtool-features.sh @@ -7,6 +7,11 @@ NSIM_NETDEV=$(make_netdev)
set -o pipefail
+if ! ethtool --json -k $NSIM_NETDEV > /dev/null 2>&1; then + echo "SKIP: No --json -k support in ethtool" + exit $ksft_skip +fi + FEATS=" tx-checksum-ip-generic tx-scatter-gather
2025-10-30, 11:22:03 +0800, Wang Liang wrote:
This patch adds executable permission to script 'ethtool-features.sh', and check 'ethtool --json -k' support.
Those are two separate things, probably should be two separate patches.
[...]
@@ -7,6 +7,11 @@ NSIM_NETDEV=$(make_netdev) set -o pipefail +if ! ethtool --json -k $NSIM_NETDEV > /dev/null 2>&1; then
I guess it's improving the situation, but I've got a system with an ethtool that accepts the --json argument, but silently ignores it for -k (ie `ethtool --json -k $DEV` succeeds but doesn't produce a json output), which will still cause the test to fail later.
On Fri, 31 Oct 2025 00:13:59 +0100 Sabrina Dubroca wrote:
set -o pipefail +if ! ethtool --json -k $NSIM_NETDEV > /dev/null 2>&1; then
I guess it's improving the situation, but I've got a system with an ethtool that accepts the --json argument, but silently ignores it for -k (ie `ethtool --json -k $DEV` succeeds but doesn't produce a json output), which will still cause the test to fail later.
And --json was added to -k in Jan 2022, that's pretty long ago. I'm not sure we need this aspect of the patch at all..
linux-kselftest-mirror@lists.linaro.org