]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: limit: extend them to validate new bytes/second and burst parameters
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 22 Sep 2015 10:49:15 +0000 (12:49 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 23 Sep 2015 10:17:07 +0000 (12:17 +0200)
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/regression/any/limit.t
tests/regression/any/limit.t.payload

index 9af1ea81f3b26f3a40b283424bed615ea92392a9..96ffe609b406ece12db14b24ee746ec780f8bc12 100644 (file)
@@ -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
index c196f12b041352e4daab557309b4638dbadfe646..a3c87d842e0c61277a1250c0dfbd66b988f3551b 100644 (file)
@@ -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 ]