All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: "Štěpán Němec" <snemec@redhat.com>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] tests: run-tests.sh: ensure non-zero exit when $failed != 0
Date: Tue, 2 Nov 2021 22:01:29 +0100	[thread overview]
Message-ID: <20211102210129.GA5981@orbyte.nwl.cc> (raw)
In-Reply-To: <YYGjP4QP3veUmmMg@salvia>

On Tue, Nov 02, 2021 at 09:44:47PM +0100, Pablo Neira Ayuso wrote:
> On Tue, Nov 02, 2021 at 09:31:15PM +0100, Phil Sutter wrote:
> > Hi Pablo,
> > 
> > On Wed, Oct 27, 2021 at 11:09:23AM +0200, Pablo Neira Ayuso wrote:
> > > On Wed, Oct 20, 2021 at 05:06:41PM +0200, Phil Sutter wrote:
> > > > On Wed, Oct 20, 2021 at 02:44:09PM +0200, Štěpán Němec wrote:
> > > > > POSIX [1] does not specify the behavior of `exit' with arguments
> > > > > outside the 0-255 range, but what generally (bash, dash, zsh, OpenBSD
> > > > > ksh, busybox) seems to happen is the shell exiting with status & 255
> > > > > [2], which results in zero exit for certain non-zero arguments.
> > > > 
> > > > Standards aside, failed=256 is an actual bug:
> > > > 
> > > > | % bash -c "exit 255"; echo $?
> > > > | 255
> > > > | % bash -c "exit 256"; echo $?
> > > > | 0
> > > > | % bash -c "exit 257"; echo $?
> > > > | 1
> > > 
> > > This is extra information you provided here for the commit message for
> > > completion?
> > 
> > No need to extend the commit message IMO. I was just curious and played
> > a bit with exit values in bash. So although unlikely, the unpatched code
> > indeed confuses a result of 256 errors for a pass. :)
> 
> OK, then please go push out this patch if you're fine with it.

DONE. Sorry for the confusion.

Cheers, Phil

      reply	other threads:[~2021-11-02 21:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 12:44 [PATCH nft] tests: run-tests.sh: ensure non-zero exit when $failed != 0 Štěpán Němec
2021-10-20 15:06 ` Phil Sutter
2021-10-27  9:09   ` Pablo Neira Ayuso
2021-11-02 20:31     ` Phil Sutter
2021-11-02 20:44       ` Pablo Neira Ayuso
2021-11-02 21:01         ` Phil Sutter [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=20211102210129.GA5981@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=snemec@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 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.