netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: kaber@trash.net, fw@strlen.de
Subject: [PATCH nft 3/3] tests: limit: extend them to validate new bytes/second and burst parameters
Date: Tue, 22 Sep 2015 13:02:20 +0200	[thread overview]
Message-ID: <1442919740-12888-3-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1442919740-12888-1-git-send-email-pablo@netfilter.org>

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 tests/regression/any/limit.t         |   15 +++++++++-
 tests/regression/any/limit.t.payload |   54 ++++++++++++++++++++++++++++++----
 2 files changed, 63 insertions(+), 6 deletions(-)

diff --git a/tests/regression/any/limit.t b/tests/regression/any/limit.t
index 9af1ea8..96ffe60 100644
--- a/tests/regression/any/limit.t
+++ b/tests/regression/any/limit.t
@@ -8,5 +8,18 @@
 limit rate 400/minute;ok
 limit rate 20/second;ok
 limit rate 400/hour;ok
-limit rate 400/week;ok
 limit rate 40/day;ok
+limit rate 400/week;ok
+limit rate 1023/second burst 10 packets;ok
+
+limit rate 1 kbytes/second;ok
+limit rate 2 kbytes/second;ok
+limit rate 1025 kbytes/second;ok
+limit rate 1023 mbytes/second;ok
+limit rate 10230 mbytes/second;ok
+limit rate 1023000 mbytes/second;ok
+
+limit rate 1025 bytes/second burst 512 bytes;ok
+limit rate 1025 kbytes/second burst 1023 kbytes;ok
+limit rate 1025 mbytes/second burst 1025 kbytes;ok
+limit rate 1025000 mbytes/second burst 1023 mbytes;ok
diff --git a/tests/regression/any/limit.t.payload b/tests/regression/any/limit.t.payload
index c196f12..a3c87d8 100644
--- a/tests/regression/any/limit.t.payload
+++ b/tests/regression/any/limit.t.payload
@@ -1,20 +1,64 @@
 # limit rate 400/minute
 ip test-ip4 output
-  [ limit rate 400/minute ]
+  [ limit rate 400/minute burst 0 type packets ]
 
 # limit rate 20/second
 ip test-ip4 output
-  [ limit rate 20/second ]
+  [ limit rate 20/second burst 0 type packets ]
 
 # limit rate 400/hour
 ip test-ip4 output
-  [ limit rate 400/hour ]
+  [ limit rate 400/hour burst 0 type packets ]
 
 # limit rate 400/week
 ip test-ip4 output
-  [ limit rate 400/week ]
+  [ limit rate 400/week burst 0 type packets ]
 
 # limit rate 40/day
 ip test-ip4 output
-  [ limit rate 40/day ]
+  [ limit rate 40/day burst 0 type packets ]
+
+# limit rate 1023/second burst 10 packets
+ip test-ip4 output
+  [ limit rate 1023/second burst 10 type packets ]
+
+# limit rate 1 kbytes/second
+ip test-ip4 output
+  [ limit rate 1024/second burst 0 type bytes ]
+
+# limit rate 2 kbytes/second
+ip test-ip4 output
+  [ limit rate 2048/second burst 0 type bytes ]
+
+# limit rate 1025 kbytes/second
+ip test-ip4 output
+  [ limit rate 1049600/second burst 0 type bytes ]
+
+# limit rate 1023 mbytes/second
+ip test-ip4 output
+  [ limit rate 1072693248/second burst 0 type bytes ]
+
+# limit rate 10230 mbytes/second
+ip test-ip4 output
+  [ limit rate 10726932480/second burst 0 type bytes ]
+
+# limit rate 1023000 mbytes/second
+ip test-ip4 output
+  [ limit rate 1072693248000/second burst 0 type bytes ]
+
+# limit rate 1025 bytes/second burst 512 bytes
+ip test-ip4 output
+  [ limit rate 1025/second burst 512 type bytes ]
+
+# limit rate 1025 kbytes/second burst 1023 kbytes
+ip test-ip4 output
+  [ limit rate 1049600/second burst 1047552 type bytes ]
+
+# limit rate 1025 mbytes/second burst 1025 kbytes
+ip test-ip4 output
+  [ limit rate 1074790400/second burst 1049600 type bytes ]
+
+# limit rate 1025000 mbytes/second burst 1023 mbytes
+ip test-ip4 output
+  [ limit rate 1074790400000/second burst 1072693248 type bytes ]
 
-- 
1.7.10.4


      parent reply	other threads:[~2015-09-22 10:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 11:02 [PATCH nft 1/3] src: add per-bytes limit Pablo Neira Ayuso
2015-09-22 11:02 ` [PATCH nft 2/3] src: add burst parameter to limit Pablo Neira Ayuso
2015-09-22 11:02 ` Pablo Neira Ayuso [this message]

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=1442919740-12888-3-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=kaber@trash.net \
    --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).