[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aPI-8YfqC83QlltH@google.com>
Date: Fri, 17 Oct 2025 13:04:49 +0000
From: Mostafa Saleh <smostafa@...gle.com>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: Robin Murphy <robin.murphy@....com>, iommu@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
will@...nel.org, joro@...tes.org, praan@...gle.com
Subject: Re: [PATCH v5 4/4] iommu/io-pgtable-arm-selftests: Use KUnit
On Thu, Oct 16, 2025 at 02:25:24PM -0300, Jason Gunthorpe wrote:
> 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..
Maybe as Robin suggested, something as:
if (IS_ERR(dev)) {
kunit_skip(test, "Failed to allocated device!\n");
return;
}
Is simple enough and verbose and can distinguished from test failures,
it will look like:
[ 2.095812] ok 1 arm_lpae_do_selftests # SKIP Failed to allocated device!
Thanks,
Mostafa
>
> Jason
Powered by blists - more mailing lists