On 1/22/26 18:02, Kevin Brodsky wrote:
pfnmap currently checks the target file in FIXTURE_SETUP(pfnmap),
meaning once for every test, and skips the test if any check fails.

The target file is the same for every test so this is a little
overkill. More importantly, this approach means that the whole suite
will report PASS even if all the tests are skipped because kernel
configuration (e.g. CONFIG_STRICT_DEVMEM=y) prevented /dev/mem from
being mapped, for instance.

Let's ensure that KSFT_SKIP is returned as exit code if any check
fails by performing the checks in pfnmap_init(), run once. That
function also takes care of finding the offset of the pages to be
mapped and saves it in a global. The file is now opened only once
and the fd saved in a global, but it is still mapped/unmapped for
every test, as some of them modify the mapping.

Signed-off-by: Kevin Brodsky <[email protected]>
---

Acked-by: David Hildenbrand (Red Hat) <[email protected]>

--
Cheers

David

Reply via email to