From b8a6afd332d32f6fa00f9461401b8bdf0853e249 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Fri, 27 Feb 2026 18:19:47 -0800 Subject: [PATCH] tests: Add CVM HTTP API create/boot test Add test_api_http_create_boot to the common_cvm module using GuestFactory::new_confidential_guest_factory() with 4 CPUs. This extends API create/boot coverage to confidential VMs. Signed-off-by: Muminul Islam --- cloud-hypervisor/tests/integration.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cloud-hypervisor/tests/integration.rs b/cloud-hypervisor/tests/integration.rs index b3613067e..4c00f63d5 100644 --- a/cloud-hypervisor/tests/integration.rs +++ b/cloud-hypervisor/tests/integration.rs @@ -14555,10 +14555,20 @@ mod common_cvm { #[test] fn test_focal_simple_launch() { let disk_config = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string()); - let mut guest = Guest::new(Box::new(disk_config)); + let guest = Guest::new(Box::new(disk_config)); guest.vm_type = GuestVmType::Confidential; guest.boot_timeout = DEFAULT_CVM_TCP_LISTENER_TIMEOUT; guest.nested = false; _test_simple_launch(&guest) } + + #[test] + fn test_api_http_create_boot() { + let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string()); + let guest = GuestFactory::new_confidential_guest_factory() + .create_guest(Box::new(disk_config)) + .with_cpu(4); + let target_api = TargetApi::new_http_api(&guest.tmp_dir); + _test_api_create_boot(&target_api, &guest); + } }