Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

From: Mark Brown
Date: Mon Dec 11 2023 - 11:41:48 EST


On Mon, Dec 11, 2023 at 05:32:16PM +0100, David Hildenbrand wrote:
> On 11.12.23 17:15, Suren Baghdasaryan wrote:

> > Ok, I was updating my headers and that's why I could not reproduce it.
> > David, should the test be modified to handle old linux headers
> > (disable the new tests #ifndef _UFFDIO_MOVE or some other way)?

> That's an open question: do we want to be able to build selftests against
> any host headers, and not the in-tree headers that have to be manually
> installed and dirty the git tree?

Quite a lot of existing selftests rely on the headers being installed to
build...

> One obvious drawbacks is that we'll have to deal with all that using a bunch
> of #ifdef, and the tests that will be built+run will depend on the host
> headers.

> Especially the letter is relevant I think: Our upstream testing won't be
> able to build+run tests that rely on new upstream features. But that's what
> some key benefit of these selftests, and being able to run them
> automatically on a bunch of different combinations upstream.

...for exactly this reason. It causes real pain testing new interfaces.

> Further, the tests are closely related to the given kernel version, they are
> not some completely separate tests.

Note that there's a general desire for the tests to *run* with older
kernels and use whatever feature test mechanisms exist to skip tests
that won't run. That's often needed anyway for configurable things.

> (3) avoids dirtying the tree as a "make headers_install" would, but it also
> means that each test that makes use of new uapi has to update the relevant
> headers (what people working on QEMU are used to).

Note that you can do an out of tree build to avoid dirtying things.

Attachment: signature.asc
Description: PGP signature