]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests/bpf: Allow selftests to build with older xxd
authorAlan Maguire <alan.maguire@oracle.com>
Thu, 20 Nov 2025 08:47:54 +0000 (08:47 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 24 Nov 2025 18:00:16 +0000 (10:00 -0800)
Currently selftests require xxd with the "-n <name>" option
which allows the user to specify a name not derived from
the input object path.  Instead of relying on this newer
feature, older xxd can be used if we link our desired name
("test_progs_verification_cert") to the input object.

Many distros ship xxd in vim-common package and do not have
the latest xxd with -n support.

Fixes: b720903e2b14d ("selftests/bpf: Enable signature verification for some lskel tests")
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Link: https://lore.kernel.org/r/20251120084754.640405-3-alan.maguire@oracle.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/.gitignore
tools/testing/selftests/bpf/Makefile

index be1ee7ba7ce03155367030bfa1976d4ac8181772..ca557e5668fd84659dc03ad0d2d1dd4b5816b5a2 100644 (file)
@@ -23,6 +23,7 @@ test_tcpnotify_user
 test_libbpf
 xdping
 test_cpp
+test_progs_verification_cert
 *.d
 *.subskel.h
 *.skel.h
index 34ea23c63bd5d1c062bbe7207f78ee6f265ab4d1..bac22265e7fffe286124b9beb8d31cc2e7af34b9 100644 (file)
@@ -731,7 +731,8 @@ $(VERIFICATION_CERT) $(PRIVATE_KEY): $(VERIFY_SIG_SETUP)
        $(Q)$(VERIFY_SIG_SETUP) genkey $(BUILD_DIR)
 
 $(VERIFY_SIG_HDR): $(VERIFICATION_CERT)
-       $(Q)xxd -i -n test_progs_verification_cert $< > $@
+       $(Q)ln -fs $< test_progs_verification_cert && \
+       xxd -i test_progs_verification_cert > $@
 
 # Define test_progs test runner.
 TRUNNER_TESTS_DIR := prog_tests
@@ -905,7 +906,8 @@ EXTRA_CLEAN := $(SCRATCH_DIR) $(HOST_SCRATCH_DIR)                   \
        $(addprefix $(OUTPUT)/,*.o *.d *.skel.h *.lskel.h *.subskel.h   \
                               no_alu32 cpuv4 bpf_gcc                   \
                               liburandom_read.so)                      \
-       $(OUTPUT)/FEATURE-DUMP.selftests
+       $(OUTPUT)/FEATURE-DUMP.selftests                                \
+       test_progs_verification_cert
 
 .PHONY: docs docs-clean