tests: Fold live migration tests into x86-64 script

Move the live migration test running from their own script into the
x86-64 script (on aarch64 they were already in the same script.) They
were historically separate as they were new. Now they are established it
makes sense for them to be combined.

The timeout in the GitHub workflow has been extended to accommodate the
extra work in the same step.

The Rust test scopes are unchanged - the running of the tests has been
moved.

Assisted-by: Claude:Opus-4.7
Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-04-25 18:41:24 +01:00
parent 5909ce85ed
commit c118606d64
4 changed files with 32 additions and 143 deletions

View File

@@ -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,16 @@ 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"
if [ ! -f "$WORKLOADS_DIR/hypervisor-fw" ]; then
@@ -111,6 +122,14 @@ if ! sha1sum sha1sums-x86_64 sha1sums-x86_64-common --check; then
fi
popd || exit
# Download Cloud Hypervisor binary from its last stable release for live-upgrade tests
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
chmod +x $CH_RELEASE_NAME
popd || exit
# Build custom kernel based on virtio-pmem and virtio-fs upstream patches
VMLINUX_IMAGE="$WORKLOADS_DIR/vmlinux-x86_64"
if [ ! -f "$VMLINUX_IMAGE" ]; then
@@ -204,6 +223,17 @@ if [ $RES -eq 0 ]; then
RES=$?
fi
# Run all live-migration test cases
if [ $RES -eq 0 ]; then
time cargo nextest run $test_features --retries 3 --no-fail-fast --no-tests=pass --test-threads="${PARALLEL_INTEGRATION_TESTS_NUM}" "live_migration_parallel::$test_filter" -- ${test_binary_args[*]}
RES=$?
fi
if [ $RES -eq 0 ]; then
time cargo nextest run $test_features --retries 3 --no-fail-fast --no-tests=pass --test-threads=1 "live_migration_sequential::$test_filter" -- ${test_binary_args[*]}
RES=$?
fi
# Run tests on dbus_api
if [ $RES -eq 0 ]; then
cargo build --features "mshv,dbus_api" --all --release --target "$BUILD_TARGET"