From 1ca6c159ef4cca6ffa94f24daa75e7971e8dbd16 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Tue, 2 Sep 2025 15:43:03 -0700 Subject: [PATCH] tests: option to override default migratable version This patch gives user an option to override the default migratable version to any later release. This option makes MSHV specific tests suitable for tests since MSHV is stable after some breaking changes. This patch is also necessary for MSHV CI. Signed-off-by: Muminul Islam --- scripts/dev_cli.sh | 1 + scripts/run_integration_tests_live_migration.sh | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/dev_cli.sh b/scripts/dev_cli.sh index 257889ae5..6dea0d7d2 100755 --- a/scripts/dev_cli.sh +++ b/scripts/dev_cli.sh @@ -538,6 +538,7 @@ cmd_tests() { --env TARGET_CC="$target_cc" \ --env AUTH_DOWNLOAD_TOKEN="$AUTH_DOWNLOAD_TOKEN" \ --env LLVM_PROFILE_FILE="$LLVM_PROFILE_FILE" \ + --env MIGRATABLE_VERSION="$MIGRATABLE_VERSION" \ "$CTR_IMAGE" \ ./scripts/run_integration_tests_live_migration.sh "$@" || fix_dir_perms $? || exit $? fi diff --git a/scripts/run_integration_tests_live_migration.sh b/scripts/run_integration_tests_live_migration.sh index 0df9c01c9..fa0b3dcf4 100755 --- a/scripts/run_integration_tests_live_migration.sh +++ b/scripts/run_integration_tests_live_migration.sh @@ -11,6 +11,7 @@ mkdir -p "$WORKLOADS_DIR" process_common_args "$@" +migratable_version=v39.0 # For now these values are default for kvm test_features="" @@ -18,6 +19,15 @@ if [ "$hypervisor" = "mshv" ]; then test_features="--features mshv" fi +# if migratable version is set to override the default +if [ -n "${MIGRATABLE_VERSION}" ]; then + # validate the version if matched with vxx.0 + if ! [[ "${MIGRATABLE_VERSION}" =~ ^v[0-9]{2,}\.[0-9]$ ]]; then + echo "MIGRATABLE_VERSION should be in format vxx.0, e.g. v47.0" + exit 1 + fi + migratable_version=${MIGRATABLE_VERSION} +fi cp scripts/sha1sums-x86_64 "$WORKLOADS_DIR" FOCAL_OS_IMAGE_NAME="focal-server-cloudimg-amd64-custom-20210609-0.qcow2" @@ -45,8 +55,7 @@ fi popd || exit # Download Cloud Hypervisor binary from its last stable release -LAST_RELEASE_VERSION="v39.0" -CH_RELEASE_URL="https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/$LAST_RELEASE_VERSION/cloud-hypervisor-static" +CH_RELEASE_URL="https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/${migratable_version}/cloud-hypervisor-static" CH_RELEASE_NAME="cloud-hypervisor-static" pushd "$WORKLOADS_DIR" || exit time wget --quiet $CH_RELEASE_URL -O "$CH_RELEASE_NAME" || exit 1