2023-12-15 20:33:46 +00:00
|
|
|
#!/usr/bin/env bash
|
2024-01-29 15:38:44 +00:00
|
|
|
# shellcheck disable=SC2048,SC2086
|
2021-03-16 15:11:00 +00:00
|
|
|
set -x
|
|
|
|
|
2023-10-31 18:56:05 +00:00
|
|
|
# This set of vfio tests require to be ran on a specific machine with
|
|
|
|
# specific hardware (e.g. the "vfio" bera-metal worker equipped with a
|
|
|
|
# Nvidia Tesla T4 card). So the provisioning of the running machine is
|
|
|
|
# out of the scope of this script, including the custom guest image with
|
|
|
|
# Nvidia drivers installed, and properly configured Nvidia Tesla T4 card.
|
|
|
|
|
2024-01-29 15:38:44 +00:00
|
|
|
# shellcheck source=/dev/null
|
|
|
|
source "$HOME"/.cargo/env
|
|
|
|
source "$(dirname "$0")"/test-util.sh
|
2021-03-16 15:11:00 +00:00
|
|
|
|
|
|
|
process_common_args "$@"
|
|
|
|
|
2022-08-03 15:28:53 +00:00
|
|
|
WORKLOADS_DIR="$HOME/workloads"
|
2023-06-14 10:58:09 +00:00
|
|
|
|
2023-12-15 20:33:46 +00:00
|
|
|
download_hypervisor_fw
|
2022-08-03 15:28:53 +00:00
|
|
|
|
2021-03-16 15:11:00 +00:00
|
|
|
CFLAGS=""
|
|
|
|
if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
|
2024-01-29 15:38:44 +00:00
|
|
|
# shellcheck disable=SC2034
|
2023-10-19 22:08:39 +00:00
|
|
|
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
2021-03-16 15:11:00 +00:00
|
|
|
fi
|
|
|
|
|
2024-01-29 15:38:44 +00:00
|
|
|
cargo build --features mshv --all --release --target "$BUILD_TARGET"
|
2021-03-16 15:11:00 +00:00
|
|
|
|
2022-08-03 15:28:53 +00:00
|
|
|
export RUST_BACKTRACE=1
|
2023-10-31 18:56:05 +00:00
|
|
|
time cargo test "vfio::test_nvidia" -- --test-threads=1 ${test_binary_args[*]}
|
2021-03-16 15:11:00 +00:00
|
|
|
RES=$?
|
|
|
|
|
|
|
|
exit $RES
|