From e0b76e5114374ce1e1c55a1aa122bf00ae8060b2 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Mon, 14 Dec 2015 19:49:20 +0100 Subject: ct regression tests for bytes, packets Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso --- tests/py/any/ct.t | 9 +++++++++ tests/py/any/ct.t.payload | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) (limited to 'tests/py/any') diff --git a/tests/py/any/ct.t b/tests/py/any/ct.t index fd27a1da..4c119eaa 100644 --- a/tests/py/any/ct.t +++ b/tests/py/any/ct.t @@ -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 diff --git a/tests/py/any/ct.t.payload b/tests/py/any/ct.t.payload index 651b6449..ac99429c 100644 --- a/tests/py/any/ct.t.payload +++ b/tests/py/any/ct.t.payload @@ -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 ] -- cgit v1.2.3