]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: Add test for flush bug on sets with size
authorElise Lennion <elise.lennion@gmail.com>
Mon, 23 Jan 2017 22:42:00 +0000 (20:42 -0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 24 Jan 2017 17:54:42 +0000 (18:54 +0100)
This tests for a bug where elements can't be added after flushing a
full set with the flag NFTNL_SET_DESC_SIZE set.

Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/testcases/sets/0017add_after_flush_0 [new file with mode: 0755]

diff --git a/tests/shell/testcases/sets/0017add_after_flush_0 b/tests/shell/testcases/sets/0017add_after_flush_0
new file mode 100755 (executable)
index 0000000..0390b03
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# This tests for a bug where elements can't be added after flushing a
+# full set with the flag NFTNL_SET_DESC_SIZE set
+
+set -e
+$NFT add table x
+$NFT add set x s {type ipv4_addr\; size 2\;}
+$NFT add element x s {1.1.1.1}
+$NFT add element x s {1.1.1.2}
+$NFT flush set x s
+$NFT add element x s {1.1.1.1}