1#!/usr/bin/env bash 2set -x 3 4# This set of vfio tests require to be ran on a specific machine with 5# specific hardware (e.g. the "vfio" bera-metal worker equipped with a 6# Nvidia Tesla T4 card). So the provisioning of the running machine is 7# out of the scope of this script, including the custom guest image with 8# Nvidia drivers installed, and properly configured Nvidia Tesla T4 card. 9 10source $HOME/.cargo/env 11source $(dirname "$0")/test-util.sh 12 13process_common_args "$@" 14 15WORKLOADS_DIR="$HOME/workloads" 16 17download_hypervisor_fw 18 19CFLAGS="" 20if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then 21 CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/" 22fi 23 24cargo build --features mshv --all --release --target $BUILD_TARGET 25 26export RUST_BACKTRACE=1 27time cargo test "vfio::test_nvidia" -- --test-threads=1 ${test_binary_args[*]} 28RES=$? 29 30exit $RES 31