vmtest: optionally adjust selftest files depending on kernel version

Some selftests can't be compiled on older kernels. This allows to fix these
problems, if necessary.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
This commit is contained in:
Andrii Nakryiko 2020-06-01 17:35:31 -07:00 committed by Andrii Nakryiko
parent 70eac9941d
commit 1206ab0e75
4 changed files with 30 additions and 4 deletions

View File

@ -1,11 +1,15 @@
#!/bin/bash
set -euxo pipefail
LLVM_VER=11
LIBBPF_PATH="${REPO_ROOT}"
REPO_PATH="travis-ci/vmtest/bpf-next"
# temporary work-around for failing tests
rm "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c"
PREPARE_SELFTESTS_SCRIPT=${VMTEST_ROOT}/prepare_selftests-${KERNEL}.sh
if [ -f "${PREPARE_SELFTESTS_SCRIPT}" ]; then
(cd "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" && ${PREPARE_SELFTESTS_SCRIPT})
fi
make \
CLANG=clang-${LLVM_VER} \
@ -21,5 +25,4 @@ cd ${LIBBPF_PATH}
rm selftests/bpf/.gitignore
git add selftests
blacklist_path="${VMTEST_ROOT}/configs/blacklist"
git add "${blacklist_path}"
git add "${VMTEST_ROOT}/configs/blacklist"

View File

@ -12,16 +12,25 @@ fentry_fexit # bpf_prog_test_tracing missing
fentry_test # bpf_prog_test_tracing missing
fexit_bpf2bpf # freplace is missing
fexit_test # bpf_prog_test_tracing missing
flow_dissector # bpf_link-based flow dissector is in 5.8+
flow_dissector_reattach
get_stack_raw_tp # exercising BPF verifier bug causing infinite loop
link_pinning # bpf_link is missing
mmap # 5.5 kernel is too permissive with re-mmaping
modify_return # fmod_ret support is missing
ns_current_pid_tgid # bpf_get_ns_current_pid_tgid() helper is missing
perf_branches # bpf_read_branch_records() helper is missing
ringbuf # BPF_MAP_TYPE_RINGBUF is supported in 5.8+
reference_tracking/classifier/sk_lookup_success # bug in verifier w/ tracking references
select_reuseport # UDP support is missing
sk_assign # bpf_sk_assign helper missing
skb_helpers # helpers added in 5.8+
sockmap_listen # no listen socket supportin SOCKMAP
skb_ctx # ctx_{size, }_{in, out} in BPF_PROG_TEST_RUN is missing
# latest Clang generates code that fails to verify
test_bpf_verif_scale/strobemeta.o
test_bpf_verif_scale/strobemeta_nounroll1.o
test_bpf_verif_scale/strobemeta_nounroll2.o
test_global_funcs # kernel doesn't support BTF linkage=global on FUNCs
test_lsm # no BPF_LSM support
test_overhead # no fmod_ret support
@ -33,3 +42,4 @@ xdp_bpf2bpf # freplace is missing
# TEMPORARILY DISABLED
send_signal # flaky
cls_redirect # latest Clang breaks BPF verification

View File

@ -2,3 +2,4 @@
send_signal # flaky
test_lsm # semi-working
sk_assign # needs better setup in Travis CI
cls_redirect # latest Clang breaks BPF verification

View File

@ -0,0 +1,12 @@
#!/bin/bash
set -euxo pipefail
# these tests expect vmlinux.h to have latest defiition of bpf_devmap_val xdp_md->egress_ifindex
rm progs/test_xdp_with_devmap_helpers.c
rm progs/test_xdp_devmap_helpers.c
rm prog_tests/xdp_devmap_attach.c
# no BPF_F_NO_PREALLOC in BTF and no sk_msg_md->sk field
rm progs/test_skmsg_load_helpers.c
rm prog_tests/sockmap_basic.c