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