diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2024-06-13 00:09:56 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2024-06-13 02:26:43 +0200 |
commit | b385d8f215b833e03d7a1997cfc6544f1d4d31ea (patch) | |
tree | ddfff82571bfb785db7fc85d1b28e28bf132c94f /tests/shell/testcases | |
parent | be055af5c58d9a4751990684d8f83b85082ca443 (diff) |
tests: shell: add dependencies to skip unsupported tests in older kernels
Update tests which contain unsupported features in older kernels.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases')
-rwxr-xr-x | tests/shell/testcases/chains/netdev_chain_dormant_autoremove | 2 | ||||
-rwxr-xr-x | tests/shell/testcases/maps/named_ct_objects | 1 | ||||
-rwxr-xr-x | tests/shell/testcases/maps/nat_addr_port | 5 | ||||
-rwxr-xr-x | tests/shell/testcases/optimizations/ruleset | 1 | ||||
-rwxr-xr-x | tests/shell/testcases/transactions/0049huge_0 | 5 |
5 files changed, 14 insertions, 0 deletions
diff --git a/tests/shell/testcases/chains/netdev_chain_dormant_autoremove b/tests/shell/testcases/chains/netdev_chain_dormant_autoremove index 0a684e56..3093ce25 100755 --- a/tests/shell/testcases/chains/netdev_chain_dormant_autoremove +++ b/tests/shell/testcases/chains/netdev_chain_dormant_autoremove @@ -1,5 +1,7 @@ #!/bin/bash +# NFT_TEST_REQUIRES(NFT_TEST_HAVE_netdev_chain_multidevice) + set -e ip link add dummy0 type dummy diff --git a/tests/shell/testcases/maps/named_ct_objects b/tests/shell/testcases/maps/named_ct_objects index 61b87c1a..518140b0 100755 --- a/tests/shell/testcases/maps/named_ct_objects +++ b/tests/shell/testcases/maps/named_ct_objects @@ -1,6 +1,7 @@ #!/bin/bash # NFT_TEST_REQUIRES(NFT_TEST_HAVE_cttimeout) +# NFT_TEST_REQUIRES(NFT_TEST_HAVE_ctexpect) $NFT -f /dev/stdin <<EOF || exit 1 table inet t { diff --git a/tests/shell/testcases/maps/nat_addr_port b/tests/shell/testcases/maps/nat_addr_port index 2804d48c..703a2ad9 100755 --- a/tests/shell/testcases/maps/nat_addr_port +++ b/tests/shell/testcases/maps/nat_addr_port @@ -84,6 +84,11 @@ $NFT add rule 'ip6 ip6foo c ip6 saddr f0:0b::a3 dnat to [1c::3]:42' && exit 1 # should fail: rule has no test for l4 protocol, but map has inet_service $NFT add rule 'ip6 ip6foo c dnat to ip daddr map @y' && exit 1 +if [ "$NFT_TEST_HAVE_inet_nat" = n ]; then + echo "Test partially skipped due to NFT_TEST_HAVE_inet_nat=n" + exit 77 +fi + # skeleton inet $NFT -f /dev/stdin <<EOF || exit 1 table inet inetfoo { diff --git a/tests/shell/testcases/optimizations/ruleset b/tests/shell/testcases/optimizations/ruleset index 2b2d80ff..f7c3b747 100755 --- a/tests/shell/testcases/optimizations/ruleset +++ b/tests/shell/testcases/optimizations/ruleset @@ -1,6 +1,7 @@ #!/bin/bash # NFT_TEST_REQUIRES(NFT_TEST_HAVE_prerouting_reject) +# NFT_TEST_REQUIRES(NFT_TEST_HAVE_inet_nat) RULESET="table inet uni { chain gtfo { diff --git a/tests/shell/testcases/transactions/0049huge_0 b/tests/shell/testcases/transactions/0049huge_0 index f66953c2..698716b2 100755 --- a/tests/shell/testcases/transactions/0049huge_0 +++ b/tests/shell/testcases/transactions/0049huge_0 @@ -42,6 +42,11 @@ if [ "$NFT_TEST_HAVE_json" != n ]; then test $($NFT -j -e -a -f - <<< "$RULESET" |sed 's/\({"add":\)/\n\1/g' |grep '"handle"' |wc -l) -eq ${RULE_COUNT} || exit 1 fi +if [ "$NFT_TEST_HAVE_inet_nat" = n ]; then + echo "Test partially skipped due to missing inet nat support." + exit 77 +fi + # Now an example from firewalld's testsuite # $NFT flush ruleset |