]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
extensions: libxt_iprange: add unit test
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 26 Sep 2012 16:41:39 +0000 (18:41 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 7 Oct 2013 14:35:50 +0000 (16:35 +0200)
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
extensions/libxt_iprange.t [new file with mode: 0644]

diff --git a/extensions/libxt_iprange.t b/extensions/libxt_iprange.t
new file mode 100644 (file)
index 0000000..6fd98be
--- /dev/null
@@ -0,0 +1,11 @@
+:INPUT,FORWARD,OUTPUT
+-m iprange --src-range 1.1.1.1-1.1.1.10;=;OK
+-m iprange ! --src-range 1.1.1.1-1.1.1.10;=;OK
+-m iprange --dst-range 1.1.1.1-1.1.1.10;=;OK
+-m iprange ! --dst-range 1.1.1.1-1.1.1.10;=;OK
+# it shows -A INPUT -m iprange --src-range 1.1.1.1-1.1.1.1, should we support this?
+# ERROR: should fail: iptables -A INPUT -m iprange --src-range 1.1.1.1
+# -m iprange --src-range 1.1.1.1;;FAIL
+# ERROR: should fail: iptables -A INPUT -m iprange --dst-range 1.1.1.1
+#-m iprange --dst-range 1.1.1.1;;FAIL
+-m iprange;;FAIL