From 9a88b9a42e45bde82decb8c3d6fbb07d1c725c6b Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Sat, 21 Mar 2026 18:54:27 -0700 Subject: [PATCH] tests: add CVM test for net_hotplug Add a CVM integration test for net_hotplug that validates the same functionality using a confidential guest with the basic_cvm_guest macro. Signed-off-by: Muminul Islam --- cloud-hypervisor/tests/integration_cvm.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cloud-hypervisor/tests/integration_cvm.rs b/cloud-hypervisor/tests/integration_cvm.rs index d18ddc2c8..b99b26253 100644 --- a/cloud-hypervisor/tests/integration_cvm.rs +++ b/cloud-hypervisor/tests/integration_cvm.rs @@ -16,6 +16,7 @@ mod common_cvm { use common::tests_wrappers::*; use common::utils::*; use test_infra::*; + const NUM_PCI_SEGMENTS: u16 = 8; use super::*; macro_rules! basic_cvm_guest { @@ -101,9 +102,8 @@ mod common_cvm { // 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 guest = basic_cvm_guest!(JAMMY_IMAGE_NAME); - _test_pci_multiple_segments(&guest, num_pci_segments, 5); + _test_pci_multiple_segments(&guest, NUM_PCI_SEGMENTS, 5); } #[test] @@ -274,4 +274,10 @@ mod common_cvm { let guest = basic_cvm_guest!(JAMMY_IMAGE_NAME); _test_disk_hotplug(&guest, false); } + + #[test] + fn test_net_hotplug() { + let guest = basic_cvm_guest!(JAMMY_IMAGE_NAME); + _test_net_hotplug(&guest, NUM_PCI_SEGMENTS, None); + } }