From: Kees Cook <keescook@chromium.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: shuah@kernel.org, luto@amacapital.net, wad@chromium.org,
linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-team@fb.com,
Tim.Bird@sony.com
Subject: Re: [PATCH v3 1/6] selftests/seccomp: use correct FIXTURE macro
Date: Tue, 17 Mar 2020 13:22:12 -0700 [thread overview]
Message-ID: <202003171322.77AD2BA3B@keescook> (raw)
In-Reply-To: <20200316225647.3129354-2-kuba@kernel.org>
On Mon, Mar 16, 2020 at 03:56:41PM -0700, Jakub Kicinski wrote:
> Quoting kdoc:
>
> FIXTURE_DATA:
> * This call may be used when the type of the fixture data
> * is needed. In general, this should not be needed unless
> * the *self* is being passed to a helper directly.
>
> FIXTURE:
> * Defines the data provided to TEST_F()-defined tests as *self*. It should be
> * populated and cleaned up using FIXTURE_SETUP() and FIXTURE_TEARDOWN().
>
> seccomp should use FIXTURE to declare types.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> tools/testing/selftests/seccomp/seccomp_bpf.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
> index ee1b727ede04..7bf82fb07f67 100644
> --- a/tools/testing/selftests/seccomp/seccomp_bpf.c
> +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
> @@ -909,7 +909,7 @@ TEST(ERRNO_order)
> EXPECT_EQ(12, errno);
> }
>
> -FIXTURE_DATA(TRAP) {
> +FIXTURE(TRAP) {
> struct sock_fprog prog;
> };
>
> @@ -1020,7 +1020,7 @@ TEST_F(TRAP, handler)
> EXPECT_NE(0, (unsigned long)sigsys->_call_addr);
> }
>
> -FIXTURE_DATA(precedence) {
> +FIXTURE(precedence) {
> struct sock_fprog allow;
> struct sock_fprog log;
> struct sock_fprog trace;
> @@ -1509,7 +1509,7 @@ void tracer_poke(struct __test_metadata *_metadata, pid_t tracee, int status,
> EXPECT_EQ(0, ret);
> }
>
> -FIXTURE_DATA(TRACE_poke) {
> +FIXTURE(TRACE_poke) {
> struct sock_fprog prog;
> pid_t tracer;
> long poked;
> @@ -1817,7 +1817,7 @@ void tracer_ptrace(struct __test_metadata *_metadata, pid_t tracee,
> change_syscall(_metadata, tracee, -1, -ESRCH);
> }
>
> -FIXTURE_DATA(TRACE_syscall) {
> +FIXTURE(TRACE_syscall) {
> struct sock_fprog prog;
> pid_t tracer, mytid, mypid, parent;
> };
> @@ -2321,7 +2321,7 @@ struct tsync_sibling {
> } \
> } while (0)
>
> -FIXTURE_DATA(TSYNC) {
> +FIXTURE(TSYNC) {
> struct sock_fprog root_prog, apply_prog;
> struct tsync_sibling sibling[TSYNC_SIBLINGS];
> sem_t started;
> --
> 2.24.1
>
--
Kees Cook
next prev parent reply other threads:[~2020-03-17 20:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-16 22:56 [PATCH v3 0/6] kselftest: add fixture parameters Jakub Kicinski
2020-03-16 22:56 ` [PATCH v3 1/6] selftests/seccomp: use correct FIXTURE macro Jakub Kicinski
2020-03-17 20:22 ` Kees Cook [this message]
2020-03-16 22:56 ` [PATCH v3 2/6] kselftest: factor out list manipulation to a helper Jakub Kicinski
2020-03-17 20:22 ` Kees Cook
2020-03-16 22:56 ` [PATCH v3 3/6] kselftest: create fixture objects Jakub Kicinski
2020-03-17 20:23 ` Kees Cook
2020-03-16 22:56 ` [PATCH v3 4/6] kselftest: run tests by fixture Jakub Kicinski
2020-03-17 20:25 ` Kees Cook
2020-03-16 22:56 ` [PATCH v3 5/6] kselftest: add fixture parameters Jakub Kicinski
2020-03-17 20:36 ` Kees Cook
2020-03-16 22:56 ` [PATCH v3 5/6] kselftest: add fixture variants Jakub Kicinski
2020-03-17 20:37 ` Kees Cook
2020-03-16 22:56 ` [PATCH v3 6/6] selftests: tls: run all tests for TLS 1.2 and TLS 1.3 Jakub Kicinski
2020-03-17 20:46 ` Kees Cook
2020-03-16 22:59 ` [PATCH v3 0/6] kselftest: add fixture parameters Jakub Kicinski
2020-03-17 20:47 ` Kees Cook
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=202003171322.77AD2BA3B@keescook \
--to=keescook@chromium.org \
--cc=Tim.Bird@sony.com \
--cc=kernel-team@fb.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=netdev@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=wad@chromium.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;
as well as URLs for NNTP newsgroup(s).