mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-29 12:49:07 +08:00
Move kernel version check inwards
The run_selftests.sh script defines functions for running individual tests. However, not all tests are run in all configurations. E.g., test_progs is not run on 4.9.0 kernels and test_maps is only run when testing on the "latest" kernel version. The checks for these conditions, however, are applied inconsistently: some are in the functions themselves and others on the call site. This change unifies all checks to happen within the test function itself. Signed-off-by: Daniel Müller <deso@posteo.net>
This commit is contained in:
committed by
danielocfb
parent
66b788c1a4
commit
c03b9f6d0b
@@ -36,17 +36,21 @@ test_progs_noalu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test_maps() {
|
test_maps() {
|
||||||
foldable start test_maps "Testing test_maps"
|
if [[ "${KERNEL}" == 'latest' ]]; then
|
||||||
./test_maps && true
|
foldable start test_maps "Testing test_maps"
|
||||||
echo "test_maps:$?" >> "${STATUS_FILE}"
|
./test_maps && true
|
||||||
foldable end test_maps
|
echo "test_maps:$?" >> "${STATUS_FILE}"
|
||||||
|
foldable end test_maps
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
test_verifier() {
|
test_verifier() {
|
||||||
foldable start test_verifier "Testing test_verifier"
|
if [[ "${KERNEL}" == 'latest' ]]; then
|
||||||
./test_verifier && true
|
foldable start test_verifier "Testing test_verifier"
|
||||||
echo "test_verifier:$?" >> "${STATUS_FILE}"
|
./test_verifier && true
|
||||||
foldable end test_verifier
|
echo "test_verifier:$?" >> "${STATUS_FILE}"
|
||||||
|
foldable end test_verifier
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
foldable end vm_init
|
foldable end vm_init
|
||||||
@@ -59,8 +63,5 @@ cd ${PROJECT_NAME}/selftests/bpf
|
|||||||
|
|
||||||
test_progs
|
test_progs
|
||||||
test_progs_noalu
|
test_progs_noalu
|
||||||
|
test_maps
|
||||||
if [[ "${KERNEL}" == 'latest' ]]; then
|
test_verifier
|
||||||
test_maps
|
|
||||||
test_verifier
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user