]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: bogus EBUSY in set deletion after flush
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 8 Mar 2019 13:31:50 +0000 (14:31 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 8 Mar 2019 13:39:07 +0000 (14:39 +0100)
flush chain ip filter group_7933

Removes all rules, including references to set 'group_7933', however:

delete map ip filter group_7933

results in:

delete.nft:6:1-32: Error: Could not process rule: Device or resource busy
delete map ip filter group_7933
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/testcases/transactions/0046set_0 [new file with mode: 0755]

diff --git a/tests/shell/testcases/transactions/0046set_0 b/tests/shell/testcases/transactions/0046set_0
new file mode 100755 (executable)
index 0000000..172e24d
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+RULESET='add table ip filter
+add chain ip filter group_7933
+add map ip filter group_7933 { type ipv4_addr : classid; flags interval; }
+add rule ip filter group_7933 meta priority 0 meta priority set ip saddr map @group_7933 counter
+add element ip filter group_7933 { 10.4.22.0/24 : "1:0xc7cb" }
+'
+
+set -e
+$NFT -f - <<< "$RULESET"
+
+RULESET='delete element ip filter group_7933 { 10.4.22.0/24 }
+flush chain ip filter group_7933
+delete chain ip filter group_7933
+delete map ip filter group_7933'
+
+$NFT -f - <<< "$RULESET"