From: Thomas Haller <thaller@redhat.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, fw@strlen.de
Subject: Re: [PATCH nft 01/12] tests: shell: export DIFF to use it from feature scripts
Date: Thu, 09 Nov 2023 21:35:58 +0100 [thread overview]
Message-ID: <3b81fb7a25e8daf8a6c2c76ab0672207cf2c09c0.camel@redhat.com> (raw)
In-Reply-To: <ZU0vsd5zUuf3mSdm@calendula>
On Thu, 2023-11-09 at 20:14 +0100, Pablo Neira Ayuso wrote:
> On Thu, Nov 09, 2023 at 06:49:21PM +0100, Thomas Haller wrote:
> > On Thu, 2023-11-09 at 17:22 +0100, Pablo Neira Ayuso wrote:
> > > export DIFF so it can be used from feature scripts to probe the
> > > kernel.
> > >
> > > +DIFF="$(which diff)"
> > > +if [ ! -x "$DIFF" ] ; then
> > > + DIFF=true
> > > +fi
> > > +export DIFF
> >
> >
> > what is the purpose of having $DIFF variable at all?
> > Why not require to have `diff` installed?
> >
> > Maybe that justification is somewhere in the history of the
> > project. If
> > so, could you drop one line in the commit message what the point
> > is?
>
> It is all available in git annotate:
>
> 68310ba0f9c2 ("tests: shell: Search diff tool once and for all")
> 7d93e2c2fbc7 ("tests: shell: autogenerate dump verification")
First use of $DIFF comes from
3fb3bb603374 ('tests/listing: add some listing tests')
which says:
In order to ease debug in case of failure, if the diff tool is in the system,
then a textual diff is printed.
With the `true` fallback, checks are skipped. It would be possible, to
use a fallback that still checks for equality (albeit without fancy
diff output).
But really. Just require everybody to install a diff program.
>
> I just need to move it around so I can use it from feature scripts.
> If you prefer I can just use 'diff' instead from the feature scripts.
Sure. The patch is fine.
I think one day,
sed 's/\$DIFF\>/diff/g' -i $(git grep -l DIFF tests/shell/)
should be done.
Thomas
next prev parent reply other threads:[~2023-11-09 20:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 16:22 [PATCH nft 00/12] update tests/shell for 5.4 kernels Pablo Neira Ayuso
2023-11-09 16:22 ` [PATCH nft 01/12] tests: shell: export DIFF to use it from feature scripts Pablo Neira Ayuso
2023-11-09 17:49 ` Thomas Haller
2023-11-09 19:14 ` Pablo Neira Ayuso
2023-11-09 20:35 ` Thomas Haller [this message]
2023-11-09 23:21 ` Florian Westphal
2023-11-09 23:25 ` Florian Westphal
2023-11-09 16:22 ` [PATCH nft 02/12] tests: shell: skip pipapo tests if kernel lacks support Pablo Neira Ayuso
2023-11-09 23:25 ` Florian Westphal
2023-11-09 16:22 ` [PATCH nft 03/12] tests: shell: skip prerouting reject " Pablo Neira Ayuso
2023-11-09 23:26 ` Florian Westphal
2023-11-09 16:22 ` [PATCH nft 04/12] tests: shell: skip stateful expression in sets " Pablo Neira Ayuso
2023-11-09 23:27 ` Florian Westphal
2023-11-09 16:22 ` [PATCH nft 05/12] tests: shell: skip NAT netmap " Pablo Neira Ayuso
2023-11-09 16:22 ` [PATCH nft 06/12] tests: shell: skip comment " Pablo Neira Ayuso
2023-11-09 16:22 ` [PATCH nft 07/12] tests: shell: skip multidevice chain " Pablo Neira Ayuso
2023-11-09 16:23 ` [PATCH nft 08/12] tests: shell: skip if kernel does not support bitshift Pablo Neira Ayuso
2023-11-09 16:23 ` [PATCH nft 09/12] tests: shell: split set NAT interval test Pablo Neira Ayuso
2023-11-09 16:23 ` [PATCH nft 10/12] tests: shell: split map test Pablo Neira Ayuso
2023-11-09 16:23 ` [PATCH nft 11/12] tests: shell: split single element in anonymous set Pablo Neira Ayuso
2023-11-09 16:23 ` [PATCH nft 12/12] tests: shell: split merge nat optimization in two tests Pablo Neira Ayuso
2023-11-09 23:29 ` [PATCH nft 00/12] update tests/shell for 5.4 kernels Florian Westphal
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=3b81fb7a25e8daf8a6c2c76ab0672207cf2c09c0.camel@redhat.com \
--to=thaller@redhat.com \
--cc=fw@strlen.de \
--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).