Linux Netfilter development
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] tests: shell: Allow wrappers to be passed as nft command
Date: Tue, 16 Jun 2020 00:00:04 +0200	[thread overview]
Message-ID: <20200615220004.GA25745@salvia> (raw)
In-Reply-To: <4e47c812a2cbe17159393d8d2667e28b3c0ba79d.1592170384.git.sbrivio@redhat.com>

On Sun, Jun 14, 2020 at 11:41:37PM +0200, Stefano Brivio wrote:
> The current check on $NFT only allows to directly pass an executable,
> so I've been commenting it out locally for a while to run tests with
> valgrind.
> 
> Instead of using the -x test, run nft without arguments and check the
> exit status. POSIX.1-2017, Shell and Utilities volume, par. 2.8.2
> ("Exit Status for Commands") states:
> 
>   If a command is not found, the exit status shall be 127. If the
>   command name is found, but it is not an executable utility, the
>   exit status shall be 126. Applications that invoke utilities
>   without using the shell should use these exit status values to
>   report similar errors.
> 
> While this script isn't POSIX-compliant, it requires bash, and any
> modern version of bash complies with those exit status requirements.
> Also valgrind complies with this.
> 
> We need to quote the NFT variable passed to execute the commands in
> the main loop and adjust error and informational messages, too.
> 
> This way, for example, export NFT="valgrind nft" can be issued to
> run tests with valgrind.

Applied, thanks.

      reply	other threads:[~2020-06-15 22:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-14 21:41 [PATCH nft] tests: shell: Allow wrappers to be passed as nft command Stefano Brivio
2020-06-15 22:00 ` Pablo Neira Ayuso [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=20200615220004.GA25745@salvia \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=sbrivio@redhat.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