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"