tests: Enable virtio-mmio tests for virtio-console

This is useful to ensure that virtio-console support is covered.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-07-09 10:04:24 +01:00 committed by Sebastien Boeuf
parent 3800acd347
commit 81ce8f505c

View File

@ -3034,19 +3034,26 @@ mod tests {
}); });
} }
#[cfg_attr(not(feature = "mmio"), test)] #[test]
fn test_virtio_console() { fn test_virtio_console() {
test_block!(tb, "", { test_block!(tb, "", {
let mut focal = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string()); let mut focal = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
let guest = Guest::new(&mut focal); let guest = Guest::new(&mut focal);
let mut workload_path = dirs::home_dir().unwrap();
workload_path.push("workloads");
let mut kernel_path = workload_path;
kernel_path.push("vmlinux");
let mut child = GuestCommand::new(&guest) let mut child = GuestCommand::new(&guest)
.args(&["--cpus", "boot=1"]) .args(&["--cpus", "boot=1"])
.args(&["--memory", "size=512M"]) .args(&["--memory", "size=512M"])
.args(&["--kernel", guest.fw_path.as_str()]) .args(&["--kernel", kernel_path.to_str().unwrap()])
.args(&["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
.default_disks() .default_disks()
.default_net() .default_net()
.args(&["--console", "tty"]) .args(&["--console", "tty"])
.args(&["--serial", "null"])
.capture_output() .capture_output()
.spawn() .spawn()
.unwrap(); .unwrap();