mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
ci: Run vhost-user-blk tests for mmio builds
There's no reason mmio builds cannot support vhost-user-blk, therefore there's no reason to skip these tests for mmio. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
0c9c72c583
commit
dd8debf201
+26
-22
@@ -1355,7 +1355,7 @@ mod tests {
|
|||||||
test_vhost_user_net(None, 4, None, true)
|
test_vhost_user_net(None, 4, None, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(not(feature = "mmio"), test)]
|
#[test]
|
||||||
fn test_vhost_user_blk() {
|
fn test_vhost_user_blk() {
|
||||||
test_block!(tb, "", {
|
test_block!(tb, "", {
|
||||||
let mut clear = ClearDiskConfig::new();
|
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() {
|
fn test_vhost_user_blk_self_spawning() {
|
||||||
test_block!(tb, "", {
|
test_block!(tb, "", {
|
||||||
let mut clear = ClearDiskConfig::new();
|
let mut clear = ClearDiskConfig::new();
|
||||||
@@ -1535,7 +1535,7 @@ mod tests {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(not(feature = "mmio"), test)]
|
#[test]
|
||||||
fn test_vhost_user_blk_readonly() {
|
fn test_vhost_user_blk_readonly() {
|
||||||
test_block!(tb, "", {
|
test_block!(tb, "", {
|
||||||
let mut clear = ClearDiskConfig::new();
|
let mut clear = ClearDiskConfig::new();
|
||||||
@@ -1627,7 +1627,7 @@ mod tests {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(not(feature = "mmio"), test)]
|
#[test]
|
||||||
fn test_vhost_user_blk_direct() {
|
fn test_vhost_user_blk_direct() {
|
||||||
test_block!(tb, "", {
|
test_block!(tb, "", {
|
||||||
let mut clear = ClearDiskConfig::new();
|
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() {
|
fn test_boot_from_vhost_user_blk() {
|
||||||
test_block!(tb, "", {
|
test_block!(tb, "", {
|
||||||
let mut clear = ClearDiskConfig::new();
|
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() {
|
fn test_boot_from_vhost_user_blk_self_spawning() {
|
||||||
test_block!(tb, "", {
|
test_block!(tb, "", {
|
||||||
let mut clear = ClearDiskConfig::new();
|
let mut clear = ClearDiskConfig::new();
|
||||||
@@ -1808,24 +1808,28 @@ mod tests {
|
|||||||
aver_eq!(tb, guest.get_cpu_count().unwrap_or_default(), 1);
|
aver_eq!(tb, guest.get_cpu_count().unwrap_or_default(), 1);
|
||||||
aver!(tb, guest.get_total_memory().unwrap_or_default() > 491_000);
|
aver!(tb, guest.get_total_memory().unwrap_or_default() > 491_000);
|
||||||
|
|
||||||
let reboot_count = guest
|
// The reboot is not supported with mmio, so no reason to test it.
|
||||||
.ssh_command("sudo journalctl | grep -c -- \"-- Reboot --\"")
|
#[cfg(not(feature = "mmio"))]
|
||||||
.unwrap_or_default()
|
{
|
||||||
.trim()
|
let reboot_count = guest
|
||||||
.parse::<u32>()
|
.ssh_command("sudo journalctl | grep -c -- \"-- Reboot --\"")
|
||||||
.unwrap_or(1);
|
.unwrap_or_default()
|
||||||
|
.trim()
|
||||||
|
.parse::<u32>()
|
||||||
|
.unwrap_or(1);
|
||||||
|
|
||||||
aver_eq!(tb, reboot_count, 0);
|
aver_eq!(tb, reboot_count, 0);
|
||||||
guest.ssh_command("sudo reboot").unwrap_or_default();
|
guest.ssh_command("sudo reboot").unwrap_or_default();
|
||||||
|
|
||||||
thread::sleep(std::time::Duration::new(20, 0));
|
thread::sleep(std::time::Duration::new(20, 0));
|
||||||
let reboot_count = guest
|
let reboot_count = guest
|
||||||
.ssh_command("sudo journalctl | grep -c -- \"-- Reboot --\"")
|
.ssh_command("sudo journalctl | grep -c -- \"-- Reboot --\"")
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.trim()
|
.trim()
|
||||||
.parse::<u32>()
|
.parse::<u32>()
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
aver_eq!(tb, reboot_count, 1);
|
aver_eq!(tb, reboot_count, 1);
|
||||||
|
}
|
||||||
|
|
||||||
let _ = cloud_child.kill();
|
let _ = cloud_child.kill();
|
||||||
let _ = cloud_child.wait();
|
let _ = cloud_child.wait();
|
||||||
|
|||||||
Reference in New Issue
Block a user