]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: Add test case for sets.
authorVarsha Rao <rvarsha016@gmail.com>
Wed, 11 Oct 2017 04:44:33 +0000 (10:14 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 17 Oct 2017 12:01:48 +0000 (14:01 +0200)
This patch adds test case for anonymous sets.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/testcases/sets/0025anonymous_set_0 [new file with mode: 0755]

diff --git a/tests/shell/testcases/sets/0025anonymous_set_0 b/tests/shell/testcases/sets/0025anonymous_set_0
new file mode 100755 (executable)
index 0000000..93a7c02
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# Adding anonymous sets
+
+set -e
+
+$NFT add table t
+$NFT add chain t c { type filter hook output priority 0 \; }
+# set: IP addresses
+$NFT add rule t c ip daddr { \
+        192.168.0.1, \
+        192.168.0.2, \
+        192.168.0.3, \
+}
+
+#set : tcp ports
+$NFT add rule t c tcp dport { 22, 23 } counter