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]
Message-ID: <CAGS_qxqu+opwMusOGSS3s9fLo2GfpgsCQOgq6VZyBcVb+zS6Zg@mail.gmail.com>
Date:   Tue, 29 Nov 2022 09:09:29 -0800
From:   Daniel Latypov <dlatypov@...gle.com>
To:     David Gow <davidgow@...gle.com>
Cc:     brendanhiggins@...gle.com, rmoar@...gle.com,
        linux-kernel@...r.kernel.org, kunit-dev@...glegroups.com,
        linux-kselftest@...r.kernel.org, skhan@...uxfoundation.org
Subject: Re: [PATCH] kunit: tool: don't include KTAP headers and the like in
 the test log

On Tue, Nov 29, 2022 at 12:31 AM David Gow <davidgow@...gle.com> wrote:
>
> On Tue, Nov 29, 2022 at 8:12 AM Daniel Latypov <dlatypov@...gle.com> wrote:
> >
> > We print the "test log" on failure.
> > This is meant to be all the kernel output that happened during the test.
> >
> > But we also include the special KTAP lines in it, which are often
> > redundant.
> >
> > E.g. we include the "not ok" line in the log, right before we print
> > that the test case failed...
> > [13:51:48] Expected 2 + 1 == 2, but
> > [13:51:48] 2 + 1 == 3 (0x3)
> > [13:51:48] not ok 1 example_simple_test
> > [13:51:48] [FAILED] example_simple_test
> >
> > More full example after this patch:
> > [13:51:48] =================== example (4 subtests) ===================
> > [13:51:48] # example_simple_test: initializing
> > [13:51:48] # example_simple_test: EXPECTATION FAILED at lib/kunit/kunit-example-test.c:29
> > [13:51:48] Expected 2 + 1 == 2, but
> > [13:51:48] 2 + 1 == 3 (0x3)
> > [13:51:48] [FAILED] example_simple_test
> >
> > Signed-off-by: Daniel Latypov <dlatypov@...gle.com>
> > ---
>
> I totally agree we should skip these from the log. (Unless
> --raw_output is enabled, but that obviously doesn't apply.)
>
> Going forward, I think we should also probably disable
> kunit.stats_enabled when running via kunit.py, too (again, unless
> --raw_output is used.)

I considered including that as a patch 2/2 here.
But changing the behavior like that felt a bit iffy.

We've basically been telling people that looking at .kunit/test.log is
logically equivalent to running with kunit.py run --raw_output.
That would no longer be true after such a change.
So I'm torn between that and automatically filtering them out in the
parser side.

Cons of tweaking args based on --raw_output
* now more magic, harder to explain (see above)
* people might find test counts useful when looking at test.log

Cons of filtering out test counts in the parser
* risks false positives: filtering out other lines besides test counts
* when there's missing output, this is less debuggable
   * 99% of users are *not* going to dig into the python code
  * but IMO users are fairly likely to notice the extra
kunit.stats_enabled=0 cmdline arg

And overall, the benefit of hiding these is very small and cosmetic in nature.
So that means making a tradeoff to do so feels more iffy.

The hiding done in this patch seemed fine since there was no tradeoff,
we just needed to stop including lines we've already recognized as
KTAP directives.

>
> In any case, this looks good and works well here.
>
> Reviewed-by: David Gow <davidgow@...gle.com>
>
> Cheers,
> -- David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ