From: Thomas Haller Date: Mon, 16 Oct 2023 13:30:10 +0000 (+0200) Subject: tests/shell: use bash instead of /bin/sh for tests X-Git-Tag: v1.0.9~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bfb22bbf0f03a3f3ce0ab71d4a2dce7516bc23a0;p=thirdparty%2Fnftables.git tests/shell: use bash instead of /bin/sh for tests 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 Signed-off-by: Florian Westphal --- diff --git a/tests/shell/testcases/chains/0014rename_0 b/tests/shell/testcases/chains/0014rename_0 index bebe48d67..bd84e9578 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 1763d802c..5c5a10a7b 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 9e91ef503..d2a87da08 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 b17d0021d..ee81e3cdc 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 251cebb26..cd69a89d9 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 46a906cf3..a058150fe 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 4165b2f5f..83d743503 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 bab189c56..1be288935 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 19aa6f5ed..71bf3345a 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 905e6d5a0..cdd0c8446 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 6399dd0ff..9886a9b04 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 a820c2b98..794b62581 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