From: Carlos Antonio Neira Bustos <cneirabustos@gmail.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Networking <netdev@vger.kernel.org>,
Andrii Nakryiko <andriin@fb.com>, Yonghong Song <yhs@fb.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Jesper Dangaard Brouer <brouer@redhat.com>,
bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH v10 bpf-next] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.
Date: Thu, 24 Dec 2020 14:39:40 -0300 [thread overview]
Message-ID: <20201224173939.GA7572@localhost> (raw)
In-Reply-To: <CAEf4BzbqWa+Eco4u1zN4RqyprezBAJM-O6Oq4xv9q8Ac74ZhWg@mail.gmail.com>
On Tue, Dec 22, 2020 at 12:26:04PM -0800, Andrii Nakryiko wrote:
> On Mon, Dec 21, 2020 at 2:25 PM Carlos Neira <cneirabustos@gmail.com> wrote:
> >
> > Currently tests for bpf_get_ns_current_pid_tgid() are outside test_progs.
> > This change folds test cases into test_progs.
> >
> > Changes from v9:
> >
> > - Added test in root namespace.
> > - Fixed changed tracepoint from sys_enter to sys_usleep.
> > - Fixed pid, tgid values were inverted.
> > - Used CLONE(2) for namespaced test, the new process pid will be 1.
> > - Used ASSERTEQ on pid/tgid validation.
> > - Added comment on CLONE(2) call
> >
> > Signed-off-by: Carlos Neira <cneirabustos@gmail.com>
> > ---
Andrii,
Thanks for taking the time to check this out.
For the code style issues I found out that I was not using the --strict flag for
checkpatch.pl so I missed those warnings, now I'm using--strict as default.
I should look into using cindent or clang-format to avoid this.
>
> See checkpatch.pl errors ([0]), ignore the "do not initialize globals
> with zero" ones. Next time, please don't wait for me to point out
> every single instance where you didn't align wrapped around
> parameters.
>
> [0] https://patchwork.hopto.org/static/nipa/405025/11985347/checkpatch/stdout
>
> > tools/testing/selftests/bpf/.gitignore | 1 -
> > tools/testing/selftests/bpf/Makefile | 3 +-
> > .../bpf/prog_tests/ns_current_pid_tgid.c | 149 ++++++++++------
> > .../bpf/progs/test_ns_current_pid_tgid.c | 29 ++--
> > .../bpf/test_current_pid_tgid_new_ns.c | 160 ------------------
> > 5 files changed, 106 insertions(+), 236 deletions(-)
> > delete mode 100644 tools/testing/selftests/bpf/test_current_pid_tgid_new_ns.c
> >
You are right, the code is redundant I'll reuse it.
> newns_pidtgid and test_ns_current_pid_tgid_global_ns look identical to
> me, am I missing something on why you didn't reuse the testing logic
> between the two?
>
> > +{
> > + struct test_ns_current_pid_tgid__bss *bss;
> > + int err = 0, duration = 0;
> > + struct test_ns_current_pid_tgid *skel;
> > + pid_t pid, tgid;
> > + struct stat st;
> >
>
> [...]
prev parent reply other threads:[~2020-12-24 17:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-21 22:23 [PATCH v10 bpf-next] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs Carlos Neira
2020-12-22 20:26 ` Andrii Nakryiko
2020-12-24 17:39 ` Carlos Antonio Neira Bustos [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=20201224173939.GA7572@localhost \
--to=cneirabustos@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andriin@fb.com \
--cc=bpf@vger.kernel.org \
--cc=brouer@redhat.com \
--cc=ebiederm@xmission.com \
--cc=netdev@vger.kernel.org \
--cc=yhs@fb.com \
/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).