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_qxqTJRuB05GzzezCimyN-SnwC8VtwjSLCuLzQuf5g=iY4A@mail.gmail.com>
Date:   Fri, 4 Dec 2020 10:08:20 -0800
From:   Daniel Latypov <dlatypov@...gle.com>
To:     David Gow <davidgow@...gle.com>
Cc:     Brendan Higgins <brendanhiggins@...gle.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>,
        Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH 2/3] kunit: tool: fix minor typing issue with None status

On Thu, Dec 3, 2020 at 8:17 PM David Gow <davidgow@...gle.com> wrote:
>
> On Fri, Dec 4, 2020 at 3:41 AM Daniel Latypov <dlatypov@...gle.com> wrote:
> >
>
> This seems good to me, but I have a few questions, particularly around
> the description.
>
> > The code to handle aggregating statuses didn't check that the status
> > actually got set.
>
> I don't understand what you mean here. Does this refer to
> Test{Case,Suite}::status potentially being None, and that not being
> supported properly in bubble_up_{suite_,test_case_,}errors(), or
> something else? Either way, I can't see any additional code to "check"
> that the status has been set. As far as I can tell everything except
> the default to SUCCESS is a no-op, or am I missing something?

mypy (rightly) sees the type is TestStatus or None and complains we
don't bother handling None, so we risk a crash in the tool.
The status will be none until we explicitly assign a value to it
later, which we always do currently, afaict.

This change just avoids that by giving it a default value to make mypy
happy, which shouldn't change behaviour at all right now.

There is no other (potential) behavioural change.

>
> > Default the value to SUCCESS.
>
> I'm a little iffy about defaulting this to success, but I think it's
> okay for now: the skip test support will eventually change this to a
> SKIPPED value.

Sounds good!

>
> >
> > This sorta follows the precedent in commit 3fc48259d525 ("kunit: Don't
> > fail test suites if one of them is empty").
> >
> > Also slightly simplify the code and add type annotations.
> >
> > Signed-off-by: Daniel Latypov <dlatypov@...gle.com>
> > ---
>
> Otherwise, the actual code changes all seem sensible, and it worked
> fine when I tested it, so:
>
> Reviewed-by: David Gow <davidgow@...gle.com>
>
> -- David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ