mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: extend test_pci_device_id() to also test virtio-console
On-behalf-of: Philipp Schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
committed by
Rob Bradford
parent
e793353bfb
commit
0e67f27546
@@ -5781,6 +5781,8 @@ mod common_parallel {
|
|||||||
handle_child_output(r, &output);
|
handle_child_output(r, &output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Checks that explicit PCI device IDs are honored for boot-time and hotplugged devices.
|
||||||
|
// It also verifies dynamic hotplug allocation reuses freed PCI device ID holes.
|
||||||
#[test]
|
#[test]
|
||||||
fn test_pci_device_id() {
|
fn test_pci_device_id() {
|
||||||
let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
|
let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
|
||||||
@@ -5801,6 +5803,7 @@ mod common_parallel {
|
|||||||
.default_memory()
|
.default_memory()
|
||||||
.args(["--kernel", kernel_path.to_str().unwrap()])
|
.args(["--kernel", kernel_path.to_str().unwrap()])
|
||||||
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
||||||
|
.args(["--console", "tty,pci_device_id=7"])
|
||||||
.default_net()
|
.default_net()
|
||||||
.default_disks()
|
.default_disks()
|
||||||
.capture_output();
|
.capture_output();
|
||||||
@@ -5811,6 +5814,17 @@ mod common_parallel {
|
|||||||
|
|
||||||
// Add a network device with non-static device id request
|
// Add a network device with non-static device id request
|
||||||
let r = std::panic::catch_unwind(|| {
|
let r = std::panic::catch_unwind(|| {
|
||||||
|
// Make sure an explicit BDF for virtio-console is set.
|
||||||
|
assert!(wait_until(Duration::from_secs(10), || {
|
||||||
|
ssh_command_ip_with_auth(
|
||||||
|
"lspci | grep \"00:07.0\" | grep Virtio | grep console",
|
||||||
|
&default_guest_auth(),
|
||||||
|
&guest.network.guest_ip0,
|
||||||
|
Some(Duration::from_secs(1)),
|
||||||
|
)
|
||||||
|
.is_ok()
|
||||||
|
}));
|
||||||
|
|
||||||
let (cmd_success, cmd_stdout, _) = remote_command_w_output(
|
let (cmd_success, cmd_stdout, _) = remote_command_w_output(
|
||||||
&api_socket,
|
&api_socket,
|
||||||
"add-net",
|
"add-net",
|
||||||
|
|||||||
Reference in New Issue
Block a user