]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: delete chain and rule with jump to chain in same transaction
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 8 May 2018 11:23:25 +0000 (13:23 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 8 May 2018 12:26:37 +0000 (14:26 +0200)
We should not hit EBUSY in this case.

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

diff --git a/tests/shell/testcases/transactions/0015chain_0 b/tests/shell/testcases/transactions/0015chain_0
new file mode 100755 (executable)
index 0000000..90f8718
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+set -e
+
+RULESET="add table x
+add chain x y
+add chain x z
+add rule x z jump y"
+
+$NFT -f - <<< $RULESET
+if [ $? -ne 0 ] ; then
+        echo "E: unable to load good ruleset" >&2
+        exit 1
+fi
+
+RULESET="delete rule x z handle 3
+delete chain x z
+delete chain x y
+delete table x"
+
+$NFT -f - <<< $RULESET
+if [ $? -ne 0 ] ; then
+        echo "E: unable to load good ruleset" >&2
+        exit 1
+fi