]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: add feature probe for sctp chunk matching
authorFlorian Westphal <fw@strlen.de>
Wed, 20 Sep 2023 23:32:27 +0000 (01:32 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 21 Sep 2023 13:41:52 +0000 (15:41 +0200)
Skip the relavant parts of the test if nft_exthdr lacks sctp support.

Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/features/sctp_chunks.nft [new file with mode: 0644]
tests/shell/testcases/sets/typeof_sets_0

diff --git a/tests/shell/features/sctp_chunks.nft b/tests/shell/features/sctp_chunks.nft
new file mode 100644 (file)
index 0000000..520afd6
--- /dev/null
@@ -0,0 +1,7 @@
+# 133dc203d77d ("netfilter: nft_exthdr: Support SCTP chunks")
+# v5.14-rc1~119^2~373^2~15
+table ip t {
+       chain c {
+               sctp chunk init 0
+       }
+}
index c1c0f51f399c707c88f355ab52cb12434a0618a5..35c572c1e5372542292b0eaac2d1881d70065520 100755 (executable)
@@ -23,6 +23,16 @@ INPUT_OSF_CHAIN="
        }
 "
 
+INPUT_SCTP_CHAIN="
+       chain c7 {
+               sctp chunk init num-inbound-streams @s7 accept
+       }
+"
+
+if [ "$NFT_TEST_HAVE_sctp_chunks" = n ] ; then
+       INPUT_SCTP_CHAIN=
+fi
+
 if [ "$NFT_TEST_HAVE_osf" = n ] ; then
        if [ "$((RANDOM % 2))" -eq 1 ] ; then
                # Regardless of $NFT_TEST_HAVE_osf, we can define the set.
@@ -98,11 +108,7 @@ $INPUT_OSF_CHAIN
        chain c6 {
                tcp option maxseg size @s6 accept
        }
-
-       chain c7 {
-               sctp chunk init num-inbound-streams @s7 accept
-       }
-
+$INPUT_SCTP_CHAIN
        chain c8 {
                ip version @s8 accept
        }
@@ -187,11 +193,7 @@ $INPUT_OSF_CHAIN
        chain c6 {
                tcp option maxseg size @s6 accept
        }
-
-       chain c7 {
-               sctp chunk init num-inbound-streams @s7 accept
-       }
-
+$INPUT_SCTP_CHAIN
        chain c8 {
                ip version @s8 accept
        }
@@ -218,3 +220,7 @@ if [ "$NFT_TEST_HAVE_osf" = n ] ; then
        echo "Partial test due to NFT_TEST_HAVE_osf=n. Skip"
        exit 77
 fi
+if [ "$NFT_TEST_HAVE_sctp_chunks" = n ] ; then
+       echo "Partial test due to NFT_TEST_HAVE_sctp_chunks=n. Skip"
+       exit 77
+fi