[PATCH] selftests/bpf: Install test modules into $INSTALL_PATH

From: Ricardo B. Marlière
Date: Thu Jul 24 2025 - 18:10:36 EST


The tests expect the modules to be in the same working directory, but when
using a different $INSTALL_PATH they are not copied over.

Signed-off-by: Ricardo B. Marlière <rbm@xxxxxxxx>
---
# cd tools/testing/selftests/kselftest_install && ./run_kselftest.sh -t bpf:test_verifier
TAP version 13
1..1
# timeout set to 0
# selftests: bpf: test_verifier
# Can't find bpf_testmod.ko kernel module: -2
not ok 1 selftests: bpf: test_verifier # exit=1
---
tools/testing/selftests/bpf/Makefile | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 4863106034dfbcd35f830432322f054d897bb406..56b0565af8a76a9e784836a836935dd22e814fc0 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -877,5 +877,7 @@ override define INSTALL_RULE
@for DIR in $(TEST_INST_SUBDIRS); do \
mkdir -p $(INSTALL_PATH)/$$DIR; \
rsync -a $(OUTPUT)/$$DIR/*.bpf.o $(INSTALL_PATH)/$$DIR;\
+ rsync -a $(OUTPUT)/$$DIR/*.ko $(INSTALL_PATH)/$$DIR;\
+ rsync -a $(OUTPUT)/*.ko $(INSTALL_PATH);\
done
endef

---
base-commit: f227e9ed4fe4f2fed40e4725d6c10860d30c2ea2
change-id: 20250724-bpf-next_for-next-f1de3e4becc8

Best regards,
--
Ricardo B. Marlière <rbm@xxxxxxxx>