xref: /cloud-hypervisor/scripts/run_integration_tests_vfio.sh (revision 42e9632c53d14cd0040db4952d40ba806c4b6ee9)
191fe48d5SPhilipp Schuster#!/usr/bin/env bash
22b2d0065SRuslan Mstoi# shellcheck disable=SC2048,SC2086
304dc4968SSebastien Boeufset -x
404dc4968SSebastien Boeuf
5bd0ee623SBo Chen# This set of vfio tests require to be ran on a specific machine with
6*42e9632cSJosh Soref# specific hardware (e.g. the "vfio" bare-metal worker equipped with a
7bd0ee623SBo Chen# Nvidia Tesla T4 card). So the provisioning of the running machine is
8bd0ee623SBo Chen# out of the scope of this script, including the custom guest image with
9bd0ee623SBo Chen# Nvidia drivers installed, and properly configured Nvidia Tesla T4 card.
10bd0ee623SBo Chen
112b2d0065SRuslan Mstoi# shellcheck source=/dev/null
122b2d0065SRuslan Mstoisource "$HOME"/.cargo/env
132b2d0065SRuslan Mstoisource "$(dirname "$0")"/test-util.sh
1404dc4968SSebastien Boeuf
1504dc4968SSebastien Boeufprocess_common_args "$@"
1604dc4968SSebastien Boeuf
173b0f6247SSebastien BoeufWORKLOADS_DIR="$HOME/workloads"
1856207dc3SRuslan Mstoi
1972e213ebSRob Bradforddownload_hypervisor_fw
203b0f6247SSebastien Boeuf
2104dc4968SSebastien BoeufCFLAGS=""
2204dc4968SSebastien Boeufif [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
232b2d0065SRuslan Mstoi    # shellcheck disable=SC2034
2404dc4968SSebastien Boeuf    CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
2504dc4968SSebastien Boeuffi
2604dc4968SSebastien Boeuf
272b2d0065SRuslan Mstoicargo build --features mshv --all --release --target "$BUILD_TARGET"
283b0f6247SSebastien Boeuf
2904dc4968SSebastien Boeufexport RUST_BACKTRACE=1
30d83fc7f6SRob Bradfordtime cargo test "vfio::test_nvidia" -- --test-threads=1 ${test_binary_args[*]}
313b0f6247SSebastien BoeufRES=$?
323b0f6247SSebastien Boeuf
3304dc4968SSebastien Boeufexit $RES
34