tests: extract _test_dmi_uuid to tests_wrappers

Move the DMI UUID test logic from integration.rs into a
shared _test_dmi_uuid() function in tests_wrappers.rs.
The original test in integration.rs now uses the
basic_regular_guest macro and delegates to this shared
function, enabling reuse by CVM tests.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Muminul Islam
2026-03-21 17:49:45 -07:00
committed by Rob Bradford
parent 6f9794ded0
commit dcb4d99a50
2 changed files with 31 additions and 31 deletions

View File

@@ -2210,3 +2210,32 @@ pub(crate) fn _test_dmi_serial_number(guest: &Guest) {
handle_child_output(r, &output);
}
pub(crate) fn _test_dmi_uuid(guest: &Guest) {
let mut child = GuestCommand::new(guest)
.default_cpus()
.default_memory()
.default_kernel_cmdline_with_platform(Some("uuid=1e8aa28a-435d-4027-87f4-40dceff1fa0a"))
.default_disks()
.default_net()
.capture_output()
.spawn()
.unwrap();
let r = std::panic::catch_unwind(|| {
guest.wait_vm_boot().unwrap();
assert_eq!(
guest
.ssh_command("sudo cat /sys/class/dmi/id/product_uuid")
.unwrap()
.trim(),
"1e8aa28a-435d-4027-87f4-40dceff1fa0a"
);
});
kill_child(&mut child);
let output = child.wait_with_output().unwrap();
handle_child_output(r, &output);
}