From: Jakub Kicinski <kuba@kernel.org>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: <netdev@vger.kernel.org>, <edumazet@google.com>,
<pabeni@redhat.com>, <davem@davemloft.net>
Subject: Re: [PATCH net 5/5] selftests: net: add very basic test for netdev names and namespaces
Date: Tue, 17 Oct 2023 07:58:58 -0700 [thread overview]
Message-ID: <20231017075858.66863311@kernel.org> (raw)
In-Reply-To: <73c1dc5b-4add-0db9-0073-7ae8fed0c747@intel.com>
On Tue, 17 Oct 2023 13:25:10 +0200 Przemek Kitszel wrote:
> On 10/16/23 22:16, Jakub Kicinski wrote:
> > +fail() {
> > + if [ ! -z "$1" ]; then
>
> s/! -z/-n/
I find ! -z easier to read.
! -z == "not zero", -n == "not??"
> > + echo "ERROR: $1"
> > + else
> > + echo "ERROR: unexpected return code"
>
> I see that in some cases unexpected rc is 0, but it's worth printing.
>
> At the expense of requiring reader to know about default values syntax,
> whole if could become:
> echo "ERROR: ${1-unexpected return code} (rc=$_)"
SG!
> I didn't do my homework (of checking expectations of selftests
> "framework"), but perhaps errors/diag messages should go to stderr? >&2
Hm, I've never done that but won't hurt!
> > + fi
> > + RET_CODE=1
> > +}
> > +
> > +ip netns add $NS
> > +
> > +#
> > +# Test basic move without a rename
> > +#
> > +ip -netns $NS link add name $DEV type dummy || fail
> > +ip -netns $NS link set dev $DEV netns 1 || \
>
> \ after ||, |, && is redundant, not sure if it improves readability or not
Roger.
> I like this patch (and the rest of the series), especially for the fact
> how easy it is to test (compared to internals of HW drivers ;) )
Or notification fixes without something more flexible like YNL :(
prev parent reply other threads:[~2023-10-17 14:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-16 20:16 [PATCH net 0/5] net: fix bugs in device netns-move and rename Jakub Kicinski
2023-10-16 20:16 ` [PATCH net 1/5] net: fix ifname in netlink ntf during netns move Jakub Kicinski
2023-10-16 20:21 ` Jakub Kicinski
2023-10-16 20:16 ` [PATCH net 2/5] net: check for altname conflicts when changing netdev's netns Jakub Kicinski
2023-10-17 7:21 ` Jiri Pirko
2023-10-16 20:16 ` [PATCH net 3/5] net: avoid UAF on deleted altname Jakub Kicinski
2023-10-17 7:51 ` Jiri Pirko
2023-10-17 14:52 ` Jakub Kicinski
2023-10-17 16:10 ` Jiri Pirko
2023-10-17 16:35 ` Jiri Pirko
2023-10-17 18:07 ` Jakub Kicinski
2023-10-16 20:16 ` [PATCH net 4/5] net: move altnames together with the netdevice Jakub Kicinski
2023-10-17 7:51 ` Jiri Pirko
2023-10-16 20:16 ` [PATCH net 5/5] selftests: net: add very basic test for netdev names and namespaces Jakub Kicinski
2023-10-17 11:25 ` Przemek Kitszel
2023-10-17 14:58 ` Jakub Kicinski [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=20231017075858.66863311@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.