mirror of
https://gitee.com/openharmony/third_party_libbpf
synced 2024-10-07 22:43:33 +00:00
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:
parent
70eac9941d
commit
1206ab0e75
@ -1,11 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euxo pipefail
|
||||||
|
|
||||||
LLVM_VER=11
|
LLVM_VER=11
|
||||||
LIBBPF_PATH="${REPO_ROOT}"
|
LIBBPF_PATH="${REPO_ROOT}"
|
||||||
REPO_PATH="travis-ci/vmtest/bpf-next"
|
REPO_PATH="travis-ci/vmtest/bpf-next"
|
||||||
|
|
||||||
# temporary work-around for failing tests
|
PREPARE_SELFTESTS_SCRIPT=${VMTEST_ROOT}/prepare_selftests-${KERNEL}.sh
|
||||||
rm "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c"
|
if [ -f "${PREPARE_SELFTESTS_SCRIPT}" ]; then
|
||||||
|
(cd "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" && ${PREPARE_SELFTESTS_SCRIPT})
|
||||||
|
fi
|
||||||
|
|
||||||
make \
|
make \
|
||||||
CLANG=clang-${LLVM_VER} \
|
CLANG=clang-${LLVM_VER} \
|
||||||
@ -21,5 +25,4 @@ cd ${LIBBPF_PATH}
|
|||||||
rm selftests/bpf/.gitignore
|
rm selftests/bpf/.gitignore
|
||||||
git add selftests
|
git add selftests
|
||||||
|
|
||||||
blacklist_path="${VMTEST_ROOT}/configs/blacklist"
|
git add "${VMTEST_ROOT}/configs/blacklist"
|
||||||
git add "${blacklist_path}"
|
|
||||||
|
@ -12,16 +12,25 @@ fentry_fexit # bpf_prog_test_tracing missing
|
|||||||
fentry_test # bpf_prog_test_tracing missing
|
fentry_test # bpf_prog_test_tracing missing
|
||||||
fexit_bpf2bpf # freplace is missing
|
fexit_bpf2bpf # freplace is missing
|
||||||
fexit_test # bpf_prog_test_tracing 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
|
get_stack_raw_tp # exercising BPF verifier bug causing infinite loop
|
||||||
link_pinning # bpf_link is missing
|
link_pinning # bpf_link is missing
|
||||||
mmap # 5.5 kernel is too permissive with re-mmaping
|
mmap # 5.5 kernel is too permissive with re-mmaping
|
||||||
modify_return # fmod_ret support is missing
|
modify_return # fmod_ret support is missing
|
||||||
ns_current_pid_tgid # bpf_get_ns_current_pid_tgid() helper is missing
|
ns_current_pid_tgid # bpf_get_ns_current_pid_tgid() helper is missing
|
||||||
perf_branches # bpf_read_branch_records() 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
|
select_reuseport # UDP support is missing
|
||||||
sk_assign # bpf_sk_assign helper missing
|
sk_assign # bpf_sk_assign helper missing
|
||||||
|
skb_helpers # helpers added in 5.8+
|
||||||
sockmap_listen # no listen socket supportin SOCKMAP
|
sockmap_listen # no listen socket supportin SOCKMAP
|
||||||
skb_ctx # ctx_{size, }_{in, out} in BPF_PROG_TEST_RUN is missing
|
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_global_funcs # kernel doesn't support BTF linkage=global on FUNCs
|
||||||
test_lsm # no BPF_LSM support
|
test_lsm # no BPF_LSM support
|
||||||
test_overhead # no fmod_ret support
|
test_overhead # no fmod_ret support
|
||||||
@ -33,3 +42,4 @@ xdp_bpf2bpf # freplace is missing
|
|||||||
|
|
||||||
# TEMPORARILY DISABLED
|
# TEMPORARILY DISABLED
|
||||||
send_signal # flaky
|
send_signal # flaky
|
||||||
|
cls_redirect # latest Clang breaks BPF verification
|
||||||
|
@ -2,3 +2,4 @@
|
|||||||
send_signal # flaky
|
send_signal # flaky
|
||||||
test_lsm # semi-working
|
test_lsm # semi-working
|
||||||
sk_assign # needs better setup in Travis CI
|
sk_assign # needs better setup in Travis CI
|
||||||
|
cls_redirect # latest Clang breaks BPF verification
|
||||||
|
12
travis-ci/vmtest/prepare_selftests-5.5.0.sh
Executable file
12
travis-ci/vmtest/prepare_selftests-5.5.0.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user