[iptables] extensions: Add tests and description for xt_quota module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Chenbo Feng <fengc@xxxxxxxxxx>

Introduces some iptables tests for the new --remain option in xt_quota
module. Add a breif description for how to use the --remain option in
the iptables-extension man page.

Signed-off-by: Chenbo Feng <fengc@xxxxxxxxxx>
---
 extensions/libxt_quota.man |  4 ++++
 extensions/libxt_quota.t   | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/extensions/libxt_quota.man b/extensions/libxt_quota.man
index fbecf37..388348f 100644
--- a/extensions/libxt_quota.man
+++ b/extensions/libxt_quota.man
@@ -5,3 +5,7 @@ byte counter reaches zero).
 .TP
 [\fB!\fP] \fB\-\-quota\fP \fIbytes\fP
 The quota in bytes.
+.TP
+\fB\-\-remain\fP \fIbytes\fP
+The remaining quota in bytes. If not specified, the remaining quota is equal
+to the value specified in \fB\-\-quota\fP.
diff --git a/extensions/libxt_quota.t b/extensions/libxt_quota.t
index c568427..8768e61 100644
--- a/extensions/libxt_quota.t
+++ b/extensions/libxt_quota.t
@@ -5,3 +5,14 @@
 -m quota ! --quota 18446744073709551615;=;OK
 -m quota --quota 18446744073709551616;;FAIL
 -m quota;;FAIL
+-m quota --quota 0 --remain 0;=;OK
+-m quota --quota 0 --remain 1;;FAIL
+-m quota --quota 1000 --remain 0;=;OK
+-m quota ! --quota 1000 --remain 0;=;OK
+-m quota --quota 1000 --remain 1000;=;OK
+-m quota ! --quota 1000 --remain 1000;=;OK
+-m quota --quota 1000 --remain 1001;;FAIL
+-m quota --quota 18446744073709551614 --remain 18446744073709551614;=;OK
+-m quota --quota 18446744073709551615 --remain 18446744073709551614;;FAIL
+-m quota --quota 18446744073709551616 --remain 18446744073709551615;;FAIL
+-m quota --quota 18446744073709551615 --remain 18446744073709551616;;FAIL
-- 
2.7.4




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux