From patchwork Tue Sep 22 11:02:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pablo Neira Ayuso X-Patchwork-Id: 521001 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 202F11400CB for ; Tue, 22 Sep 2015 20:55:48 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757934AbbIVKzq (ORCPT ); Tue, 22 Sep 2015 06:55:46 -0400 Received: from mail.us.es ([193.147.175.20]:45370 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757929AbbIVKzn (ORCPT ); Tue, 22 Sep 2015 06:55:43 -0400 Received: (qmail 18924 invoked from network); 22 Sep 2015 12:55:42 +0200 Received: from unknown (HELO us.es) (192.168.2.11) by us.es with SMTP; 22 Sep 2015 12:55:42 +0200 Received: (qmail 5897 invoked by uid 507); 22 Sep 2015 10:55:42 -0000 X-Qmail-Scanner-Diagnostics: from 127.0.0.1 by antivirus1 (envelope-from , uid 501) with qmail-scanner-2.10 (clamdscan: 0.98.7/20930. spamassassin: 3.4.0. Clear:RC:1(127.0.0.1):SA:0(-103.2/7.5):. Processed in 1.861543 secs); 22 Sep 2015 10:55:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on antivirus1 X-Spam-Level: X-Spam-Status: No, score=-103.2 required=7.5 tests=BAYES_50,SMTPAUTH_US, USER_IN_WHITELIST autolearn=disabled version=3.4.0 X-Spam-ASN: AS12715 87.216.0.0/16 X-Envelope-From: pablo@netfilter.org Received: from unknown (HELO antivirus1) (127.0.0.1) by us.es with SMTP; 22 Sep 2015 10:55:40 -0000 Received: from 192.168.1.13 (192.168.1.13) by antivirus1 (F-Secure/fsigk_smtp/412/antivirus1); Tue, 22 Sep 2015 12:55:40 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/412/antivirus1) Received: (qmail 30430 invoked from network); 22 Sep 2015 12:55:39 +0200 Received: from 129.166.216.87.static.jazztel.es (HELO salvia.here) (pneira@us.es@87.216.166.129) by mail.us.es with SMTP; 22 Sep 2015 12:55:39 +0200 From: Pablo Neira Ayuso 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 Message-Id: <1442919740-12888-3-git-send-email-pablo@netfilter.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1442919740-12888-1-git-send-email-pablo@netfilter.org> References: <1442919740-12888-1-git-send-email-pablo@netfilter.org> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Signed-off-by: Pablo Neira Ayuso --- 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 ]