Re: RFC - kernel test result specification (KTAP)

From: Mark Brown
Date: Wed Sep 01 2021 - 08:02:46 EST

On Mon, Aug 30, 2021 at 10:04:24PM +0000, Tim.Bird@xxxxxxxx wrote:
> > -----Original Message-----
> > From: Kees Cook <keescook@xxxxxxxxxxxx>
> > On Mon, Aug 30, 2021 at 05:48:07PM +0000, Tim.Bird@xxxxxxxx wrote:
> > > From: Kees Cook <keescook@xxxxxxxxxxxx>

> > XFAIL capture the condition of the test logic in that a test for
> > something arm64-specific on a non-arm64 machine is _not_ a "pass". It
> > will fail. But it's an expected failure. And, as a directive, must come
> > with the evidence bit:

> > not ok 1 PAN catches bad accessg # XFAIL PAN CPU feature is arm64 only

> > As a test author, I want to see this as distinct from failure and
> > success.

> I agree that this case is different from a normal failure.

> In the example you provide of a feature that applies to only specific
> architectures, I would use a SKIP instead. It's not that the testcase failed.
> It's that it does not even make sense for the device under test.

That's what all the arm64 tests are doing at the minute - they're
skipping tests on systems where the feature being tested isn't
supported. We've determined that the test can't meaningfully be run so
we're going to skip it. We also don't use XFAIL for tests that are
checking that an error of some kind is generated, the test is formulated
as "error is reported when we do X" meaning that PASS/FAIL makes sense

There's a couple of XFAIL uses in other selftests but it's pretty

> > This is what we have now except basically just replacing "# $name" with
> > "test $num $name"

> Actually, I like this idea. Including the number is a nice touch.
> I think that will help to distinguish such a line from other 'unknown line' output.
> I don't know if I'd leave the description off of the result line, though.
> A lot of parsers are looking for that.

It's also important that humans are able to understand the output and
the descriptions do help with that.

Attachment: signature.asc
Description: PGP signature