Skip to content

Commit ad93ba0

Browse files
alan-maguireAlexei Starovoitov
authored andcommitted
selftests/bpf: Allow selftests to build with older xxd
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: b720903 ("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>
1 parent 90ae54b commit ad93ba0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tools/testing/selftests/bpf/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ test_tcpnotify_user
2323
test_libbpf
2424
xdping
2525
test_cpp
26+
test_progs_verification_cert
2627
*.d
2728
*.subskel.h
2829
*.skel.h

tools/testing/selftests/bpf/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,8 @@ $(VERIFICATION_CERT) $(PRIVATE_KEY): $(VERIFY_SIG_SETUP)
731731
$(Q)$(VERIFY_SIG_SETUP) genkey $(BUILD_DIR)
732732

733733
$(VERIFY_SIG_HDR): $(VERIFICATION_CERT)
734-
$(Q)xxd -i -n test_progs_verification_cert $< > $@
734+
$(Q)ln -fs $< test_progs_verification_cert && \
735+
xxd -i test_progs_verification_cert > $@
735736

736737
# Define test_progs test runner.
737738
TRUNNER_TESTS_DIR := prog_tests
@@ -905,7 +906,8 @@ EXTRA_CLEAN := $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \
905906
$(addprefix $(OUTPUT)/,*.o *.d *.skel.h *.lskel.h *.subskel.h \
906907
no_alu32 cpuv4 bpf_gcc \
907908
liburandom_read.so) \
908-
$(OUTPUT)/FEATURE-DUMP.selftests
909+
$(OUTPUT)/FEATURE-DUMP.selftests \
910+
test_progs_verification_cert
909911

910912
.PHONY: docs docs-clean
911913

0 commit comments

Comments
 (0)