]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools: ynl: move ethtool.py to selftest
authorHangbin Liu <liuhangbin@gmail.com>
Wed, 8 Apr 2026 07:08:49 +0000 (15:08 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sun, 12 Apr 2026 18:23:49 +0000 (11:23 -0700)
We have converted all the samples to selftests. This script is
the last piece of random "PoC" code we still have lying around.
Let's move it to tests.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/20260408-b4-ynl_ethtool-v2-1-7623a5e8f70b@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/tests/Makefile
tools/net/ynl/tests/ethtool.py [moved from tools/net/ynl/pyynl/ethtool.py with 99% similarity]
tools/net/ynl/tests/test_ynl_ethtool.sh

index 9215e84cca0577084a17ab6d831647e95202eebf..40827ca8e579d3cb13056a5f4bb8e7ed1d94ea1c 100644 (file)
@@ -36,7 +36,10 @@ TEST_GEN_FILES := \
        rt-route \
 # end of TEST_GEN_FILES
 
-TEST_FILES := ynl_nsim_lib.sh
+TEST_FILES := \
+       ethtool.py \
+       ynl_nsim_lib.sh \
+# end of TEST_FILES
 
 CFLAGS_netdev:=$(CFLAGS_netdev) $(CFLAGS_rt-link)
 CFLAGS_ovs:=$(CFLAGS_ovs_datapath)
similarity index 99%
rename from tools/net/ynl/pyynl/ethtool.py
rename to tools/net/ynl/tests/ethtool.py
index f1a2a2a8998536c06bb2cbdc59a8826e83a8451d..6eeeb867edcf6eaa7480ea00915f1f628827bcb9 100755 (executable)
@@ -14,7 +14,7 @@ import re
 import os
 
 # pylint: disable=no-name-in-module,wrong-import-position
-sys.path.append(pathlib.Path(__file__).resolve().parent.as_posix())
+sys.path.append(pathlib.Path(__file__).resolve().parent.parent.joinpath('pyynl').as_posix())
 # pylint: disable=import-error
 from cli import schema_dir, spec_dir
 from lib import YnlFamily
index b826269017f46f6cecfc5875886eb5a31e3a2a3b..b4480e9be7b7dddcbc126340c3b3bf017389d7a3 100755 (executable)
@@ -8,7 +8,7 @@ KSELFTEST_KTAP_HELPERS="$(dirname "$(realpath "$0")")/../../../testing/selftests
 source "$KSELFTEST_KTAP_HELPERS"
 
 # Default ynl-ethtool path for direct execution, can be overridden by make install
-ynl_ethtool="../pyynl/ethtool.py"
+ynl_ethtool="./ethtool.py"
 
 readonly NSIM_ID="1337"
 readonly NSIM_DEV_NAME="nsim${NSIM_ID}"