mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-03 11:25:20 +00:00
tests: Add integration test for --platform serial_number
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
adb3dcdc13
commit
80de77a6e6
@ -2834,6 +2834,42 @@ mod parallel {
|
|||||||
handle_child_output(r, &output);
|
handle_child_output(r, &output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
fn test_dmi_serial_number() {
|
||||||
|
let focal = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
|
||||||
|
let guest = Guest::new(Box::new(focal));
|
||||||
|
|
||||||
|
let mut child = GuestCommand::new(&guest)
|
||||||
|
.args(&["--cpus", "boot=1"])
|
||||||
|
.args(&["--memory", "size=512M"])
|
||||||
|
.args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()])
|
||||||
|
.args(&["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
||||||
|
.args(&["--platform", "serial_number=a=b;c=d"])
|
||||||
|
.default_disks()
|
||||||
|
.default_net()
|
||||||
|
.capture_output()
|
||||||
|
.spawn()
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let r = std::panic::catch_unwind(|| {
|
||||||
|
guest.wait_vm_boot(None).unwrap();
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
guest
|
||||||
|
.ssh_command("sudo cat /sys/class/dmi/id/product_serial")
|
||||||
|
.unwrap()
|
||||||
|
.trim(),
|
||||||
|
"a=b;c=d"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
let _ = child.kill();
|
||||||
|
let output = child.wait_with_output().unwrap();
|
||||||
|
|
||||||
|
handle_child_output(r, &output);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_virtio_fs_dax_off() {
|
fn test_virtio_fs_dax_off() {
|
||||||
test_virtio_fs(false, None, "never", &prepare_virtiofsd, false, None)
|
test_virtio_fs(false, None, "never", &prepare_virtiofsd, false, None)
|
||||||
|
Loading…
Reference in New Issue
Block a user