From: Stefano Brivio <sbrivio@redhat.com>
To: Fabian Frederick <fabf@skynet.be>
Cc: pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
netdev@vger.kernel.org
Subject: Re: [PATCH 2/2 nf] selftests: netfilter: exit on invalid parameters
Date: Tue, 18 Aug 2020 02:39:35 +0200 [thread overview]
Message-ID: <20200818023935.3bee52fc@elisabeth> (raw)
In-Reply-To: <20200814185544.8732-1-fabf@skynet.be>
Hi Fabian,
On Fri, 14 Aug 2020 20:55:44 +0200
Fabian Frederick <fabf@skynet.be> wrote:
> exit script with comments when parameters are wrong during address
> addition. No need for a message when trying to change MTU with lower
> values: output is self-explanatory
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> tools/testing/selftests/netfilter/nft_flowtable.sh | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/tools/testing/selftests/netfilter/nft_flowtable.sh b/tools/testing/selftests/netfilter/nft_flowtable.sh
> index 28e32fddf9b2c..c3617d0037f2e 100755
> --- a/tools/testing/selftests/netfilter/nft_flowtable.sh
> +++ b/tools/testing/selftests/netfilter/nft_flowtable.sh
> @@ -97,9 +97,17 @@ do
> done
>
> ip -net nsr1 link set veth0 mtu $omtu
> +if [ $? -ne 0 ]; then
> + exit 1
> +fi
> +
As some of your recent patches are also clean-ups, perhaps you get some
assistance from 'shellcheck' (https://www.shellcheck.net/). For
example, this could be written as:
ip -net nsr1 link set veth0 mtu $omtu || exit 1
or, I'm not sure it's doable, you could get all those checks for free
by setting the -e flag for the entire script. You would then need to
take care explicitly of commands that can legitimately fail.
--
Stefano
next prev parent reply other threads:[~2020-08-18 0:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-14 18:55 [PATCH 2/2 nf] selftests: netfilter: exit on invalid parameters Fabian Frederick
2020-08-18 0:39 ` Stefano Brivio [this message]
2020-08-18 17:48 ` Fabian Frederick
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=20200818023935.3bee52fc@elisabeth \
--to=sbrivio@redhat.com \
--cc=coreteam@netfilter.org \
--cc=fabf@skynet.be \
--cc=fw@strlen.de \
--cc=kadlec@netfilter.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).