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: <CAPi66w-E-WKA3uzE3SGLkp8UYaqz65Py2Yc8UGynhG1s0rtrjQ@mail.gmail.com>
Date:   Tue, 17 Jan 2023 13:35:19 +0400
From:   Alexander Pantyukhin <apantykhin@...il.com>
To:     David Gow <davidgow@...gle.com>
Cc:     brendan.higgins@...ux.dev, linux-kselftest@...r.kernel.org,
        kunit-dev@...glegroups.com, linux-kernel@...r.kernel.org,
        akpm@...ux-foundation.org
Subject: Re: [PATCH] tools/testing/kunit/kunit.py: remove redundant double check

Hello, David.
Thank you very much for your review!
There is no v2 yet.

>
> On Mon, 16 Jan 2023 at 05:05, Alexander Pantyukhin <apantykhin@...il.com> wrote:
> >
> > The build_tests function contained the doulbe checking for not success
> Nit: "double" -> "double"
>
> > result. It is fixed in the current patch. Additional small
> > simplifications of code like useing ternary if were applied (avoid use
> Nit: "useing" -> "using"
> > the same operation by calculation times differ in two places).
> >
> > Signed-off-by: Alexander Pantyukhin <apantykhin@...il.com>
> > ---
> Thanks for catching these!
> This looks good to me, save for a few typos (which you should fix if
> there's a v2, but it isn't important enough to do another version...)
>
> Unless someone with more Python knowledge than me jumps in and
> complains, this is:
>
> Reviewed-by: David Gow <davidgow@...gle.com>
>
> Cheers,
> -- David
>
> >  tools/testing/kunit/kunit.py | 17 +++++------------
> >  1 file changed, 5 insertions(+), 12 deletions(-)
> >
> > diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
> > index 43fbe96318fe..481c213818bd 100755
> > --- a/tools/testing/kunit/kunit.py
> > +++ b/tools/testing/kunit/kunit.py
> > @@ -77,10 +77,8 @@ def config_tests(linux: kunit_kernel.LinuxSourceTree,
> >         config_start = time.time()
> >         success = linux.build_reconfig(request.build_dir, request.make_options)
> >         config_end = time.time()
> > -       if not success:
> > -               return KunitResult(KunitStatus.CONFIG_FAILURE,
> > -                                  config_end - config_start)
> > -       return KunitResult(KunitStatus.SUCCESS,
> > +       status = KunitStatus.SUCCESS if success else KunitStatus.CONFIG_FAILURE
> > +       return KunitResult(status,
> >                            config_end - config_start)
> >
> >  def build_tests(linux: kunit_kernel.LinuxSourceTree,
> > @@ -92,13 +90,8 @@ def build_tests(linux: kunit_kernel.LinuxSourceTree,
> >                                      request.build_dir,
> >                                      request.make_options)
> >         build_end = time.time()
> > -       if not success:
> > -               return KunitResult(KunitStatus.BUILD_FAILURE,
> > -                                  build_end - build_start)
> > -       if not success:
> > -               return KunitResult(KunitStatus.BUILD_FAILURE,
> > -                                  build_end - build_start)
> > -       return KunitResult(KunitStatus.SUCCESS,
> > +       status = KunitStatus.SUCCESS if success else KunitStatus.BUILD_FAILURE
> > +       return KunitResult(status,
> >                            build_end - build_start)
> >
> >  def config_and_build_tests(linux: kunit_kernel.LinuxSourceTree,
> > @@ -145,7 +138,7 @@ def exec_tests(linux: kunit_kernel.LinuxSourceTree, request: KunitExecRequest) -
> >                 tests = _list_tests(linux, request)
> >                 if request.run_isolated == 'test':
> >                         filter_globs = tests
> > -               if request.run_isolated == 'suite':
> > +               elif request.run_isolated == 'suite':
> >                         filter_globs = _suites_from_test_list(tests)
> >                         # Apply the test-part of the user's glob, if present.
> >                         if '.' in request.filter_glob:
> > --
> > 2.25.1
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ