mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-04 13:34:11 -04:00
Add a test framework for YAML Netlink (YNL) tools, covering both CLI and ethtool functionality. The framework includes: 1) cli: family listing, netdev, ethtool, rt-* families, and nlctrl operations 2) ethtool: device info, statistics, ring/coalesce/pause parameters, and feature gettings The current YNL syntax is a bit obscure, and end users may not always know how to use it. This test framework provides usage examples and also serves as a regression test to catch potential breakages caused by future changes. Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Acked-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Link: https://patch.msgid.link/20251124022055.33389-1-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
33 lines
811 B
Makefile
33 lines
811 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# Makefile for YNL tests
|
|
|
|
TESTS := \
|
|
test_ynl_cli.sh \
|
|
test_ynl_ethtool.sh \
|
|
# end of TESTS
|
|
|
|
all: $(TESTS)
|
|
|
|
run_tests:
|
|
@for test in $(TESTS); do \
|
|
./$$test; \
|
|
done
|
|
|
|
install: $(TESTS)
|
|
@mkdir -p $(DESTDIR)/usr/bin
|
|
@mkdir -p $(DESTDIR)/usr/share/kselftest
|
|
@cp ../../../testing/selftests/kselftest/ktap_helpers.sh $(DESTDIR)/usr/share/kselftest/
|
|
@for test in $(TESTS); do \
|
|
name=$$(basename $$test .sh); \
|
|
sed -e 's|^ynl=.*|ynl="ynl"|' \
|
|
-e 's|^ynl_ethtool=.*|ynl_ethtool="ynl-ethtool"|' \
|
|
-e 's|KSELFTEST_KTAP_HELPERS=.*|KSELFTEST_KTAP_HELPERS="/usr/share/kselftest/ktap_helpers.sh"|' \
|
|
$$test > $(DESTDIR)/usr/bin/$$name; \
|
|
chmod +x $(DESTDIR)/usr/bin/$$name; \
|
|
done
|
|
|
|
clean distclean:
|
|
@# Nothing to clean
|
|
|
|
.PHONY: all install clean run_tests
|