tests: Add PCI multiple segments test for confidential VMs

Add test_pci_multiple_segments to the common_cvm integration
test module to verify multiple PCI segment support in
confidential guest environments.

The test uses 8 PCI segments, which exceeds the Linux default
of 6 and matches the maximum supported by the IGVM file for
SEV-SNP guests. A test disk is placed on segment 5 to validate
cross-segment device functionality.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Muminul Islam
2026-03-07 15:49:27 -08:00
committed by Rob Bradford
parent 62bb7bfe45
commit 38dc35cc33

View File

@@ -15006,4 +15006,16 @@ mod common_cvm {
GuestFactory::new_confidential_guest_factory().create_guest(Box::new(disk_config));
_test_virtio_net_ctrl_queue(&guest);
}
#[test]
fn test_pci_multiple_segments() {
// Use 8 segments to test the multiple segment support since it's more than the default 6
// supported by Linux
// IGVM file used by Sev-Snp Guest now support up to 8 segments, so we can use 8 segments for testing.
let num_pci_segments: u16 = 8;
let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest =
GuestFactory::new_confidential_guest_factory().create_guest(Box::new(disk_config));
_test_pci_multiple_segments(&guest, num_pci_segments, 5);
}
}