tests: Refactor _test_power_button to accept Guest parameter

Remove the acpi bool parameter and internal guest and kernel
setup from _test_power_button. The function now accepts a Guest
reference and uses default_kernel_cmdline() instead of
hardcoded kernel paths.

Update test_power_button in common_parallel to create a regular
guest via GuestFactory. Update test_power_button_acpi in
aarch64_acpi to use with_kernel_path(edk2_path()) for ACPI
firmware support.

Add with_kernel_path() builder method on Guest in test_infra
to allow overriding the kernel path after guest creation.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Muminul Islam
2026-03-05 17:20:38 -08:00
committed by Rob Bradford
parent 19fa512f02
commit e278e5e931
2 changed files with 16 additions and 17 deletions

View File

@@ -1013,6 +1013,11 @@ impl Guest {
self
}
pub fn with_kernel_path(mut self, kernel_path: &str) -> Self {
self.kernel_path = Some(kernel_path.to_string());
self
}
pub fn default_net_string(&self) -> String {
format!(
"tap=,mac={},ip={},mask=255.255.255.128",