diff --git a/tests/integration.rs b/tests/integration.rs index 111ebe3fe..7a69530db 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -1355,7 +1355,7 @@ mod tests { test_vhost_user_net(None, 4, None, true) } - #[cfg_attr(not(feature = "mmio"), test)] + #[test] fn test_vhost_user_blk() { test_block!(tb, "", { let mut clear = ClearDiskConfig::new(); @@ -1447,7 +1447,7 @@ mod tests { }); } - #[cfg_attr(not(feature = "mmio"), test)] + #[test] fn test_vhost_user_blk_self_spawning() { test_block!(tb, "", { let mut clear = ClearDiskConfig::new(); @@ -1535,7 +1535,7 @@ mod tests { }); } - #[cfg_attr(not(feature = "mmio"), test)] + #[test] fn test_vhost_user_blk_readonly() { test_block!(tb, "", { let mut clear = ClearDiskConfig::new(); @@ -1627,7 +1627,7 @@ mod tests { }); } - #[cfg_attr(not(feature = "mmio"), test)] + #[test] fn test_vhost_user_blk_direct() { test_block!(tb, "", { let mut clear = ClearDiskConfig::new(); @@ -1719,7 +1719,7 @@ mod tests { }); } - #[cfg_attr(not(feature = "mmio"), test)] + #[test] fn test_boot_from_vhost_user_blk() { test_block!(tb, "", { let mut clear = ClearDiskConfig::new(); @@ -1775,7 +1775,7 @@ mod tests { }); } - #[cfg_attr(not(feature = "mmio"), test)] + #[test] fn test_boot_from_vhost_user_blk_self_spawning() { test_block!(tb, "", { let mut clear = ClearDiskConfig::new(); @@ -1808,24 +1808,28 @@ mod tests { aver_eq!(tb, guest.get_cpu_count().unwrap_or_default(), 1); aver!(tb, guest.get_total_memory().unwrap_or_default() > 491_000); - let reboot_count = guest - .ssh_command("sudo journalctl | grep -c -- \"-- Reboot --\"") - .unwrap_or_default() - .trim() - .parse::() - .unwrap_or(1); + // The reboot is not supported with mmio, so no reason to test it. + #[cfg(not(feature = "mmio"))] + { + let reboot_count = guest + .ssh_command("sudo journalctl | grep -c -- \"-- Reboot --\"") + .unwrap_or_default() + .trim() + .parse::() + .unwrap_or(1); - aver_eq!(tb, reboot_count, 0); - guest.ssh_command("sudo reboot").unwrap_or_default(); + aver_eq!(tb, reboot_count, 0); + guest.ssh_command("sudo reboot").unwrap_or_default(); - thread::sleep(std::time::Duration::new(20, 0)); - let reboot_count = guest - .ssh_command("sudo journalctl | grep -c -- \"-- Reboot --\"") - .unwrap_or_default() - .trim() - .parse::() - .unwrap_or_default(); - aver_eq!(tb, reboot_count, 1); + thread::sleep(std::time::Duration::new(20, 0)); + let reboot_count = guest + .ssh_command("sudo journalctl | grep -c -- \"-- Reboot --\"") + .unwrap_or_default() + .trim() + .parse::() + .unwrap_or_default(); + aver_eq!(tb, reboot_count, 1); + } let _ = cloud_child.kill(); let _ = cloud_child.wait();