tests: Split test_simple_launch() into separate tests

This will make it much easier identify which tests are failing.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2022-03-29 14:09:38 +01:00
parent ca68b9e7a9
commit c66be2e974

View File

@ -1754,20 +1754,32 @@ mod parallel {
#[test]
#[cfg(target_arch = "x86_64")]
fn test_simple_launch() {
let bionic = UbuntuDiskConfig::new(BIONIC_IMAGE_NAME.to_string());
let focal = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
fn test_bionic_hypervisor_fw() {
test_simple_launch(fw_path(FwType::RustHypervisorFirmware), BIONIC_IMAGE_NAME)
}
vec![Box::new(bionic), Box::new(focal)]
.drain(..)
.for_each(|disk_config| {
vec![
fw_path(FwType::Ovmf),
fw_path(FwType::RustHypervisorFirmware),
]
.drain(..)
.for_each(|fw_path| {
let guest = Guest::new(disk_config.clone());
#[test]
#[cfg(target_arch = "x86_64")]
fn test_focal_hypervisor_fw() {
test_simple_launch(fw_path(FwType::RustHypervisorFirmware), FOCAL_IMAGE_NAME)
}
#[test]
#[cfg(target_arch = "x86_64")]
fn test_bionic_ovmf() {
test_simple_launch(fw_path(FwType::Ovmf), BIONIC_IMAGE_NAME)
}
#[test]
#[cfg(target_arch = "x86_64")]
fn test_focal_ovmf() {
test_simple_launch(fw_path(FwType::Ovmf), FOCAL_IMAGE_NAME)
}
#[cfg(target_arch = "x86_64")]
fn test_simple_launch(fw_path: String, disk_path: &str) {
let disk_config = Box::new(UbuntuDiskConfig::new(disk_path.to_string()));
let guest = Guest::new(disk_config);
let mut child = GuestCommand::new(&guest)
.args(&["--cpus", "boot=1"])
@ -1794,8 +1806,6 @@ mod parallel {
let output = child.wait_with_output().unwrap();
handle_child_output(r, &output);
});
});
}
#[test]