]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: py: Test connlimit statement
authorPhil Sutter <phil@nwl.cc>
Thu, 17 Feb 2022 11:52:20 +0000 (12:52 +0100)
committerPhil Sutter <phil@nwl.cc>
Sun, 20 Feb 2022 00:46:51 +0000 (01:46 +0100)
This wasn't covered at all.

Signed-off-by: Phil Sutter <phil@nwl.cc>
tests/py/any/ct.t
tests/py/any/ct.t.json
tests/py/any/ct.t.payload

index 8b8e68ab7361aac7942c7a1c44e4e63db675a476..f73fa4e7aedbec5fc1a55d3d6d6de3b47d0836ce 100644 (file)
@@ -144,3 +144,6 @@ ct set invalid original 42;fail
 ct set invalid 42;fail
 
 notrack;ok
+
+ct count 3;ok
+ct count over 3;ok
index 6684963b6609c1a20dd0c88cc01813cf9f342318..a2a06025992c705130a3cfb387b87ccdda88337c 100644 (file)
     }
 ]
 
+# ct count 3
+[
+    {
+        "ct count": {
+            "val": 3
+        }
+    }
+]
+
+# ct count over 3
+[
+    {
+        "ct count": {
+            "inv": true,
+            "val": 3
+        }
+    }
+]
+
index 733276e196f202ada03e418ccadfc4dfa8fbfe33..ed868e53277d92fb6b5ac895218bab932d0f0a7a 100644 (file)
@@ -508,3 +508,11 @@ ip6
   [ bitwise reg 1 = ( reg 1 & 0x00000020 ) ^ 0x00000000 ]
   [ cmp eq reg 1 0x00000000 ]
 
+# ct count 3
+ip test-ip4 output
+  [ connlimit count 3 flags 0 ]
+
+# ct count over 3
+ip test-ip4 output
+  [ connlimit count 3 flags 1 ]
+