1#!/bin/bash 2set -x 3 4source $HOME/.cargo/env 5source $(dirname "$0")/test-util.sh 6 7process_common_args "$@" 8 9if [[ "$hypervisor" = "mshv" ]]; then 10 echo "Unsupported SGX test for MSHV" 11 exit 1 12fi 13 14# For now these values are default for kvm 15features="" 16 17BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}" 18CFLAGS="" 19TARGET_CC="" 20if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then 21TARGET_CC="musl-gcc" 22CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/" 23fi 24 25cargo build --all --release $features --target $BUILD_TARGET 26strip target/$BUILD_TARGET/release/cloud-hypervisor 27 28export RUST_BACKTRACE=1 29 30time cargo test $features "sgx::$test_filter" -- ${test_binary_args[*]} 31RES=$? 32 33exit $RES 34