From b6d8df772d9bf025c26d4b5cb3001b6cf3b7ad8c Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Thu, 5 Mar 2026 17:32:42 -0800 Subject: [PATCH] tests: Add power button test for confidential VMs Add test_power_button to the common_cvm integration test module to verify that power button functionality works correctly in confidential guest environments. The test creates an Ubuntu Jammy-based confidential VM using GuestFactory and delegates to the existing _test_power_button helper to validate the power button signal handling. Signed-off-by: Muminul Islam --- cloud-hypervisor/tests/integration.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cloud-hypervisor/tests/integration.rs b/cloud-hypervisor/tests/integration.rs index b65a2c442..1cca19016 100644 --- a/cloud-hypervisor/tests/integration.rs +++ b/cloud-hypervisor/tests/integration.rs @@ -14934,4 +14934,12 @@ mod common_cvm { let target_api = TargetApi::new_http_api(&guest.tmp_dir); _test_api_delete(&target_api, &guest); } + + #[test] + fn test_power_button() { + let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string()); + let guest = + GuestFactory::new_confidential_guest_factory().create_guest(Box::new(disk_config)); + _test_power_button(&guest); + } }