Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch Test VHD to Ubuntu 24.04 #773

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ impl SimpleFlowNode for Node {
vmm_test_images::KnownVhd::Gen1WindowsDataCenterCore2022,
vmm_test_images::KnownVhd::Gen2WindowsDataCenterCore2022,
vmm_test_images::KnownVhd::Ubuntu2204Server,
vmm_test_images::KnownVhd::Ubuntu2404ServerX64,
]),
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ impl SimpleFlowNode for Node {
vmm_test_images::KnownVhd::Gen1WindowsDataCenterCore2022,
vmm_test_images::KnownVhd::Gen2WindowsDataCenterCore2022,
vmm_test_images::KnownVhd::Ubuntu2204Server,
vmm_test_images::KnownVhd::Ubuntu2404ServerX64,
]),
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ impl petri_artifacts_core::ResolveTestArtifact for OpenvmmKnownPathsTestArtifact
_ if id == test_vhd::FREE_BSD_13_2_X64 => get_guest_vhd_path(KnownVhd::FreeBsd13_2),
_ if id == test_vhd::UBUNTU_2204_SERVER_X64 => get_guest_vhd_path(KnownVhd::Ubuntu2204Server),
_ if id == test_vhd::UBUNTU_2404_SERVER_AARCH64 => get_guest_vhd_path(KnownVhd::Ubuntu2404ServerAarch64),
_ if id == test_vhd::UBUNTU_2404_SERVER_X64 => get_guest_vhd_path(KnownVhd::Ubuntu2404ServerX64),

_ if id == test_iso::FREE_BSD_13_2_X64 => get_guest_iso_path(KnownIso::FreeBsd13_2),

Expand Down
15 changes: 15 additions & 0 deletions vmm_tests/petri_artifacts_vmm_test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,21 @@ pub mod artifacts {
const FILENAME: &'static str = "ubuntu-24.04-server-cloudimg-arm64.vhd";
const SIZE: u64 = 3758211584;
}

declare_artifacts! {
/// Ubuntu 24.04 Server X64
UBUNTU_2404_SERVER_X64
}

impl IsTestVhd for UBUNTU_2404_SERVER_X64 {
const OS_FLAVOR: OsFlavor = OsFlavor::Linux;
const ARCH: MachineArch = MachineArch::X86_64;
}

impl IsHostedOnHvliteAzureBlobStore for UBUNTU_2404_SERVER_X64 {
const FILENAME: &'static str = "ubuntu-24.04-server-cloudimg-amd64.vhd";
const SIZE: u64 = 3758211584;
}
}

/// Test ISO artifacts
Expand Down
6 changes: 6 additions & 0 deletions vmm_tests/vmm_test_images/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub enum KnownVhd {
FreeBsd13_2,
Ubuntu2204Server,
Ubuntu2404ServerAarch64,
Ubuntu2404ServerX64,
}

struct KnownVhdMeta {
Expand Down Expand Up @@ -75,6 +76,11 @@ const KNOWN_VHD_METADATA: &[KnownVhdMeta] = &[
petri_artifacts_vmm_test::artifacts::test_vhd::UBUNTU_2404_SERVER_AARCH64::FILENAME,
petri_artifacts_vmm_test::artifacts::test_vhd::UBUNTU_2404_SERVER_AARCH64::SIZE,
),
KnownVhdMeta::new(
KnownVhd::Ubuntu2404ServerX64,
petri_artifacts_vmm_test::artifacts::test_vhd::UBUNTU_2404_SERVER_X64::FILENAME,
petri_artifacts_vmm_test::artifacts::test_vhd::UBUNTU_2404_SERVER_X64::SIZE,
),
];

impl KnownVhd {
Expand Down
5 changes: 4 additions & 1 deletion vmm_tests/vmm_test_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,9 @@ fn parse_vhd(input: ParseStream<'_>, generation: Generation) -> syn::Result<Imag
"ubuntu_2404_server_aarch64" => Ok(image_info!(
::petri_artifacts_vmm_test::artifacts::test_vhd::UBUNTU_2404_SERVER_AARCH64
)),
"ubuntu_2404_server_x64" => Ok(image_info!(
::petri_artifacts_vmm_test::artifacts::test_vhd::UBUNTU_2404_SERVER_X64
)),
_ => Err(Error::new(word.span(), "unrecognized vhd")),
}
}
Expand Down Expand Up @@ -673,7 +676,7 @@ fn parse_extra_deps(input: ParseStream<'_>) -> syn::Result<Vec<Path>> {
/// - `none`: No guest
///
/// Valid VHD options are:
/// - `ubuntu_2204_server_x64`: Canonical's provided Ubuntu Linux 22.04 cloudimg disk image
/// - `ubuntu_2404_server_x64`: Canonical's provided Ubuntu Linux 22.04 cloudimg disk image
/// - `windows_datacenter_core_2022_x64`: Our provided Windows Datacenter Core 2022 VHD
/// - `freebsd_13_2_x64`: The FreeBSD Project's provided FreeBSD 13.2 VHD
///
Expand Down
12 changes: 6 additions & 6 deletions vmm_tests/vmm_tests/tests/tests/multiarch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ async fn frontpage(config: PetriVmConfigOpenVmm) -> anyhow::Result<()> {
hyperv_uefi_x64(vhd(windows_datacenter_core_2022_x64)),
openvmm_pcat_x64(vhd(windows_datacenter_core_2022_x64)),
hyperv_pcat_x64(vhd(windows_datacenter_core_2022_x64)),
openvmm_openhcl_uefi_x64(vhd(ubuntu_2204_server_x64)),
hyperv_openhcl_uefi_x64(vhd(ubuntu_2204_server_x64)),
openvmm_uefi_x64(vhd(ubuntu_2204_server_x64)),
hyperv_uefi_x64(vhd(ubuntu_2204_server_x64)),
openvmm_pcat_x64(vhd(ubuntu_2204_server_x64)),
hyperv_pcat_x64(vhd(ubuntu_2204_server_x64)),
openvmm_openhcl_uefi_x64(vhd(ubuntu_2404_server_x64)),
hyperv_openhcl_uefi_x64(vhd(ubuntu_2404_server_x64)),
openvmm_uefi_x64(vhd(ubuntu_2404_server_x64)),
hyperv_uefi_x64(vhd(ubuntu_2404_server_x64)),
openvmm_pcat_x64(vhd(ubuntu_2404_server_x64)),
hyperv_pcat_x64(vhd(ubuntu_2404_server_x64)),
openvmm_uefi_aarch64(vhd(ubuntu_2404_server_aarch64)),
hyperv_uefi_aarch64(vhd(ubuntu_2404_server_aarch64)),
hyperv_openhcl_uefi_aarch64(vhd(ubuntu_2404_server_aarch64))
Expand Down
20 changes: 10 additions & 10 deletions vmm_tests/vmm_tests/tests/tests/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async fn boot_no_agent(config: PetriVmConfigOpenVmm) -> anyhow::Result<()> {
#[openvmm_test(
openhcl_linux_direct_x64,
openhcl_uefi_x64(vhd(windows_datacenter_core_2022_x64)),
openhcl_uefi_x64(vhd(ubuntu_2204_server_x64))
openhcl_uefi_x64(vhd(ubuntu_2404_server_x64))
)]
async fn boot_alias_map(config: PetriVmConfigOpenVmm) -> anyhow::Result<()> {
let (vm, agent) = config.with_vtl0_alias_map().run().await?;
Expand All @@ -43,7 +43,7 @@ async fn boot_alias_map(config: PetriVmConfigOpenVmm) -> anyhow::Result<()> {
/// Basic boot tests with TPM enabled.
#[openvmm_test(
openhcl_uefi_x64(vhd(windows_datacenter_core_2022_x64)),
openhcl_uefi_x64(vhd(ubuntu_2204_server_x64))
openhcl_uefi_x64(vhd(ubuntu_2404_server_x64))
)]
async fn boot_with_tpm(config: PetriVmConfigOpenVmm) -> anyhow::Result<()> {
let os_flavor = config.os_flavor();
Expand Down Expand Up @@ -149,9 +149,9 @@ async fn vbs_boot_with_tpm(config: PetriVmConfigOpenVmm) -> anyhow::Result<()> {
// openhcl_uefi_x64(vhd(windows_datacenter_core_2022_x64)),
// uefi_x64(vhd(windows_datacenter_core_2022_x64)),
// pcat_x64(vhd(windows_datacenter_core_2022_x64)),
// openhcl_uefi_x64(vhd(ubuntu_2204_server_x64)),
// uefi_x64(vhd(ubuntu_2204_server_x64)),
// pcat_x64(vhd(ubuntu_2204_server_x64))
// openhcl_uefi_x64(vhd(ubuntu_2404_server_x64)),
// uefi_x64(vhd(ubuntu_2404_server_x64)),
// pcat_x64(vhd(ubuntu_2404_server_x64))
)]
async fn reboot(config: PetriVmConfigOpenVmm) -> Result<(), anyhow::Error> {
let (mut vm, agent) = config.run().await?;
Expand Down Expand Up @@ -265,8 +265,8 @@ async fn five_gb(config: PetriVmConfigOpenVmm) -> Result<(), anyhow::Error> {
openhcl_linux_direct_x64,
openhcl_uefi_x64(vhd(windows_datacenter_core_2022_x64)),
uefi_x64(vhd(windows_datacenter_core_2022_x64)),
openhcl_uefi_x64(vhd(ubuntu_2204_server_x64)),
uefi_x64(vhd(ubuntu_2204_server_x64))
openhcl_uefi_x64(vhd(ubuntu_2404_server_x64)),
uefi_x64(vhd(ubuntu_2404_server_x64))
)]
async fn file_transfer_test(config: PetriVmConfigOpenVmm) -> Result<(), anyhow::Error> {
const TEST_CONTENT: &str = "hello world!";
Expand Down Expand Up @@ -326,7 +326,7 @@ async fn mtrrs(config: PetriVmConfigOpenVmm) -> Result<(), anyhow::Error> {
/// Boot with vmbus redirection and shut down.
#[openvmm_test(
openhcl_linux_direct_x64,
openhcl_uefi_x64(vhd(ubuntu_2204_server_x64))
openhcl_uefi_x64(vhd(ubuntu_2404_server_x64))
)]
async fn vmbus_redirect(config: PetriVmConfigOpenVmm) -> Result<(), anyhow::Error> {
let (mut vm, agent) = config.with_vmbus_redirect().run().await?;
Expand All @@ -338,9 +338,9 @@ async fn vmbus_redirect(config: PetriVmConfigOpenVmm) -> Result<(), anyhow::Erro

/// Boot with a battery and check the OS-reported capacity.
#[openvmm_test(
openhcl_uefi_x64(vhd(ubuntu_2204_server_x64)),
openhcl_uefi_x64(vhd(ubuntu_2404_server_x64)),
openhcl_uefi_x64(vhd(windows_datacenter_core_2022_x64)),
uefi_x64(vhd(ubuntu_2204_server_x64)),
uefi_x64(vhd(ubuntu_2404_server_x64)),
uefi_x64(vhd(windows_datacenter_core_2022_x64))
)]
async fn battery_capacity(config: PetriVmConfigOpenVmm) -> Result<(), anyhow::Error> {
Expand Down
6 changes: 3 additions & 3 deletions vmm_tests/vmm_tests/tests/tests/x86_64/openhcl_uefi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async fn nvme_relay_test_core(

/// Test an OpenHCL uefi VM with a NVME disk assigned to VTL2 that boots
/// linux, with vmbus relay. This should expose a disk to VTL0 via vmbus.
#[openvmm_test(openhcl_uefi_x64[nvme](vhd(ubuntu_2204_server_x64)))]
#[openvmm_test(openhcl_uefi_x64[nvme](vhd(ubuntu_2404_server_x64)))]
async fn nvme_relay(config: PetriVmConfigOpenVmm) -> Result<(), anyhow::Error> {
nvme_relay_test_core(config, "").await
}
Expand All @@ -36,7 +36,7 @@ async fn nvme_relay(config: PetriVmConfigOpenVmm) -> Result<(), anyhow::Error> {
/// linux, with vmbus relay. This should expose a disk to VTL0 via vmbus.
///
/// Use the shared pool override to test the shared pool dma path.
#[openvmm_test(openhcl_uefi_x64[nvme](vhd(ubuntu_2204_server_x64)))]
#[openvmm_test(openhcl_uefi_x64[nvme](vhd(ubuntu_2404_server_x64)))]
async fn nvme_relay_shared_pool(config: PetriVmConfigOpenVmm) -> Result<(), anyhow::Error> {
nvme_relay_test_core(config, "OPENHCL_ENABLE_SHARED_VISIBILITY_POOL=1").await
}
Expand All @@ -45,7 +45,7 @@ async fn nvme_relay_shared_pool(config: PetriVmConfigOpenVmm) -> Result<(), anyh
/// linux, with vmbus relay. This should expose a disk to VTL0 via vmbus.
///
/// Use the private pool override to test the private pool dma path.
#[openvmm_test(openhcl_uefi_x64[nvme](vhd(ubuntu_2204_server_x64)))]
#[openvmm_test(openhcl_uefi_x64[nvme](vhd(ubuntu_2404_server_x64)))]
async fn nvme_relay_private_pool(config: PetriVmConfigOpenVmm) -> Result<(), anyhow::Error> {
// Number of pages to reserve as a private pool.
nvme_relay_test_core(config, "OPENHCL_ENABLE_VTL2_GPA_POOL=1024").await
Expand Down