Re: [PATCH v2 4/4] iommufd/selftest: Add coverage for vdevice tombstone
From: Jason Gunthorpe
Date: Tue Jun 24 2025 - 09:43:46 EST
On Mon, Jun 23, 2025 at 05:49:46PM +0800, Xu Yilun wrote:
> diff --git a/tools/testing/selftests/iommu/iommufd.c b/tools/testing/selftests/iommu/iommufd.c
> index 1a8e85afe9aa..092e1344447e 100644
> --- a/tools/testing/selftests/iommu/iommufd.c
> +++ b/tools/testing/selftests/iommu/iommufd.c
> @@ -3014,6 +3014,19 @@ TEST_F(iommufd_viommu, vdevice_cache)
> }
> }
>
> +TEST_F(iommufd_viommu, vdevice_tombstone)
> +{
> + uint32_t viommu_id = self->viommu_id;
> + uint32_t dev_id = self->device_id;
> + uint32_t vdev_id = 0;
> +
> + if (dev_id) {
Why the if? The test should work or skip, not silently skip.
self->device_id is setup by the fixture, it can't be absent.
Jason