]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: exercise abort path with anonymous set that is bound to rule
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 1 Feb 2019 20:28:46 +0000 (21:28 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 8 Feb 2019 17:08:16 +0000 (18:08 +0100)
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/testcases/transactions/0043set_1 [new file with mode: 0755]

diff --git a/tests/shell/testcases/transactions/0043set_1 b/tests/shell/testcases/transactions/0043set_1
new file mode 100755 (executable)
index 0000000..a9135c1
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+RULESET="add table ip test
+add set ip test foo { type ipv4_addr; }
+add chain ip test tc
+add element ip test foo { 1.2.3.4 }
+add rule ip test tc ip saddr { 1.2.3.4, 5.6.7.8 } accept
+delete table ip test
+add element ip test foo { 1.2.3.6 }"
+
+# kernel must return ENOENT
+$NFT -f - <<< "$RULESET" 2>/dev/null || exit 0
+echo "E: allowing element insertion on unexisting set"
+exit 1