ci: Extend snapshot/restore test with virtio-iommu

When compiled with pci feature, the integration test now validates that
/dev/vdb can be correctly read while being placed behing a virtual
IOMMU.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2020-05-18 14:56:05 +02:00 committed by Rob Bradford
parent 646d33fea3
commit f975998875

View File

@ -4315,12 +4315,32 @@ mod tests {
net_id, guest.network.guest_mac, guest.network.host_ip
);
let cloudinit_params = if cfg!(feature = "mmio") {
format!(
"path={}",
guest.disk_config.disk(DiskType::CloudInit).unwrap()
)
} else {
format!(
"path={},iommu=on",
guest.disk_config.disk(DiskType::CloudInit).unwrap()
)
};
let mut child = GuestCommand::new(&guest)
.args(&["--api-socket", &api_socket])
.args(&["--cpus", "boot=1"])
.args(&["--memory", "size=4G"])
.args(&["--kernel", kernel_path.to_str().unwrap()])
.default_disks()
.args(&[
"--disk",
format!(
"path={}",
guest.disk_config.disk(DiskType::OperatingSystem).unwrap()
)
.as_str(),
cloudinit_params.as_str(),
])
.args(&["--net", net_params.as_str()])
.args(&["--cmdline", CLEAR_KERNEL_CMDLINE])
.capture_output()
@ -4333,13 +4353,19 @@ mod tests {
aver_eq!(tb, guest.get_cpu_count().unwrap_or_default(), 1);
// Check the guest RAM
aver!(tb, guest.get_total_memory().unwrap_or_default() > 3_968_000);
// Check if the block device is readable
// Check block devices are readable
aver!(
tb,
guest
.ssh_command("dd if=/dev/vda of=/dev/null bs=1M iflag=direct count=1024")
.is_ok()
);
aver!(
tb,
guest
.ssh_command("dd if=/dev/vdb of=/dev/null bs=1M iflag=direct count=8")
.is_ok()
);
// Check if the rng device is readable
aver!(
tb,
@ -4428,6 +4454,12 @@ mod tests {
.ssh_command("dd if=/dev/vda of=/dev/null bs=1M iflag=direct count=1024")
.is_ok()
);
aver!(
tb,
guest
.ssh_command("dd if=/dev/vdb of=/dev/null bs=1M iflag=direct count=8")
.is_ok()
);
aver!(
tb,
guest