tests: Consolidate live migration tests into common scopes

Move the live migration tests themselves into the common scopes allowing
the tests to now run interleaved together hopefully reducing CI time.

On MSHV the live migration tests are now not compiled in rather than
compiled in and skipped (as the helpers are not compiled in for MSHV.)

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:50:08 +01:00
parent d9395b9773
commit 2fb08c4b5d
4 changed files with 1786 additions and 1835 deletions

View File

@@ -5,7 +5,9 @@ use std::collections::HashMap;
use std::fs::{File, OpenOptions};
use std::io::{BufRead, Read, Seek, SeekFrom, Write};
use std::path::{Path, PathBuf};
use std::process::{Child, Command, Stdio};
#[cfg(not(feature = "mshv"))]
use std::process::Stdio;
use std::process::{Child, Command};
use std::string::String;
use std::sync::mpsc;
use std::sync::mpsc::Receiver;
@@ -14,6 +16,7 @@ use std::{cmp, fs, io, thread};
use test_infra::*;
use vmm_sys_util::tempdir::TempDir;
#[cfg(not(feature = "mshv"))]
use wait_timeout::ChildExt;
const QCOW2_INCOMPATIBLE_FEATURES_OFFSET: u64 = 72;
@@ -1061,6 +1064,7 @@ pub(crate) fn bdf_from_hotplug_response(
(segment_id, bus_id, device_id, function_id)
}
#[cfg(not(feature = "mshv"))]
pub(crate) fn start_live_migration(
migration_socket: &str,
src_api_socket: &str,
@@ -1146,6 +1150,7 @@ pub(crate) fn start_live_migration(
send_success && receive_success
}
#[cfg(not(feature = "mshv"))]
pub(crate) fn print_and_panic(
src_vm: Child,
dest_vm: Child,

File diff suppressed because it is too large Load Diff

View File

@@ -283,21 +283,6 @@ else
exit $RES
fi
# Run all test cases related to live migration
if [ $RES -eq 0 ]; then
time cargo nextest run $test_features --retries 3 --no-fail-fast --no-tests=pass --test-threads="$TEST_THREADS_DEFAULT" "live_migration_parallel::$test_filter" -- ${test_binary_args[*]}
RES=$?
else
exit $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=$?
else
exit $RES
fi
# Run tests on dbus_api
if [ $RES -eq 0 ]; then
cargo build --features "mshv,dbus_api" --all --release --target "$BUILD_TARGET"

View File

@@ -223,17 +223,6 @@ 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"