summaryrefslogtreecommitdiffstats
path: root/tests/py/ip/objects.t
diff options
context:
space:
mode:
authorPablo M. Bermudo Garay <pablombg@gmail.com>2017-08-28 20:20:49 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-09-04 22:45:24 +0200
commit4a39d2d43695d954fda7c4a6de534e8b4b56c63c (patch)
tree461daea100b2ab4919596c6b7306a5764c3bb69b /tests/py/ip/objects.t
parente787d9852c563bf9ebd53f560da83403f6d35b4c (diff)
tests: py: add tests for limit stateful object
The patch also reorganizes ip/objects.t file. Signed-off-by: Pablo M. Bermudo Garay <pablombg@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/ip/objects.t')
-rw-r--r--tests/py/ip/objects.t20
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/py/ip/objects.t b/tests/py/ip/objects.t
index 742ec6af..76b802ac 100644
--- a/tests/py/ip/objects.t
+++ b/tests/py/ip/objects.t
@@ -2,19 +2,33 @@
*ip;test-ip4;output
+# counter
%cnt1 type counter;ok
%cnt2 type counter;ok
-%qt1 type quota 25 mbytes;ok
-%qt2 type quota over 1 kbytes;ok
-%cthelp2 type ct helper { type \"ftp\" protocol tcp\; l3proto ip6\; };fail
ip saddr 192.168.1.3 counter name "cnt2";ok
ip saddr 192.168.1.3 counter name "cnt3";fail
counter name tcp dport map {443 : "cnt1", 80 : "cnt2", 22 : "cnt1"};ok
+
+# quota
+%qt1 type quota 25 mbytes;ok
+%qt2 type quota over 1 kbytes;ok
+
ip saddr 192.168.1.3 quota name "qt1";ok
ip saddr 192.168.1.3 quota name "qt3";fail
quota name tcp dport map {443 : "qt1", 80 : "qt2", 22 : "qt1"};ok
+# ct helper
%cthelp1 type ct helper { type \"ftp\" protocol tcp\; };ok
+%cthelp2 type ct helper { type \"ftp\" protocol tcp\; l3proto ip6\; };fail
+
ct helper set "cthelp1";ok
ct helper set tcp dport map {21 : "cthelp1", 2121 : "cthelp1" };ok
+
+# limit
+%lim1 type limit rate 400/minute;ok
+%lim2 type limit rate over 1024 bytes/second burst 512 bytes;ok
+
+ip saddr 192.168.1.3 limit name "lim1";ok
+ip saddr 192.168.1.3 limit name "lim3";fail
+limit name tcp dport map {443 : "lim1", 80 : "lim2", 22 : "lim1"};ok