lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 12 Apr 2023 16:08:36 -0400
From:   Peter Xu <peterx@...hat.com>
To:     Axel Rasmussen <axelrasmussen@...gle.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Nadav Amit <nadav.amit@...il.com>,
        David Hildenbrand <david@...hat.com>,
        Mike Rapoport <rppt@...ux.vnet.ibm.com>,
        Leonardo Bras Soares Passos <lsoaresp@...hat.com>
Subject: Re: [PATCH v2 16/31] selftests/mm: UFFDIO_API test

On Wed, Apr 12, 2023 at 12:47:39PM -0700, Axel Rasmussen wrote:
> > +#define  uffd_test_fail(...)  do {             \
> > +               printf("failed [reason: ");     \
> > +               printf(__VA_ARGS__);            \
> > +               printf("]\n");                  \
> > +               ksft_inc_fail_cnt();            \
> > +       } while (0)
> > +
> > +#define  uffd_test_skip(...)  do {             \
> > +               printf("skipped [reason: ");    \
> > +               printf(__VA_ARGS__);            \
> > +               printf("]\n");                  \
> > +               ksft_inc_xskip_cnt();           \
> > +       } while (0)
> 
> Some of this is duplicating what's in kselftest_harness.h - e.g.
> assertions, printing test summary, keeping track of pass/fail/skip
> counts, etc.
> 
> I wonder how you feel about using the standard harness? E.g. is the
> plan to do this (more straightforward?) refactor first, and then
> switch later? Or is there some reason it can't be used?

David asked similar question.  I wanted to arrange the output mostly for:
(1) one test per line, (2) dump test name before anything (even failing).
The 2nd one is important for uffd tests since it uses err() which bails out
immediately on unexpected failures (comparing to uffd_test_fail).

To achieve that I found I can use ksft_inc_xskip_cnt() etc. so I kept using
the counters in the harness but leave the print format on my own.  I assume
that's also why these were exported in kselftests.h so when tests want to
have customized output it can still use the counters.

Thanks,

-- 
Peter Xu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ