From b40a42699d1125c541a246b29c0c51c82c5516c8 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Thu, 7 Sep 2023 14:25:20 +0200 Subject: [PATCH] tests/vfio: Accept single device in vfio group for CLH cloud hypervisor does not emulate pcie switches or pci bridges, so we need to accept a lonely device. Signed-off-by: Jeremi Piotrowski (cherry picked from commit faee59b520a7f916d5aab0d1ac254daf6294a178) --- tests/functional/vfio/run.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/functional/vfio/run.sh b/tests/functional/vfio/run.sh index 83cf16100d..4f36709a88 100755 --- a/tests/functional/vfio/run.sh +++ b/tests/functional/vfio/run.sh @@ -113,9 +113,13 @@ check_vfio() { # There should be two devices in the IOMMU group: the ethernet # device we care about, plus the PCIe to PCI bridge device devs="$(get_ctr_cmd_output "${cid}" ls /sys/kernel/iommu_groups/"${group}"/devices)" - if [ $(echo "${devs}" | wc -w) != "2" ] ; then + num_devices=$(echo "${devs}" | wc -w) + if [ "${HYPERVISOR}" = "qemu" ] && [ "${num_devices}" != "2" ] ; then die "Expected exactly two devices got: ${devs}" fi + if [ "${HYPERVISOR}" = "clh" ] && [ "${num_devices}" != "1" ] ; then + die "Expected exactly one device got: ${devs}" + fi # The bridge device will always sort first, because it is on # bus zero, whereas the NIC will be on a non-zero bus