]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: add dependencies to skip unsupported tests in older kernels
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 12 Jun 2024 22:09:56 +0000 (00:09 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 13 Jun 2024 00:26:43 +0000 (02:26 +0200)
Update tests which contain unsupported features in older kernels.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/testcases/chains/netdev_chain_dormant_autoremove
tests/shell/testcases/maps/named_ct_objects
tests/shell/testcases/maps/nat_addr_port
tests/shell/testcases/optimizations/ruleset
tests/shell/testcases/transactions/0049huge_0

index 0a684e565bdf8282fdc583cf71664de0b7165b26..3093ce25319cf4c5533524ca711ab847b9b96471 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_netdev_chain_multidevice)
+
 set -e
 
 ip link add dummy0 type dummy
index 61b87c1ab14a9e846a523e92e3eec9493aea9017..518140b0693de64a0f9a12126689354d3602a77a 100755 (executable)
@@ -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 {
index 2804d48ca406234e705355c1648f85af8d04dc9c..703a2ad9d4311a833be65db3707bc33a293736d4 100755 (executable)
@@ -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 {
index 2b2d80ffc009d07aff7b9de60ebc653efe9520e6..f7c3b74702baa96d4563fb9bf9dfd4fd96746337 100755 (executable)
@@ -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 {
index f66953c2ab701190322b825f248433d0586b9195..698716b2b156f3ccbb7c19ecb957b9a5dbd2c065 100755 (executable)
@@ -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