netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: <netfilter-devel@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH nft 5/6] ct regression tests for bytes, packets
Date: Fri,  8 Jan 2016 10:42:50 +0100	[thread overview]
Message-ID: <1452246171-13943-6-git-send-email-fw@strlen.de> (raw)
In-Reply-To: <1452246171-13943-1-git-send-email-fw@strlen.de>

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 tests/py/any/ct.t         |  9 +++++++++
 tests/py/any/ct.t.payload | 19 +++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/tests/py/any/ct.t b/tests/py/any/ct.t
index a0a2590..4c27c90 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 651b644..8ca92b2 100644
--- a/tests/py/any/ct.t.payload
+++ b/tests/py/any/ct.t.payload
@@ -286,3 +286,22 @@ 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 ]
+
-- 
2.4.10


  parent reply	other threads:[~2016-01-08  9:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08  9:42 [PATCH nft 0/6] add support for conntrack counters Florian Westphal
2016-01-08  9:42 ` [PATCH libnftnl 1/6] src: ct: add packet and byte counter support Florian Westphal
2016-01-08  9:42 ` [PATCH nft 2/6] nft: swap key and direction in ct_dir syntax Florian Westphal
2016-01-08  9:42 ` [PATCH nft 3/6] ct: add packet/byte counter support Florian Westphal
2016-01-08  9:42 ` [PATCH nft 4/6] netlink_linearize: use u64 conversion for 64bit quantities Florian Westphal
2016-01-08  9:42 ` Florian Westphal [this message]
2016-01-08  9:42 ` [PATCH nft 6/6] tests: ct: remove BUG cases that work with current master Florian Westphal
2016-01-13 12:50 ` [PATCH nft 0/6] add support for conntrack counters Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452246171-13943-6-git-send-email-fw@strlen.de \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).