]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
ct regression tests for bytes, packets
authorFlorian Westphal <fw@strlen.de>
Mon, 14 Dec 2015 18:49:20 +0000 (19:49 +0100)
committerFlorian Westphal <fw@strlen.de>
Mon, 14 Dec 2015 18:49:20 +0000 (19:49 +0100)
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/py/any/ct.t
tests/py/any/ct.t.payload

index fd27a1daec1ee13e958a045bbd095a051357fb78..4c119eaa970fe6a467cd1be6ac6cc260c46659e4 100644 (file)
@@ -110,6 +110,15 @@ ct state . ct mark { new . 0x12345678, new . 0x34127856, established . 0x1278563
 ct direction . ct mark { original . 0x12345678};ok
 ct state . ct mark vmap { new . 0x12345678 : drop};ok
 
+ct original bytes \> 100000;ok;ct original bytes > 100000
+ct reply packets \< 100;ok;ct reply packets < 100
+ct bytes \> 100000;ok;ct bytes > 100000
+
+# bogus direction
+ct both bytes gt 1;fail
+# nonsensical
+ct bytes original reply;fail
+
 # missing direction
 ct saddr 1.2.3.4;fail
 
index 651b644969f05cf517e5cf1b9efc49c18094d0a9..ac99429cd4998c3f7beef7c574c3abe6b141dd3d 100644 (file)
@@ -286,3 +286,21 @@ ip test-ip4 output
   [ meta load mark => reg 1 ]
   [ lookup reg 1 set map%d dreg 1 ]
   [ ct set mark with reg 1 ]
+
+# ct original bytes \> 100000
+ip test-ip4 output
+  [ ct load bytes => reg 1 , dir original ]
+  [ byteorder reg 1 = hton(reg 1, 8, 8) ]
+  [ cmp gt reg 1 0x00000000 0xa0860100 ]
+
+# ct reply packets \< 100
+ip test-ip4 output
+  [ ct load packets => reg 1 , dir reply ]
+  [ byteorder reg 1 = hton(reg 1, 8, 8) ]
+  [ cmp lt reg 1 0x00000000 0x64000000 ]
+
+# ct bytes \> 100000
+ip test-ip4 output
+  [ ct load bytes => reg 1 ]
+  [ byteorder reg 1 = hton(reg 1, 8, 8) ]
+  [ cmp gt reg 1 0x00000000 0xa0860100 ]