tests: extract _test_direct_kernel_boot_noacpi wrapper

Extract test logic from test_direct_kernel_boot_noacpi into
a shared _test_direct_kernel_boot_noacpi wrapper function in
tests_wrappers.rs. The kernel cmdline modification (acpi=off)
is kept in the parent test case. The wrapper uses
default_kernel_cmdline() for kernel/cmdline setup.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Muminul Islam
2026-03-21 18:25:41 -07:00
committed by Rob Bradford
parent fb02146e2c
commit bff6e40eaa
2 changed files with 27 additions and 30 deletions

View File

@@ -2447,3 +2447,27 @@ pub(crate) fn _test_console_file(guest: &Guest) {
handle_child_output(r, &output);
}
pub(crate) fn _test_direct_kernel_boot_noacpi(guest: &Guest) {
let mut child = GuestCommand::new(guest)
.default_cpus()
.default_memory()
.default_kernel_cmdline()
.default_disks()
.default_net()
.capture_output()
.spawn()
.unwrap();
let r = std::panic::catch_unwind(|| {
guest.wait_vm_boot().unwrap();
assert_eq!(guest.get_cpu_count().unwrap_or_default(), 1);
assert!(guest.get_total_memory().unwrap_or_default() > 480_000);
});
kill_child(&mut child);
let output = child.wait_with_output().unwrap();
handle_child_output(r, &output);
}