From 5b05e0cdcd99b12dd05323712463d474dca109d7 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Thu, 6 Jan 2022 14:36:24 -0800 Subject: [PATCH] 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 --- scripts/run_integration_tests_aarch64.sh | 14 +++++++------- scripts/run_integration_tests_live_migration.sh | 12 +++++------- scripts/run_integration_tests_sgx.sh | 9 ++++----- scripts/run_integration_tests_vfio.sh | 9 ++++----- scripts/run_integration_tests_windows.sh | 12 +++++------- scripts/run_integration_tests_x86_64.sh | 14 ++++++-------- 6 files changed, 31 insertions(+), 39 deletions(-) diff --git a/scripts/run_integration_tests_aarch64.sh b/scripts/run_integration_tests_aarch64.sh index e9ef413c3..0f64410fc 100755 --- a/scripts/run_integration_tests_aarch64.sh +++ b/scripts/run_integration_tests_aarch64.sh @@ -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 diff --git a/scripts/run_integration_tests_live_migration.sh b/scripts/run_integration_tests_live_migration.sh index 03c94b6b4..2c28b30cb 100755 --- a/scripts/run_integration_tests_live_migration.sh +++ b/scripts/run_integration_tests_live_migration.sh @@ -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 diff --git a/scripts/run_integration_tests_sgx.sh b/scripts/run_integration_tests_sgx.sh index 9d4c7eaa4..6388d6034 100755 --- a/scripts/run_integration_tests_sgx.sh +++ b/scripts/run_integration_tests_sgx.sh @@ -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 diff --git a/scripts/run_integration_tests_vfio.sh b/scripts/run_integration_tests_vfio.sh index 1f39a7dbc..10a3b479d 100755 --- a/scripts/run_integration_tests_vfio.sh +++ b/scripts/run_integration_tests_vfio.sh @@ -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 diff --git a/scripts/run_integration_tests_windows.sh b/scripts/run_integration_tests_windows.sh index 5c73eb668..b9a43f062 100755 --- a/scripts/run_integration_tests_windows.sh +++ b/scripts/run_integration_tests_windows.sh @@ -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 diff --git a/scripts/run_integration_tests_x86_64.sh b/scripts/run_integration_tests_x86_64.sh index db3012dfb..40e68be30 100755 --- a/scripts/run_integration_tests_x86_64.sh +++ b/scripts/run_integration_tests_x86_64.sh @@ -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