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 <muislam@microsoft.com>
This commit is contained in:
Muminul Islam
2025-09-02 15:43:03 -07:00
committed by Wei Liu
parent c38596d6d3
commit 1ca6c159ef
2 changed files with 12 additions and 2 deletions

View File

@@ -538,6 +538,7 @@ cmd_tests() {
--env TARGET_CC="$target_cc" \ --env TARGET_CC="$target_cc" \
--env AUTH_DOWNLOAD_TOKEN="$AUTH_DOWNLOAD_TOKEN" \ --env AUTH_DOWNLOAD_TOKEN="$AUTH_DOWNLOAD_TOKEN" \
--env LLVM_PROFILE_FILE="$LLVM_PROFILE_FILE" \ --env LLVM_PROFILE_FILE="$LLVM_PROFILE_FILE" \
--env MIGRATABLE_VERSION="$MIGRATABLE_VERSION" \
"$CTR_IMAGE" \ "$CTR_IMAGE" \
./scripts/run_integration_tests_live_migration.sh "$@" || fix_dir_perms $? || exit $? ./scripts/run_integration_tests_live_migration.sh "$@" || fix_dir_perms $? || exit $?
fi fi

View File

@@ -11,6 +11,7 @@ mkdir -p "$WORKLOADS_DIR"
process_common_args "$@" process_common_args "$@"
migratable_version=v39.0
# For now these values are default for kvm # For now these values are default for kvm
test_features="" test_features=""
@@ -18,6 +19,15 @@ if [ "$hypervisor" = "mshv" ]; then
test_features="--features mshv" test_features="--features mshv"
fi 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" cp scripts/sha1sums-x86_64 "$WORKLOADS_DIR"
FOCAL_OS_IMAGE_NAME="focal-server-cloudimg-amd64-custom-20210609-0.qcow2" FOCAL_OS_IMAGE_NAME="focal-server-cloudimg-amd64-custom-20210609-0.qcow2"
@@ -45,8 +55,7 @@ fi
popd || exit popd || exit
# Download Cloud Hypervisor binary from its last stable release # 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/${migratable_version}/cloud-hypervisor-static"
CH_RELEASE_URL="https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/$LAST_RELEASE_VERSION/cloud-hypervisor-static"
CH_RELEASE_NAME="cloud-hypervisor-static" CH_RELEASE_NAME="cloud-hypervisor-static"
pushd "$WORKLOADS_DIR" || exit pushd "$WORKLOADS_DIR" || exit
time wget --quiet $CH_RELEASE_URL -O "$CH_RELEASE_NAME" || exit 1 time wget --quiet $CH_RELEASE_URL -O "$CH_RELEASE_NAME" || exit 1