summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/sets/0006create_set_0
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-08-24 16:14:51 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2016-08-24 16:15:29 +0200
commite0f8c894982a57cb1772640715737c7477e7ef8d (patch)
treed171ea5e7512ac4412e8de0deecf11f6e1f56c58 /tests/shell/testcases/sets/0006create_set_0
parentf11cf6d42f873513f0bb9b80edb6bfad2dda55eb (diff)
tests: shell: cover add and create set command
This patch validates that creation of an already existing set bails out with EEXIST. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/sets/0006create_set_0')
-rwxr-xr-xtests/shell/testcases/sets/0006create_set_014
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/shell/testcases/sets/0006create_set_0 b/tests/shell/testcases/sets/0006create_set_0
new file mode 100755
index 00000000..ca36cf7a
--- /dev/null
+++ b/tests/shell/testcases/sets/0006create_set_0
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# This testscase checks for add and create set commands.
+
+set -e
+$NFT add table t
+$NFT add set t s { type ipv4_addr \; }
+if $NFT create set t s { type ipv4_addr \; } 2>/dev/null ; then
+ echo "E: accepted set creation that already exists" >&2
+ exit 1
+fi
+$NFT add set t s { type ipv4_addr \; }
+
+exit 0