All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Yi Chen <yiche@redhat.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] tests: shell: Add a test case to verify the limit statement.
Date: Fri, 20 Jun 2025 11:31:17 +0200	[thread overview]
Message-ID: <aFUqWOr8nxp1eHLl@strlen.de> (raw)
In-Reply-To: <CAJsUoE0etJbdwHsHFHDnY1CkdmAXLJy7PunwQg9Me4n-AMPWmQ@mail.gmail.com>

Yi Chen <yiche@redhat.com> wrote:
> > export NFT_TEST_LIBRARY_FILE="$NFT_TEST_BASEDIR/helpers/lib.sh"
> > or whatever.  Then tests can do
> > . $NFT_TEST_LIBRARY_FILE
> 
> I prefer a single test script that can be executed independently.

Why?  Its possible to execute only one test via
tests/shell/run-tests.sh $filename

There is one exeception in the tree:
  tests/shell/testcases/transactions/30s-stress

... because that script can be passed a run-time, when
executed as part of the tests it runs for 30s but one
can do "tests/shell/testcases/transactions/30s-stress 600" etc.

Thats also why it does this:
  if [ x = x"$NFT" ] ; then
        NFT=nft
  fi

I missed this earlier when reviewing nft_nat test:

+       ip netns exec $R nft -f - <<-EOF

*ALL* "nft" should be replaced by "$NFT", so when the tests are executed
the locally built nft version, i.e. src/nft, is used, not the system binary.

Also:
tools/check-tree.sh |grep ftp
ERR:  "tests/shell/testcases/packetpath/nat_ftp" has no "tests/shell/testcases/packetpath/dumps/nat_ftp.{nft,nodump}" file

In this case it makes sense to add

  tests/shell/testcases/packetpath/dumps/nat_ftp.nodump

Can you send a followup patch?
Thanks, and sorry for missing this earlier.

> So, Would you accept something like:
> . $NFT_TEST_LIBRARY_FILE || . ${PWD%%/testcases*}/helpers/lib.sh?

Yes, but only if there is a compelling reason for the stand-alone
requirement.

  parent reply	other threads:[~2025-06-20  9:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-17 10:41 [PATCH] tests: shell: Add a test case to verify the limit statement Yi Chen
2025-06-18 22:46 ` Florian Westphal
     [not found]   ` <CAJsUoE0etJbdwHsHFHDnY1CkdmAXLJy7PunwQg9Me4n-AMPWmQ@mail.gmail.com>
2025-06-20  9:31     ` Florian Westphal [this message]
     [not found]       ` <CAJsUoE1ZChx7VcbZLnBpwbbkhGmfVVzomHUu7GP8xQCs00gZrw@mail.gmail.com>
2025-06-20 12:30         ` Yi Chen
2025-06-20 16:40 ` [PATCH] tests: shell: Verify limit statement with new test case Yi Chen
2025-06-20 16:47 ` [PATCH v2] " Yi Chen
2025-06-21 11:37   ` 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=aFUqWOr8nxp1eHLl@strlen.de \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=yiche@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.