linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Latypov <dlatypov@google.com>
To: Kees Cook <keescook@chromium.org>
Cc: David Gow <davidgow@google.com>,
	Brendan Higgins <brendan.higgins@linux.dev>,
	 Shuah Khan <skhan@linuxfoundation.org>,
	kunit-dev@googlegroups.com,  linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org,  linux-doc@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH v4 1/3] kunit: Provide a static key to check if KUnit is actively running tests
Date: Thu, 1 Dec 2022 17:19:33 -0800	[thread overview]
Message-ID: <CAGS_qxotC7jCXewCoa3CwP0pxs=FRqZPF0oY67La0dUN1ay7LQ@mail.gmail.com> (raw)
In-Reply-To: <202212011652.4E8CB40@keescook>

On Thu, Dec 1, 2022 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> > +     static_branch_inc(&kunit_running);
>
> Is it expected there will be multiple tests running? (I was expecting
> "static_branch_enable").

It shouldn't normally happen, no.

One possible use case:
KUnit's unit tests for itself create fake test objects and operate on them.
They don't currently exercise this particular code though, afaict
(maybe they should).

>
> > +
> >       for (i = 0; i < num_suites; i++) {
> >               kunit_init_suite(suites[i]);
> >               kunit_run_tests(suites[i]);
> >       }
> > +
> > +     static_branch_dec(&kunit_running);
> >       return 0;
> >  }
> >  EXPORT_SYMBOL_GPL(__kunit_test_suites_init);
> > --
> > 2.38.1.584.g0f3c55d4c2-goog
> >
>
> Regardless:
>
> Reviewed-by: Kees Cook <keescook@chromium.org>
>
> --
> Kees Cook

Daniel


      reply	other threads:[~2022-12-02  1:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25  8:43 David Gow
2022-11-25  8:43 ` [PATCH v4 2/3] kunit: Use the static key when retrieving the current test David Gow
2022-12-02  0:54   ` Kees Cook
2022-12-05  4:27   ` Sadiya Kazi
2022-11-25  8:43 ` [PATCH v4 3/3] mm: slub: test: Use the kunit_get_current_test() function David Gow
2022-12-02  0:55   ` Kees Cook
2022-12-02  0:53 ` [PATCH v4 1/3] kunit: Provide a static key to check if KUnit is actively running tests Kees Cook
2022-12-02  1:19   ` Daniel Latypov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGS_qxotC7jCXewCoa3CwP0pxs=FRqZPF0oY67La0dUN1ay7LQ@mail.gmail.com' \
    --to=dlatypov@google.com \
    --cc=brendan.higgins@linux.dev \
    --cc=davidgow@google.com \
    --cc=keescook@chromium.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox