From 5724a0189c86417660d11a9c74c32eebd786773d Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Thu, 19 Mar 2026 16:26:59 +0000 Subject: [PATCH] tests: Make the IOMMU segment test case more flexible Linux kernel's behavior changes overtime. The grouping can be different across different versions and different architectures. We only cares about the exact SBDF exists somewhere. It doesn't matter which group it is under. Change the check so that this test case is no longer tied to the grouping behavior of a particular kernel. Signed-off-by: Wei Liu --- cloud-hypervisor/tests/integration.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cloud-hypervisor/tests/integration.rs b/cloud-hypervisor/tests/integration.rs index 8f6dec37a..3339c99d0 100644 --- a/cloud-hypervisor/tests/integration.rs +++ b/cloud-hypervisor/tests/integration.rs @@ -3460,12 +3460,11 @@ mod common_parallel { .does_device_vendor_pair_match("0x1057", "0x1af4") .unwrap_or_default() ); - assert_eq!( + assert!( guest - .ssh_command("ls /sys/kernel/iommu_groups/1/devices") + .ssh_command("ls /sys/kernel/iommu_groups/*/devices") .unwrap() - .trim(), - "0001:00:01.0" + .contains("0001:00:01.0") ); });