netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Haller <thaller@redhat.com>
To: NetFilter <netfilter-devel@vger.kernel.org>
Cc: Thomas Haller <thaller@redhat.com>
Subject: [PATCH nft 4/6] tests/shell: special handle base path starting with "./"
Date: Wed, 13 Sep 2023 19:05:07 +0200	[thread overview]
Message-ID: <20230913170649.439394-5-thaller@redhat.com> (raw)
In-Reply-To: <20230913170649.439394-1-thaller@redhat.com>

When we auto detect the tests with `tests/shell/run-tests.sh -L`, then
commonly the NFT_TEST_BASEDIR starts with a redundant "./". That's a bit
ugly.

Instead, special handle that case and remove the prefix. The effect is
that `tests/shell/run-tests.sh -L` shows

  tests/shell/testcases/bitwise/0040mark_binop_0

instead of

  ./tests/shell/testcases/bitwise/0040mark_binop_0

Signed-off-by: Thomas Haller <thaller@redhat.com>
---
 tests/shell/run-tests.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index f20a2bec9e9b..dae775bdf3dd 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -267,7 +267,9 @@ find_tests() {
 }
 
 if [ "${#TESTS[@]}" -eq 0 ] ; then
-	TESTS=( $(find_tests "$NFT_TEST_BASEDIR/testcases/") )
+	d="$NFT_TEST_BASEDIR/testcases/"
+	d="${d#./}"
+	TESTS=( $(find_tests "$d") )
 	test "${#TESTS[@]}" -gt 0 || msg_error "Could not find tests"
 fi
 
-- 
2.41.0


  parent reply	other threads:[~2023-09-13 17:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 17:05 [PATCH nft 0/6] adjust nft dump files and add check-tree script Thomas Haller
2023-09-13 17:05 ` [PATCH nft 1/6] tests/shell: remove spurious .nft dump files Thomas Haller
2023-09-13 17:05 ` [PATCH nft 2/6] tests/shell: drop unstable dump for "transactions/0051map_0" test Thomas Haller
2023-09-13 17:05 ` [PATCH nft 3/6] tests/shell: add missing nft/nodump files for tests Thomas Haller
2023-09-13 17:05 ` Thomas Haller [this message]
2023-09-13 17:05 ` [PATCH nft 5/6] tests/shell: in find_tests() use C locale for sorting tests names Thomas Haller
2023-09-13 17:05 ` [PATCH nft 6/6] tools: add "tools/check-tree.sh" script to check consistency of nft dumps Thomas Haller

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=20230913170649.439394-5-thaller@redhat.com \
    --to=thaller@redhat.com \
    --cc=netfilter-devel@vger.kernel.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).