Skip tests which contain unsupported feature in older kernels. Fixes: f09171e077f8 ("tests: shell: combine dormant flag with netdevice removal") Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> --- tests/shell/testcases/chains/netdev_chain_dormant_autoremove | 2 ++ tests/shell/testcases/maps/named_ct_objects | 1 + tests/shell/testcases/maps/nat_addr_port | 5 +++++ tests/shell/testcases/optimizations/ruleset | 1 + tests/shell/testcases/transactions/0049huge_0 | 5 +++++ 5 files changed, 14 insertions(+) diff --git a/tests/shell/testcases/chains/netdev_chain_dormant_autoremove b/tests/shell/testcases/chains/netdev_chain_dormant_autoremove index 0a684e565bdf..3093ce25319c 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 61b87c1ab14a..518140b0693d 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 2804d48ca406..703a2ad9d431 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 2b2d80ffc009..f7c3b74702ba 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 f66953c2ab70..698716b2b156 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 -- 2.30.2