tests: Replace last vestiges of focal use with jammy

Focal has served us well for many years but is now beyond EOL. Remove
all remaining use of focal images from the CI.

Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-05-08 12:02:51 +01:00
parent 1b5c6d9977
commit 55adcc27da
13 changed files with 70 additions and 190 deletions

View File

@@ -301,7 +301,7 @@ pub(crate) fn test_cpu_topology(
packages: u8,
use_fw: bool,
) {
let disk_config = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest = Guest::new(Box::new(disk_config));
let total_vcpus = threads_per_core * cores_per_package * packages;
let direct_kernel_boot_path = direct_kernel_boot_path();
@@ -895,15 +895,7 @@ pub(crate) fn _test_virtio_fs(
use_generic_vhost_user: bool,
pci_segment: Option<u16>,
) {
#[cfg(target_arch = "aarch64")]
let focal_image = if hotplug {
FOCAL_IMAGE_UPDATE_KERNEL_NAME.to_string()
} else {
FOCAL_IMAGE_NAME.to_string()
};
#[cfg(target_arch = "x86_64")]
let focal_image = FOCAL_IMAGE_NAME.to_string();
let disk_config = UbuntuDiskConfig::new(focal_image);
let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest = Guest::new(Box::new(disk_config));
let api_socket = temp_api_path(&guest.tmp_dir);
let event_path = temp_event_monitor_path(&guest.tmp_dir);
@@ -1281,7 +1273,7 @@ pub(crate) fn test_memory_mergeable(mergeable: bool) {
// We assume the number of shared pages in the rest of the system to be constant
let ksm_ps_init = get_ksm_pages_shared();
let disk_config1 = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
let disk_config1 = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest1 = Guest::new(Box::new(disk_config1));
let mut child1 = GuestCommand::new(&guest1)
.default_cpus()
@@ -1307,7 +1299,7 @@ pub(crate) fn test_memory_mergeable(mergeable: bool) {
let ksm_ps_guest1 = get_ksm_pages_shared();
let disk_config2 = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
let disk_config2 = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest2 = Guest::new(Box::new(disk_config2));
let mut child2 = GuestCommand::new(&guest2)
.default_cpus()
@@ -1353,15 +1345,7 @@ pub(crate) fn test_memory_mergeable(mergeable: bool) {
// interface attached to the virtual IOMMU since this is the one used to
// send all commands through SSH.
pub(crate) fn _test_virtio_iommu(_acpi: bool /* not needed on x86_64 */) {
// Virtio-iommu support is ready in recent kernel (v5.14). But the kernel in
// Focal image is still old.
// So if ACPI is enabled on AArch64, we use a modified Focal image in which
// the kernel binary has been updated.
#[cfg(target_arch = "aarch64")]
let focal_image = FOCAL_IMAGE_UPDATE_KERNEL_NAME.to_string();
#[cfg(target_arch = "x86_64")]
let focal_image = FOCAL_IMAGE_NAME.to_string();
let disk_config = UbuntuDiskConfig::new(focal_image);
let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest = Guest::new(Box::new(disk_config));
#[cfg(target_arch = "x86_64")]
@@ -3114,7 +3098,7 @@ pub(crate) fn _test_watchdog(guest: &Guest) {
// Trigger a panic (sync first). We need to do this inside a screen with a delay so the SSH command returns.
guest.ssh_command("screen -dmS reboot sh -c \"sleep 5; echo s | tee /proc/sysrq-trigger; echo c | sudo tee /proc/sysrq-trigger\"").unwrap();
// Allow some time for the watchdog to trigger (max 30s) and reboot to happen
guest.wait_vm_boot_custom_timeout(50).unwrap();
guest.wait_vm_boot_custom_timeout(120).unwrap();
// Check a reboot is triggered by the watchdog
expected_reboot_count += 1;
assert_eq!(get_reboot_count(guest), expected_reboot_count);

View File

@@ -1022,7 +1022,6 @@ pub(crate) fn enable_guest_watchdog(guest: &Guest, watchdog_sec: u32) {
.unwrap_or_default()
);
// Enable systemd watchdog
guest
.ssh_command(&format!(
"echo RuntimeWatchdogSec={watchdog_sec}s | sudo tee -a /etc/systemd/system.conf"

View File

@@ -51,16 +51,16 @@ mod common_parallel {
#[test]
#[cfg(target_arch = "x86_64")]
fn test_focal_hypervisor_fw() {
let guest = basic_regular_guest!(FOCAL_IMAGE_NAME)
fn test_jammy_hypervisor_fw() {
let guest = basic_regular_guest!(JAMMY_IMAGE_NAME)
.with_kernel(fw_path(FwType::RustHypervisorFirmware));
_test_simple_launch(&guest);
}
#[test]
#[cfg(target_arch = "x86_64")]
fn test_focal_ovmf() {
let guest = basic_regular_guest!(FOCAL_IMAGE_NAME).with_kernel(fw_path(FwType::Ovmf));
fn test_jammy_ovmf() {
let guest = basic_regular_guest!(JAMMY_IMAGE_NAME).with_kernel(fw_path(FwType::Ovmf));
_test_simple_launch(&guest);
}
@@ -342,8 +342,7 @@ mod common_parallel {
#[test]
#[cfg(target_arch = "x86_64")]
fn test_iommu_segments() {
let focal_image = FOCAL_IMAGE_NAME.to_string();
let disk_config = UbuntuDiskConfig::new(focal_image);
let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest = Guest::new(Box::new(disk_config));
// Prepare another disk file for the virtio-disk device
@@ -584,14 +583,14 @@ mod common_parallel {
#[test]
fn test_virtio_block_io_uring() {
let guest =
make_virtio_block_guest(&GuestFactory::new_regular_guest_factory(), FOCAL_IMAGE_NAME);
make_virtio_block_guest(&GuestFactory::new_regular_guest_factory(), JAMMY_IMAGE_NAME);
_test_virtio_block(&guest, false, true, false, false, ImageType::Raw);
}
#[test]
fn test_virtio_block_aio() {
let guest =
make_virtio_block_guest(&GuestFactory::new_regular_guest_factory(), FOCAL_IMAGE_NAME)
make_virtio_block_guest(&GuestFactory::new_regular_guest_factory(), JAMMY_IMAGE_NAME)
.with_cpu(4);
_test_virtio_block(&guest, true, false, false, false, ImageType::Raw);
}
@@ -599,7 +598,7 @@ mod common_parallel {
#[test]
fn test_virtio_block_sync() {
let guest =
make_virtio_block_guest(&GuestFactory::new_regular_guest_factory(), FOCAL_IMAGE_NAME)
make_virtio_block_guest(&GuestFactory::new_regular_guest_factory(), JAMMY_IMAGE_NAME)
.with_cpu(4);
_test_virtio_block(&guest, true, true, false, false, ImageType::Raw);
}
@@ -1661,8 +1660,8 @@ mod common_parallel {
let mut raw_file_path = workload_path.clone();
let mut vhd_file_path = workload_path;
raw_file_path.push(FOCAL_IMAGE_NAME);
vhd_file_path.push(FOCAL_IMAGE_NAME_VHD);
raw_file_path.push(JAMMY_IMAGE_NAME);
vhd_file_path.push(JAMMY_IMAGE_NAME_VHD);
// Generate VHD file from RAW file
std::process::Command::new("qemu-img")
@@ -1677,7 +1676,7 @@ mod common_parallel {
.expect("Expect generating VHD image from RAW image");
let guest = make_virtio_block_guest(
&GuestFactory::new_regular_guest_factory(),
FOCAL_IMAGE_NAME_VHD,
JAMMY_IMAGE_NAME_VHD,
);
_test_virtio_block(&guest, false, false, false, false, ImageType::FixedVhd);
}
@@ -1689,8 +1688,8 @@ mod common_parallel {
let mut raw_file_path = workload_path.clone();
let mut vhdx_file_path = workload_path;
raw_file_path.push(FOCAL_IMAGE_NAME);
vhdx_file_path.push(FOCAL_IMAGE_NAME_VHDX);
raw_file_path.push(JAMMY_IMAGE_NAME);
vhdx_file_path.push(JAMMY_IMAGE_NAME_VHDX);
// Generate dynamic VHDX file from RAW file
std::process::Command::new("qemu-img")
@@ -1704,7 +1703,7 @@ mod common_parallel {
.expect("Expect generating dynamic VHDx image from RAW image");
let guest = make_virtio_block_guest(
&GuestFactory::new_regular_guest_factory(),
FOCAL_IMAGE_NAME_VHDX,
JAMMY_IMAGE_NAME_VHDX,
);
_test_virtio_block(&guest, false, false, true, false, ImageType::Vhdx);
}
@@ -2769,11 +2768,7 @@ mod common_parallel {
#[test]
fn test_memory_hotplug() {
#[cfg(target_arch = "aarch64")]
let focal_image = FOCAL_IMAGE_UPDATE_KERNEL_NAME.to_string();
#[cfg(target_arch = "x86_64")]
let focal_image = FOCAL_IMAGE_NAME.to_string();
let disk_config = UbuntuDiskConfig::new(focal_image);
let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest = Guest::new(Box::new(disk_config));
let api_socket = temp_api_path(&guest.tmp_dir);
@@ -4939,11 +4934,7 @@ mod common_parallel {
}
fn _test_pmem_hotplug(pci_segment: Option<u16>) {
#[cfg(target_arch = "aarch64")]
let focal_image = FOCAL_IMAGE_UPDATE_KERNEL_NAME.to_string();
#[cfg(target_arch = "x86_64")]
let focal_image = FOCAL_IMAGE_NAME.to_string();
let disk_config = UbuntuDiskConfig::new(focal_image);
let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest = Guest::new(Box::new(disk_config));
#[cfg(target_arch = "x86_64")]
@@ -5232,7 +5223,7 @@ mod common_parallel {
#[test]
fn test_watchdog() {
let guest = basic_regular_guest!(FOCAL_IMAGE_NAME);
let guest = basic_regular_guest!(JAMMY_IMAGE_NAME);
_test_watchdog(&guest);
}
@@ -5265,10 +5256,10 @@ mod common_parallel {
#[test]
#[cfg(not(feature = "mshv"))]
fn test_ovs_dpdk() {
let disk_config1 = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
let disk_config1 = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest1 = Guest::new(Box::new(disk_config1));
let disk_config2 = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
let disk_config2 = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest2 = Guest::new(Box::new(disk_config2));
let api_socket_source = format!("{}.1", temp_api_path(&guest2.tmp_dir));
@@ -6274,7 +6265,7 @@ mod common_parallel {
#[cfg(not(feature = "mshv"))]
fn _test_live_migration_watchdog(upgrade_test: bool, local: bool) {
let disk_config = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest = Guest::new(Box::new(disk_config));
let kernel_path = direct_kernel_boot_path();
let console_text = String::from("On a branch floating down river a cricket, singing.");
@@ -6451,7 +6442,7 @@ mod common_parallel {
// Trigger a panic (sync first). We need to do this inside a screen with a delay so the SSH command returns.
guest.ssh_command("screen -dmS reboot sh -c \"sleep 5; echo s | tee /proc/sysrq-trigger; echo c | sudo tee /proc/sysrq-trigger\"").unwrap();
// Allow some time for the watchdog to trigger (max 30s) and reboot to happen
guest.wait_vm_boot_custom_timeout(50).unwrap();
guest.wait_vm_boot_custom_timeout(120).unwrap();
// Check a reboot is triggered by the watchdog
expected_reboot_count += 1;
assert_eq!(get_reboot_count(&guest), expected_reboot_count);
@@ -9347,10 +9338,10 @@ mod common_sequential {
#[cfg(not(feature = "mshv"))]
fn _test_live_migration_ovs_dpdk(upgrade_test: bool, local: bool) {
let ovs_disk_config = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
let ovs_disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let ovs_guest = Guest::new(Box::new(ovs_disk_config));
let migration_disk_config = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
let migration_disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let migration_guest = Guest::new(Box::new(migration_disk_config));
let src_api_socket = temp_api_path(&migration_guest.tmp_dir);
@@ -11129,9 +11120,9 @@ mod aarch64_acpi {
#[test]
fn test_simple_launch_acpi() {
let focal = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
let jammy = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
vec![Box::new(focal)].drain(..).for_each(|disk_config| {
vec![Box::new(jammy)].drain(..).for_each(|disk_config| {
let guest = Guest::new(disk_config);
let mut child = GuestCommand::new(&guest)

View File

@@ -27,8 +27,8 @@ mod common_cvm {
}
#[test]
fn test_focal_simple_launch() {
let guest = basic_cvm_guest!(FOCAL_IMAGE_NAME);
fn test_jammy_simple_launch() {
let guest = basic_cvm_guest!(JAMMY_IMAGE_NAME);
_test_simple_launch(&guest);
}
@@ -116,7 +116,7 @@ mod common_cvm {
fn test_virtio_block_io_uring() {
let guest = make_virtio_block_guest(
&GuestFactory::new_confidential_guest_factory(),
FOCAL_IMAGE_NAME,
JAMMY_IMAGE_NAME,
);
_test_virtio_block(&guest, false, true, false, false, ImageType::Raw);
}
@@ -125,7 +125,7 @@ mod common_cvm {
fn test_virtio_block_aio() {
let guest = make_virtio_block_guest(
&GuestFactory::new_confidential_guest_factory(),
FOCAL_IMAGE_NAME,
JAMMY_IMAGE_NAME,
);
_test_virtio_block(&guest, true, false, false, false, ImageType::Raw);
}
@@ -134,7 +134,7 @@ mod common_cvm {
fn test_virtio_block_sync() {
let guest = make_virtio_block_guest(
&GuestFactory::new_confidential_guest_factory(),
FOCAL_IMAGE_NAME,
JAMMY_IMAGE_NAME,
);
_test_virtio_block(&guest, true, true, false, false, ImageType::Raw);
}
@@ -289,7 +289,7 @@ mod common_cvm {
#[test]
fn test_watchdog() {
let guest = basic_cvm_guest!(FOCAL_IMAGE_NAME);
let guest = basic_cvm_guest!(JAMMY_IMAGE_NAME);
_test_watchdog(&guest);
}