cloud-hypervisor/scripts/run_unit_tests.sh
Sebastien Boeuf 67025948dc ci: Simplify test scripts
Since all unit and integration tests are run inside containers because
they are called from dev_cli.sh, they always run as root. That's why
both unit and integration scripts can be simplified as they don't need
to apply specific capabilities and run cargo tests in a dedicated 'kvm'
group.

Fixes #1683

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2020-10-07 14:26:13 +02:00

12 lines
345 B
Bash
Executable File

#!/bin/bash
source $HOME/.cargo/env
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 mmio,kvm")
export RUST_BACKTRACE=1
cargo test --target $BUILD_TARGET --workspace ${cargo_args[@]} || exit 1;