From 7c48aafb655bd3c44d5fbd863ae2076c87a28fbc Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Sat, 28 Feb 2026 16:46:18 -0800 Subject: [PATCH] tests: Add CVM HTTP API shutdown and delete tests Add test_api_http_shutdown and test_api_http_delete to the common_cvm module using GuestFactory with 4 CPUs. Both tests reuse existing _test_api_shutdown and _test_api_delete helpers to extend API coverage to confidential VMs. Signed-off-by: Muminul Islam --- cloud-hypervisor/tests/integration.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cloud-hypervisor/tests/integration.rs b/cloud-hypervisor/tests/integration.rs index 01bd9a4dd..d9874d2e7 100644 --- a/cloud-hypervisor/tests/integration.rs +++ b/cloud-hypervisor/tests/integration.rs @@ -14570,4 +14570,26 @@ mod common_cvm { let target_api = TargetApi::new_http_api(&guest.tmp_dir); _test_api_create_boot(&target_api, &guest); } + + #[test] + fn test_api_http_shutdown() { + 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_shutdown(&target_api, &guest); + } + + #[test] + fn test_api_http_delete() { + 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_delete(&target_api, &guest); + } }