Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'tools-ynl-tests-adjust-makefile-to-mimic-ksft'

Jakub Kicinski says:

====================
tools: ynl: tests: adjust Makefile to mimic ksft

Make a few minor adjustments to tools/net/ynl/tests/Makefile
to align its behavior more with how real kselftests behave.
This series allows running the YNL tests in NIPA with little
extra integration effort.

If anyone already integrated these tests into their CI minor
adjustments to the integration may be needed (due to patch 2).
====================

Link: https://patch.msgid.link/20260303163504.2084981-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+17 -13
+17 -13
tools/net/ynl/tests/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # Makefile for YNL tests 3 3 4 - TESTS := \ 4 + TEST_PROGS := \ 5 5 test_ynl_cli.sh \ 6 6 test_ynl_ethtool.sh \ 7 - # end of TESTS 7 + # end of TEST_PROGS 8 8 9 - all: $(TESTS) 9 + INSTALL_PATH ?= $(DESTDIR)/usr/share/kselftest 10 + 11 + all: $(TEST_PROGS) 10 12 11 13 run_tests: 12 - @for test in $(TESTS); do \ 14 + @for test in $(TEST_PROGS); do \ 13 15 ./$$test; \ 14 16 done 15 17 16 - install: $(TESTS) 17 - @mkdir -p $(DESTDIR)/usr/bin 18 - @mkdir -p $(DESTDIR)/usr/share/kselftest 19 - @cp ../../../testing/selftests/kselftest/ktap_helpers.sh $(DESTDIR)/usr/share/kselftest/ 20 - @for test in $(TESTS); do \ 21 - name=$$(basename $$test .sh); \ 18 + install: $(TEST_PROGS) 19 + @mkdir -p $(INSTALL_PATH)/ynl 20 + @cp ../../../testing/selftests/kselftest/ktap_helpers.sh $(INSTALL_PATH)/ 21 + @for test in $(TEST_PROGS); do \ 22 + name=$$(basename $$test); \ 22 23 sed -e 's|^ynl=.*|ynl="ynl"|' \ 23 24 -e 's|^ynl_ethtool=.*|ynl_ethtool="ynl-ethtool"|' \ 24 - -e 's|KSELFTEST_KTAP_HELPERS=.*|KSELFTEST_KTAP_HELPERS="/usr/share/kselftest/ktap_helpers.sh"|' \ 25 - $$test > $(DESTDIR)/usr/bin/$$name; \ 26 - chmod +x $(DESTDIR)/usr/bin/$$name; \ 25 + -e 's|KSELFTEST_KTAP_HELPERS=.*|KSELFTEST_KTAP_HELPERS="$(INSTALL_PATH)/ktap_helpers.sh"|' \ 26 + $$test > $(INSTALL_PATH)/ynl/$$name; \ 27 + chmod +x $(INSTALL_PATH)/ynl/$$name; \ 27 28 done 29 + @for test in $(TEST_PROGS); do \ 30 + echo "ynl:$$test"; \ 31 + done > $(INSTALL_PATH)/kselftest-list.txt 28 32 29 33 clean distclean: 30 34 @# Nothing to clean