scripts: Remove use of "integration_tests" feature

Given integration tests don't have special annotations, all our
integration test scripts do not need to carry special flags when running
`cargo test`. This commit also removed the "test::" prefix for
pattern-matching different set of integration tests.

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2022-01-06 14:36:24 -08:00 committed by Sebastien Boeuf
parent e7a2a715e0
commit 5b05e0cdcd
6 changed files with 31 additions and 39 deletions

View File

@ -245,8 +245,8 @@ if [[ "$hypervisor" = "mshv" ]]; then
exit 1
fi
features_build=""
features_test="--features integration_tests"
# For now these values are deafult for kvm
features=""
# lock the workloads folder to avoid parallel updating by different containers
(
@ -273,7 +273,7 @@ fi
export RUST_BACKTRACE=1
# Test without ACPI
cargo build --all --release $features_build --target $BUILD_TARGET
cargo build --all --release $features --target $BUILD_TARGET
strip target/$BUILD_TARGET/release/cloud-hypervisor
strip target/$BUILD_TARGET/release/vhost_user_net
strip target/$BUILD_TARGET/release/ch-remote
@ -288,13 +288,13 @@ sudo bash -c "echo 1 > /sys/kernel/mm/ksm/run"
echo 2048 | sudo tee /proc/sys/vm/nr_hugepages
# Run all direct kernel boot (Device Tree) test cases in mod `parallel`
time cargo test $features_test "tests::parallel::$test_filter"
time cargo test $features "parallel::$test_filter"
RES=$?
# Run some tests in sequence since the result could be affected by other tests
# running in parallel.
if [ $RES -eq 0 ]; then
time cargo test $features_test "tests::sequential::$test_filter" -- --test-threads=1
time cargo test $features "sequential::$test_filter" -- --test-threads=1
RES=$?
else
exit $RES
@ -302,7 +302,7 @@ fi
# Run all ACPI test cases
if [ $RES -eq 0 ]; then
time cargo test $features_test "tests::aarch64_acpi::$test_filter"
time cargo test $features "aarch64_acpi::$test_filter"
RES=$?
else
exit $RES
@ -310,7 +310,7 @@ fi
# Run all test cases related to live migration
if [ $RES -eq 0 ]; then
time cargo test $features_test "tests::live_migration::$test_filter" -- --test-threads=1
time cargo test $features "live_migration::$test_filter" -- --test-threads=1
RES=$?
else
exit $RES

View File

@ -11,13 +11,11 @@ mkdir -p "$WORKLOADS_DIR"
process_common_args "$@"
# For now these values are deafult for kvm
features_build=""
features_test="--features integration_tests"
# For now these values are default for kvm
features=""
if [ "$hypervisor" = "mshv" ] ; then
features_build="--no-default-features --features mshv,common"
features_test="--no-default-features --features mshv,common,integration_tests"
features="--no-default-features --features mshv,common"
fi
cp scripts/sha1sums-x86_64 $WORKLOADS_DIR
@ -79,7 +77,7 @@ if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
fi
cargo build --all --release $features_build --target $BUILD_TARGET
cargo build --all --release $features --target $BUILD_TARGET
strip target/$BUILD_TARGET/release/cloud-hypervisor
strip target/$BUILD_TARGET/release/vhost_user_net
strip target/$BUILD_TARGET/release/ch-remote
@ -89,7 +87,7 @@ echo 6144 | sudo tee /proc/sys/vm/nr_hugepages
sudo chmod a+rwX /dev/hugepages
export RUST_BACKTRACE=1
time cargo test $features_test "tests::live_migration::$test_filter" -- --test-threads=1
time cargo test $features "live_migration::$test_filter" -- --test-threads=1
RES=$?
exit $RES

View File

@ -11,9 +11,8 @@ if [[ "$hypervisor" = "mshv" ]]; then
exit 1
fi
# For now these values are deafult for kvm
features_build=""
features_test="--features integration_tests"
# For now these values are default for kvm
features=""
BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}"
CFLAGS=""
@ -23,12 +22,12 @@ TARGET_CC="musl-gcc"
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
fi
cargo build --all --release $features_build --target $BUILD_TARGET
cargo build --all --release $features --target $BUILD_TARGET
strip target/$BUILD_TARGET/release/cloud-hypervisor
export RUST_BACKTRACE=1
time cargo test $features_test "tests::sgx::$test_filter"
time cargo test $features "sgx::$test_filter"
RES=$?
exit $RES

View File

@ -5,9 +5,8 @@ source $HOME/.cargo/env
source $(dirname "$0")/test-util.sh
process_common_args "$@"
# For now these values are deafult for kvm
features_build=""
features_test="--features integration_tests"
# For now these values are default for kvm
features=""
BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}"
CFLAGS=""
@ -17,12 +16,12 @@ TARGET_CC="musl-gcc"
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
fi
cargo build --all --release $features_build --target $BUILD_TARGET
cargo build --all --release $features --target $BUILD_TARGET
strip target/$BUILD_TARGET/release/cloud-hypervisor
export RUST_BACKTRACE=1
time cargo test $features_test "tests::vfio::$test_filter" -- --test-threads=1
time cargo test $features "vfio::$test_filter" -- --test-threads=1
RES=$?
exit $RES

View File

@ -5,13 +5,11 @@ source $HOME/.cargo/env
source $(dirname "$0")/test-util.sh
process_common_args "$@"
# For now these values are deafult for kvm
features_build=""
features_test="--features integration_tests"
# For now these values are default for kvm
features=""
if [ "$hypervisor" = "mshv" ] ; then
features_build="--no-default-features --features mshv,common"
features_test="--no-default-features --features mshv,common,integration_tests"
features="--no-default-features --features mshv,common"
fi
WIN_IMAGE_FILE="/root/workloads/windows-server-2019.raw"
@ -46,14 +44,14 @@ dmsetup mknodes
dmsetup create windows-snapshot-base --table "0 $img_blk_size snapshot-origin /dev/mapper/windows-base"
dmsetup mknodes
cargo build --all --release $features_build --target $BUILD_TARGET
cargo build --all --release $features --target $BUILD_TARGET
strip target/$BUILD_TARGET/release/cloud-hypervisor
export RUST_BACKTRACE=1
# Only run with 1 thread to avoid tests interfering with one another because
# Windows has a static IP configured
time cargo test $features_test "tests::windows::$test_filter"
time cargo test $features "windows::$test_filter"
RES=$?
dmsetup remove_all -f

View File

@ -11,13 +11,11 @@ mkdir -p "$WORKLOADS_DIR"
process_common_args "$@"
# For now these values are deafult for kvm
features_build=""
features_test="--features integration_tests"
# For now these values are default for kvm
features=""
if [ "$hypervisor" = "mshv" ] ; then
features_build="--no-default-features --features mshv,common"
features_test="--no-default-features --features mshv,common,integration_tests"
features="--no-default-features --features mshv,common"
fi
cp scripts/sha1sums-x86_64 $WORKLOADS_DIR
@ -183,7 +181,7 @@ TARGET_CC="musl-gcc"
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
fi
cargo build --all --release $features_build --target $BUILD_TARGET
cargo build --all --release $features --target $BUILD_TARGET
strip target/$BUILD_TARGET/release/cloud-hypervisor
strip target/$BUILD_TARGET/release/vhost_user_net
strip target/$BUILD_TARGET/release/ch-remote
@ -203,14 +201,14 @@ echo 6144 | sudo tee /proc/sys/vm/nr_hugepages
sudo chmod a+rwX /dev/hugepages
export RUST_BACKTRACE=1
time cargo test $features_test "tests::parallel::$test_filter"
time cargo test $features "parallel::$test_filter"
RES=$?
# Run some tests in sequence since the result could be affected by other tests
# running in parallel.
if [ $RES -eq 0 ]; then
export RUST_BACKTRACE=1
time cargo test $features_test "tests::sequential::$test_filter" -- --test-threads=1
time cargo test $features "sequential::$test_filter" -- --test-threads=1
RES=$?
fi