tests: use basic_regular_guest macro in OVMF test

Refactor test_focal_ovmf to use the basic_regular_guest!
macro with the with_kernel() builder instead of manually
constructing UbuntuDiskConfig and setting kernel_path.
This also removes leftover unused disk_config in
test_focal_hypervisor_fw.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Muminul Islam
2026-03-21 16:59:34 -07:00
committed by Rob Bradford
parent 0fc0f2bd0e
commit 6aad6e40c8

View File

@@ -47,7 +47,6 @@ mod common_parallel {
#[test]
#[cfg(target_arch = "x86_64")]
fn test_focal_hypervisor_fw() {
let disk_config = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
let guest = basic_regular_guest!(FOCAL_IMAGE_NAME)
.with_kernel(fw_path(FwType::RustHypervisorFirmware));
_test_simple_launch(&guest);
@@ -56,9 +55,7 @@ mod common_parallel {
#[test]
#[cfg(target_arch = "x86_64")]
fn test_focal_ovmf() {
let disk_config = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
let mut guest = Guest::new(Box::new(disk_config));
guest.kernel_path = Some(fw_path(FwType::Ovmf));
let guest = basic_regular_guest!(FOCAL_IMAGE_NAME).with_kernel(fw_path(FwType::Ovmf));
_test_simple_launch(&guest);
}