1#!/bin/bash 2 3set -euo pipefail 4 5source $(cd $(dirname $0) && pwd)/helpers.sh 6 7ARCH=$(uname -m) 8 9STATUS_FILE=/exitstatus 10 11read_lists() { 12 (for path in "$@"; do 13 if [[ -s "$path" ]]; then 14 cat "$path" 15 fi; 16 done) | cut -d'#' -f1 | tr -s ' \t\n' ',' 17} 18 19test_progs() { 20 if [[ "${KERNEL}" != '4.9.0' ]]; then 21 travis_fold start test_progs "Testing test_progs" 22 # "&& true" does not change the return code (it is not executed 23 # if the Python script fails), but it prevents exiting on a 24 # failure due to the "set -e". 25 ./test_progs ${BLACKLIST:+-d$BLACKLIST} ${WHITELIST:+-a$WHITELIST} && true 26 echo "test_progs:$?" >> "${STATUS_FILE}" 27 travis_fold end test_progs 28 fi 29 30 travis_fold start test_progs-no_alu32 "Testing test_progs-no_alu32" 31 ./test_progs-no_alu32 ${BLACKLIST:+-d$BLACKLIST} ${WHITELIST:+-a$WHITELIST} && true 32 echo "test_progs-no_alu32:$?" >> "${STATUS_FILE}" 33 travis_fold end test_progs-no_alu32 34} 35 36test_maps() { 37 travis_fold start test_maps "Testing test_maps" 38 ./test_maps && true 39 echo "test_maps:$?" >> "${STATUS_FILE}" 40 travis_fold end test_maps 41} 42 43test_verifier() { 44 travis_fold start test_verifier "Testing test_verifier" 45 ./test_verifier && true 46 echo "test_verifier:$?" >> "${STATUS_FILE}" 47 travis_fold end test_verifier 48} 49 50travis_fold end vm_init 51 52configs_path=${PROJECT_NAME}/vmtest/configs 53BLACKLIST=$(read_lists "$configs_path/blacklist/BLACKLIST-${KERNEL}" "$configs_path/blacklist/BLACKLIST-${KERNEL}.${ARCH}") 54WHITELIST=$(read_lists "$configs_path/whitelist/WHITELIST-${KERNEL}" "$configs_path/whitelist/WHITELIST-${KERNEL}.${ARCH}") 55 56cd ${PROJECT_NAME}/selftests/bpf 57 58test_progs 59 60if [[ "${KERNEL}" == 'latest' ]]; then 61 # test_maps 62 test_verifier 63fi 64