From: Thomas Haller <thaller@redhat.com>
To: NetFilter <netfilter-devel@vger.kernel.org>
Cc: Thomas Haller <thaller@redhat.com>
Subject: [PATCH nft 1/2] tests/shell: use bash instead of /bin/sh for tests
Date: Mon, 16 Oct 2023 15:30:10 +0200 [thread overview]
Message-ID: <20231016133019.1134188-1-thaller@redhat.com> (raw)
All tests under "tests/shell" are shell scripts with shebang /bin/bash
or /bin/sh. This may seem expected, since these tests are under
"tests/shell" directory, but any executable file would work.
Anyway. The vast majority of the tests has "#!/bin/bash" as shebang.
A few tests had "#!/bin/sh" or "#!/bin/sh -e". Unify this and always use bash.
Since we anyway require bash, this is not a limitation.
Also, if we know that this is a bash script (by parsing the shebang), we
can let the test wrapper pass "-x" to the script. The next commit will
do that, and it is nicer if the shebangs are all uniform.
Signed-off-by: Thomas Haller <thaller@redhat.com>
---
tests/shell/testcases/chains/0014rename_0 | 2 +-
tests/shell/testcases/chains/0044chain_destroy_0 | 2 +-
tests/shell/testcases/flowtable/0015destroy_0 | 2 +-
tests/shell/testcases/maps/0014destroy_0 | 2 +-
tests/shell/testcases/rule_management/0010replace_0 | 2 +-
tests/shell/testcases/rule_management/0012destroy_0 | 2 +-
tests/shell/testcases/sets/0043concatenated_ranges_0 | 2 +-
tests/shell/testcases/sets/0043concatenated_ranges_1 | 2 +-
tests/shell/testcases/sets/0044interval_overlap_0 | 2 +-
tests/shell/testcases/sets/0044interval_overlap_1 | 2 +-
tests/shell/testcases/sets/0072destroy_0 | 2 +-
tests/shell/testcases/transactions/bad_expression | 2 +-
12 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/tests/shell/testcases/chains/0014rename_0 b/tests/shell/testcases/chains/0014rename_0
index bebe48d67af9..bd84e95784a7 100755
--- a/tests/shell/testcases/chains/0014rename_0
+++ b/tests/shell/testcases/chains/0014rename_0
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
$NFT add table t || exit 1
$NFT add chain t c1 || exit 1
diff --git a/tests/shell/testcases/chains/0044chain_destroy_0 b/tests/shell/testcases/chains/0044chain_destroy_0
index 1763d802c1dd..5c5a10a7b9c8 100755
--- a/tests/shell/testcases/chains/0044chain_destroy_0
+++ b/tests/shell/testcases/chains/0044chain_destroy_0
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
# NFT_TEST_REQUIRES(NFT_TEST_HAVE_destroy)
diff --git a/tests/shell/testcases/flowtable/0015destroy_0 b/tests/shell/testcases/flowtable/0015destroy_0
index 9e91ef5036a2..d2a87da080fb 100755
--- a/tests/shell/testcases/flowtable/0015destroy_0
+++ b/tests/shell/testcases/flowtable/0015destroy_0
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
# NFT_TEST_REQUIRES(NFT_TEST_HAVE_destroy)
diff --git a/tests/shell/testcases/maps/0014destroy_0 b/tests/shell/testcases/maps/0014destroy_0
index b17d0021d926..ee81e3cdcca9 100755
--- a/tests/shell/testcases/maps/0014destroy_0
+++ b/tests/shell/testcases/maps/0014destroy_0
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
# NFT_TEST_REQUIRES(NFT_TEST_HAVE_destroy)
diff --git a/tests/shell/testcases/rule_management/0010replace_0 b/tests/shell/testcases/rule_management/0010replace_0
index 251cebb26ec0..cd69a89d9861 100755
--- a/tests/shell/testcases/rule_management/0010replace_0
+++ b/tests/shell/testcases/rule_management/0010replace_0
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# test for kernel commit ca08987885a147643817d02bf260bc4756ce8cd4
# ("netfilter: nf_tables: deactivate expressions in rule replecement routine")
diff --git a/tests/shell/testcases/rule_management/0012destroy_0 b/tests/shell/testcases/rule_management/0012destroy_0
index 46a906cf36b8..a058150fed14 100755
--- a/tests/shell/testcases/rule_management/0012destroy_0
+++ b/tests/shell/testcases/rule_management/0012destroy_0
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
# NFT_TEST_REQUIRES(NFT_TEST_HAVE_destroy)
diff --git a/tests/shell/testcases/sets/0043concatenated_ranges_0 b/tests/shell/testcases/sets/0043concatenated_ranges_0
index 4165b2f5f711..83d743503c7b 100755
--- a/tests/shell/testcases/sets/0043concatenated_ranges_0
+++ b/tests/shell/testcases/sets/0043concatenated_ranges_0
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
#
# NFT_TEST_SKIP(NFT_TEST_SKIP_slow)
#
diff --git a/tests/shell/testcases/sets/0043concatenated_ranges_1 b/tests/shell/testcases/sets/0043concatenated_ranges_1
index bab189c56d8c..1be2889352c9 100755
--- a/tests/shell/testcases/sets/0043concatenated_ranges_1
+++ b/tests/shell/testcases/sets/0043concatenated_ranges_1
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
#
# 0043concatenated_ranges_1 - Insert and list subnets of different sizes
diff --git a/tests/shell/testcases/sets/0044interval_overlap_0 b/tests/shell/testcases/sets/0044interval_overlap_0
index 19aa6f5ed081..71bf3345a558 100755
--- a/tests/shell/testcases/sets/0044interval_overlap_0
+++ b/tests/shell/testcases/sets/0044interval_overlap_0
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
#
# NFT_TEST_SKIP(NFT_TEST_SKIP_slow)
#
diff --git a/tests/shell/testcases/sets/0044interval_overlap_1 b/tests/shell/testcases/sets/0044interval_overlap_1
index 905e6d5a0348..cdd0c8446f1b 100755
--- a/tests/shell/testcases/sets/0044interval_overlap_1
+++ b/tests/shell/testcases/sets/0044interval_overlap_1
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
#
# NFT_TEST_SKIP(NFT_TEST_SKIP_slow)
#
diff --git a/tests/shell/testcases/sets/0072destroy_0 b/tests/shell/testcases/sets/0072destroy_0
index 6399dd0ff4c8..9886a9b04463 100755
--- a/tests/shell/testcases/sets/0072destroy_0
+++ b/tests/shell/testcases/sets/0072destroy_0
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
# NFT_TEST_REQUIRES(NFT_TEST_HAVE_destroy)
diff --git a/tests/shell/testcases/transactions/bad_expression b/tests/shell/testcases/transactions/bad_expression
index a820c2b98c39..794b62581b62 100755
--- a/tests/shell/testcases/transactions/bad_expression
+++ b/tests/shell/testcases/transactions/bad_expression
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# table with invalid expression (masquerade called from filter table).
# nft must return an error. Also catch nfnetlink retry loops that
--
2.41.0
next reply other threads:[~2023-10-16 13:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-16 13:30 Thomas Haller [this message]
2023-10-16 13:30 ` [PATCH nft 2/2] tests/shell: honor NFT_TEST_VERBOSE_TEST variable to debug tests via `bash -x` Thomas Haller
2023-10-16 19:43 ` [PATCH nft v2 " 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=20231016133019.1134188-1-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).