mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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 <muislam@microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
f6829561e5
commit
7c48aafb65
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user