2020-02-12 12:20:53 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2020-08-21 19:06:43 -07:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
source $(cd $(dirname $0) && pwd)/helpers.sh
|
2020-02-12 12:20:53 -08:00
|
|
|
|
2020-02-26 15:18:09 -08:00
|
|
|
test_progs() {
|
2020-08-06 21:30:15 -07:00
|
|
|
if [[ "${KERNEL}" != '4.9.0' ]]; then
|
2020-08-21 19:06:43 -07:00
|
|
|
travis_fold start test_progs "Testing test_progs"
|
2020-08-06 21:30:15 -07:00
|
|
|
./test_progs ${BLACKLIST:+-b$BLACKLIST} ${WHITELIST:+-t$WHITELIST}
|
2020-08-21 19:06:43 -07:00
|
|
|
travis_fold end test_progs
|
2020-08-06 21:30:15 -07:00
|
|
|
fi
|
2020-07-07 00:46:30 -07:00
|
|
|
|
2020-08-21 19:06:43 -07:00
|
|
|
travis_fold start test_progs-no_alu32 "Testing test_progs-no_alu32"
|
2020-07-07 00:46:30 -07:00
|
|
|
./test_progs-no_alu32 ${BLACKLIST:+-b$BLACKLIST} ${WHITELIST:+-t$WHITELIST}
|
2020-08-21 19:06:43 -07:00
|
|
|
travis_fold end test_progs-no_alu32
|
2020-02-26 15:18:09 -08:00
|
|
|
}
|
2020-02-21 21:16:40 -08:00
|
|
|
|
2020-02-26 15:18:09 -08:00
|
|
|
test_maps() {
|
2020-08-21 19:06:43 -07:00
|
|
|
travis_fold start test_maps "Testing test_maps"
|
2020-03-11 14:48:35 -07:00
|
|
|
./test_maps
|
2020-08-21 19:06:43 -07:00
|
|
|
travis_fold end test_maps
|
2020-02-26 15:18:09 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
test_verifier() {
|
2020-08-21 19:06:43 -07:00
|
|
|
travis_fold start test_verifier "Testing test_verifier"
|
2020-02-26 15:18:09 -08:00
|
|
|
./test_verifier
|
2020-08-21 19:06:43 -07:00
|
|
|
travis_fold end test_verifier
|
2020-02-26 15:18:09 -08:00
|
|
|
}
|
2020-02-26 00:09:02 -08:00
|
|
|
|
2020-08-21 19:06:43 -07:00
|
|
|
travis_fold end vm_init
|
|
|
|
|
|
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
|