Subject: [PATCH net-next 00/10] tools: ynl: convert samples into selftests

From: Jakub Kicinski <[email-masked]>
Date: Thu, 5 Mar 2026 18:08:51 -0800

The "samples" were always poor man's tests, used to manually
confirm that C YNL works as expected. Since a proper tests/
directory now exists move the samples and use the kselftest
harness to turn them into selftests outputting KTAP.

Jakub Kicinski (10):
  tools: ynl: move samples to tests
  tools: ynl: convert netdev sample to selftest
  tools: ynl: convert ovs sample to selftest
  tools: ynl: convert rt-link sample to selftest
  tools: ynl: convert tc and tc-filter-add samples to selftest
  tools: ynl: add netdevsim wrapper library for YNL tests
  tools: ynl: convert devlink sample to selftest
  tools: ynl: convert ethtool sample to selftest
  tools: ynl: convert rt-addr sample to selftest
  tools: ynl: convert rt-route sample to selftest

 tools/net/ynl/Makefile                      |   4 +-
 tools/net/ynl/samples/Makefile              |  36 --
 tools/net/ynl/tests/Makefile                |  70 +++-
 tools/net/ynl/samples/devlink.c             |  61 ---
 tools/net/ynl/samples/ethtool.c             |  65 ----
 tools/net/ynl/samples/netdev.c              | 128 ------
 tools/net/ynl/samples/ovs.c                 |  60 ---
 tools/net/ynl/samples/rt-addr.c             |  80 ----
 tools/net/ynl/samples/rt-link.c             | 184 ---------
 tools/net/ynl/samples/rt-route.c            |  80 ----
 tools/net/ynl/samples/tc-filter-add.c       | 335 ----------------
 tools/net/ynl/samples/tc.c                  |  80 ----
 tools/net/ynl/tests/devlink.c               | 100 +++++
 tools/net/ynl/tests/ethtool.c               |  92 +++++
 tools/net/ynl/tests/netdev.c                | 231 +++++++++++
 tools/net/ynl/tests/ovs.c                   | 104 +++++
 tools/net/ynl/tests/rt-addr.c               | 111 ++++++
 tools/net/ynl/tests/rt-link.c               | 204 ++++++++++
 tools/net/ynl/tests/rt-route.c              | 113 ++++++
 tools/net/ynl/tests/tc.c                    | 407 ++++++++++++++++++++
 tools/net/ynl/{samples => tests}/.gitignore |   3 +-
 tools/net/ynl/tests/config                  |   8 +
 tools/net/ynl/tests/devlink.sh              |   5 +
 tools/net/ynl/tests/ethtool.sh              |   5 +
 tools/net/ynl/tests/rt-addr.sh              |   5 +
 tools/net/ynl/tests/rt-route.sh             |   5 +
 tools/net/ynl/tests/ynl_nsim_lib.sh         |  35 ++
 27 files changed, 1492 insertions(+), 1119 deletions(-)
 delete mode 100644 tools/net/ynl/samples/Makefile
 delete mode 100644 tools/net/ynl/samples/devlink.c
 delete mode 100644 tools/net/ynl/samples/ethtool.c
 delete mode 100644 tools/net/ynl/samples/netdev.c
 delete mode 100644 tools/net/ynl/samples/ovs.c
 delete mode 100644 tools/net/ynl/samples/rt-addr.c
 delete mode 100644 tools/net/ynl/samples/rt-link.c
 delete mode 100644 tools/net/ynl/samples/rt-route.c
 delete mode 100644 tools/net/ynl/samples/tc-filter-add.c
 delete mode 100644 tools/net/ynl/samples/tc.c
 create mode 100644 tools/net/ynl/tests/devlink.c
 create mode 100644 tools/net/ynl/tests/ethtool.c
 create mode 100644 tools/net/ynl/tests/netdev.c
 create mode 100644 tools/net/ynl/tests/ovs.c
 create mode 100644 tools/net/ynl/tests/rt-addr.c
 create mode 100644 tools/net/ynl/tests/rt-link.c
 create mode 100644 tools/net/ynl/tests/rt-route.c
 create mode 100644 tools/net/ynl/tests/tc.c
 rename tools/net/ynl/{samples => tests}/.gitignore (87%)
 create mode 100755 tools/net/ynl/tests/devlink.sh
 create mode 100755 tools/net/ynl/tests/ethtool.sh
 create mode 100755 tools/net/ynl/tests/rt-addr.sh
 create mode 100755 tools/net/ynl/tests/rt-route.sh
 create mode 100644 tools/net/ynl/tests/ynl_nsim_lib.sh

-- 
2.53.0