From 9f2eddd9d8319f53cfd456324e70a0c7689ee6d1 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Tue, 19 May 2020 08:44:01 +0200 Subject: [PATCH] ci: Fix test_serial_off The integration test validating that --serial off works correctly was not properly written as it was using the FW, which by default would use the kernel command line found in the EFI partition. Unfortunately, this kernel command line was including "console=ttyS0", which causes the kernel to try to write to the serial port, even if there's no serial port being emulated. The problem is, when no emulation of the serial port is provided, the default value returned on 0x3f8 is 0, which makes the guest kernel think that some data needs to be read. The only way to avoid all this is by ensuring we can control the kernel command line by removing any occurence of "console=ttyS0" from it. Signed-off-by: Sebastien Boeuf --- tests/integration.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/integration.rs b/tests/integration.rs index af42b5009..2b42c8879 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -2326,17 +2326,28 @@ mod tests { }); } - #[cfg_attr(not(feature = "mmio"), test)] fn test_serial_off() { test_block!(tb, "", { let mut clear = ClearDiskConfig::new(); let guest = Guest::new(&mut clear); + let mut workload_path = dirs::home_dir().unwrap(); + workload_path.push("workloads"); + + let mut kernel_path = workload_path; + kernel_path.push("bzImage"); + let mut child = GuestCommand::new(&guest) .args(&["--cpus", "boot=1"]) .args(&["--memory", "size=512M"]) - .args(&["--kernel", guest.fw_path.as_str()]) + .args(&["--kernel", kernel_path.to_str().unwrap()]) .default_disks() .default_net() + .args(&[ + "--cmdline", + CLEAR_KERNEL_CMDLINE + .replace("console=ttyS0,115200n8 ", "") + .as_str(), + ]) .args(&["--serial", "off"]) .spawn() .unwrap();