[PATCH v5 4/4] iommu/io-pgtable-arm-selftests: Use KUnit

Jason Gunthorpe jgg at ziepe.ca
Thu Oct 16 10:25:24 PDT 2025


On Thu, Oct 16, 2025 at 06:17:35PM +0100, Robin Murphy wrote:

> In this case AFAICS kunit_device_register() can only fail due to OOM or
> something unexpectedly messed up in the kobject/sysfs hierarchy, all of
> which should already scream (and represent the system being sufficiently
> hosed that any actual test results probably no longer matter anyway) -
> otherwise I would have suggested a kunit_err() message too.

Yes, I think so too. Which is why I think the simple
KUNIT_ASSERT_FALSE is fine - we don't need to over think something
that should never happen.

Basically it is a simple logic for the test writer, any thing in the
test body that doesn't work as expected triggers a
KUNIT_ASSERT. Infrastructure included.

At least that is how I've written all my tests so far, including the
userspace ones..

Jason



More information about the linux-arm-kernel mailing list