]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: skip adding catchall elements if unuspported
authorFlorian Westphal <fw@strlen.de>
Wed, 20 Sep 2023 23:05:26 +0000 (01:05 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 21 Sep 2023 13:41:52 +0000 (15:41 +0200)
The test fails on kernels without catchall support, so elide this
small part.

No need to skip the test in this case, the dump file validates that
the added elements are no longer there after the timeout.

Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/testcases/maps/vmap_timeout

index 43d031979cb34cd6ee7067131167041a97a9386f..0cd965f76d0e31a69a472388e45dbef5bccdf9cb 100755 (executable)
@@ -42,8 +42,12 @@ for i in $(seq 1 100) ; do
        $NFT add element inet filter portaddrmap "$batched_addr"
 done
 
-$NFT add element inet filter portaddrmap { "* timeout 2s : drop" }
-$NFT add element inet filter portmap { "* timeout 3s : drop" }
+if [ "$NFT_TEST_HAVE_catchall_element" = n ] ; then
+       echo "Partial test due to NFT_TEST_HAVE_catchall_element=n."
+else
+       $NFT add element inet filter portaddrmap { "* timeout 2s : drop" }
+       $NFT add element inet filter portmap { "* timeout 3s : drop" }
+fi
 
 # wait for elements to time out
 sleep 5