]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: Add test case for map expression.
authorVarsha Rao <rvarsha016@gmail.com>
Sun, 29 Oct 2017 20:49:31 +0000 (02:19 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 Nov 2017 15:02:32 +0000 (16:02 +0100)
Add tests for different map expression.

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

diff --git a/tests/shell/testcases/maps/different_map_types_1 b/tests/shell/testcases/maps/different_map_types_1
new file mode 100755 (executable)
index 0000000..b0a09d0
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# must fail: expr MAP { expr : type1, expr : type2, .. } expr
+
+set -e
+
+$NFT add table ip filter
+$NFT add chain ip filter output { type filter hook output priority 0 \; }
+$NFT add rule ip filter output meta mark set tcp dport map { 22 : 1, 23 : 192.168.0.1 }
+echo "E: Added two different types of expression to map"