From 9cdcbb5121e1cd1e79aa16eb7ff2707ef3df5fb2 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Mon, 11 Jan 2021 16:05:02 -0800 Subject: [PATCH] script: Modify unit tests to support mshv Signed-off-by: Muminul Islam --- scripts/dev_cli.sh | 2 +- scripts/run_unit_tests.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/dev_cli.sh b/scripts/dev_cli.sh index 3188ffe44..4cd37be7b 100755 --- a/scripts/dev_cli.sh +++ b/scripts/dev_cli.sh @@ -355,7 +355,7 @@ cmd_tests() { cflags="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/" fi - if [[ "$unit" = true && $hypervisor = "kvm" ]] ; then + if [[ "$unit" = true ]] ; then say "Running unit tests for $target..." $DOCKER_RUNTIME run \ --workdir "$CTR_CLH_ROOT_DIR" \ diff --git a/scripts/run_unit_tests.sh b/scripts/run_unit_tests.sh index 781ee378d..79a9ef899 100755 --- a/scripts/run_unit_tests.sh +++ b/scripts/run_unit_tests.sh @@ -7,8 +7,10 @@ process_common_args "$@" BUILD_TARGET=${BUILD_TARGET-x86_64-unknown-linux-gnu} cargo_args=("") -[ $(uname -m) = "aarch64" ] && cargo_args+=("--no-default-features") -[ $(uname -m) = "aarch64" ] && cargo_args+=("--features kvm") +if [[ $(uname -m) = "aarch64" || $hypervisor = "mshv" ]]; then + cargo_args+=("--no-default-features") + cargo_args+=("--features $hypervisor") +fi export RUST_BACKTRACE=1 cargo test --target $BUILD_TARGET --workspace ${cargo_args[@]} || exit 1;