From: Pablo Neira Ayuso Date: Wed, 24 Aug 2016 14:14:51 +0000 (+0200) Subject: tests: shell: cover add and create set command X-Git-Tag: v0.7~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0f8c894982a57cb1772640715737c7477e7ef8d;p=thirdparty%2Fnftables.git 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 --- diff --git a/tests/shell/testcases/sets/0006create_set_0 b/tests/shell/testcases/sets/0006create_set_0 new file mode 100755 index 000000000..ca36cf7ac --- /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