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
|
|
|
|
2021-11-11 15:17:43 -08:00
|
|
|
ARCH=$(uname -m)
|
|
|
|
|
|
2021-11-30 00:01:24 +00:00
|
|
|
STATUS_FILE=/exitstatus
|
|
|
|
|
|
2021-03-26 14:39:33 +01:00
|
|
|
read_lists() {
|
|
|
|
|
(for path in "$@"; do
|
|
|
|
|
if [[ -s "$path" ]]; then
|
|
|
|
|
cat "$path"
|
|
|
|
|
fi;
|
|
|
|
|
done) | cut -d'#' -f1 | tr -s ' \t\n' ','
|
|
|
|
|
}
|
|
|
|
|
|
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"
|
2021-11-30 00:01:24 +00:00
|
|
|
# "&& true" does not change the return code (it is not executed
|
|
|
|
|
# if the Python script fails), but it prevents exiting on a
|
|
|
|
|
# failure due to the "set -e".
|
|
|
|
|
./test_progs ${BLACKLIST:+-d$BLACKLIST} ${WHITELIST:+-a$WHITELIST} && true
|
|
|
|
|
echo "test_progs:$?" >> "${STATUS_FILE}"
|
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"
|
2021-11-30 00:01:24 +00:00
|
|
|
./test_progs-no_alu32 ${BLACKLIST:+-d$BLACKLIST} ${WHITELIST:+-a$WHITELIST} && true
|
|
|
|
|
echo "test_progs-no_alu32:$?" >> "${STATUS_FILE}"
|
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"
|
2021-11-30 00:01:24 +00:00
|
|
|
./test_maps && true
|
|
|
|
|
echo "test_maps:$?" >> "${STATUS_FILE}"
|
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"
|
2021-11-30 00:01:24 +00:00
|
|
|
./test_verifier && true
|
|
|
|
|
echo "test_verifier:$?" >> "${STATUS_FILE}"
|
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
|
|
|
|
|
|
2021-11-11 15:17:43 -08:00
|
|
|
configs_path=${PROJECT_NAME}/vmtest/configs
|
2021-03-26 14:39:33 +01:00
|
|
|
BLACKLIST=$(read_lists "$configs_path/blacklist/BLACKLIST-${KERNEL}" "$configs_path/blacklist/BLACKLIST-${KERNEL}.${ARCH}")
|
|
|
|
|
WHITELIST=$(read_lists "$configs_path/whitelist/WHITELIST-${KERNEL}" "$configs_path/whitelist/WHITELIST-${KERNEL}.${ARCH}")
|
2020-02-12 12:20:53 -08:00
|
|
|
|
2021-11-11 15:17:43 -08:00
|
|
|
cd ${PROJECT_NAME}/selftests/bpf
|
2020-02-12 12:20:53 -08:00
|
|
|
|
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
|
2021-08-06 17:40:18 -07:00
|
|
|
# test_maps
|
2020-03-11 14:48:35 -07:00
|
|
|
test_verifier
|
|
|
|
|
fi
|