2020-02-12 12:20:53 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2020-02-26 15:18:09 -08:00
|
|
|
set -euxo pipefail
|
2020-02-12 12:20:53 -08:00
|
|
|
|
2020-02-26 15:18:09 -08:00
|
|
|
test_progs() {
|
|
|
|
|
echo TEST_PROGS
|
|
|
|
|
./test_progs ${BLACKLIST:+-b$BLACKLIST} ${WHITELIST:+-t$WHITELIST}
|
|
|
|
|
}
|
2020-02-21 21:16:40 -08:00
|
|
|
|
2020-02-26 15:18:09 -08:00
|
|
|
test_maps() {
|
|
|
|
|
echo TEST_MAPS
|
|
|
|
|
# Allow failing on older kernels.
|
2020-03-11 14:48:35 -07:00
|
|
|
./test_maps
|
2020-02-26 15:18:09 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
test_verifier() {
|
|
|
|
|
echo TEST_VERIFIER
|
|
|
|
|
./test_verifier
|
|
|
|
|
}
|
2020-02-26 00:09:02 -08:00
|
|
|
|
2020-02-12 12:20:53 -08:00
|
|
|
configs_path='libbpf/travis-ci/vmtest/configs'
|
|
|
|
|
blacklist_path="$configs_path/blacklist/BLACKLIST-${KERNEL}"
|
|
|
|
|
if [[ -s "${blacklist_path}" ]]; then
|
2020-03-12 18:54:43 -07:00
|
|
|
BLACKLIST=$(cat "${blacklist_path}" | cut -d'#' -f1 | tr -s '[:space:]' ',')
|
2020-02-12 12:20:53 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
whitelist_path="$configs_path/whitelist/WHITELIST-${KERNEL}"
|
|
|
|
|
if [[ -s "${whitelist_path}" ]]; then
|
2020-03-12 18:54:43 -07:00
|
|
|
WHITELIST=$(cat "${whitelist_path}" | cut -d'#' -f1 | tr -s '[:space:]' ',')
|
2020-02-12 12:20:53 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cd libbpf/selftests/bpf
|
|
|
|
|
|
2020-03-11 14:48:35 -07:00
|
|
|
test_progs
|
2020-02-26 15:18:09 -08:00
|
|
|
|
2020-03-11 14:48:35 -07:00
|
|
|
if [[ "${KERNEL}" == 'latest' ]]; then
|
|
|
|
|
test_maps
|
|
|
|
|
test_verifier
|
|
|
|
|
fi
|