]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: flush after rule deletion
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 15 Feb 2019 10:05:43 +0000 (11:05 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 15 Feb 2019 10:09:32 +0000 (11:09 +0100)
Flush after rule deletion should hit no ENOENT.

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

diff --git a/tests/shell/testcases/transactions/0044rule_0 b/tests/shell/testcases/transactions/0044rule_0
new file mode 100755 (executable)
index 0000000..a4da480
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+RULESET="add table ip test
+add chain ip test tc
+add rule ip test tc counter"
+
+$NFT -f - <<< "$RULESET"
+if [ $? -ne 0 ] ; then
+        echo "E: unable to load good ruleset" >&2
+        exit 1
+fi
+
+RULESET="delete rule ip test tc handle 2
+flush ruleset"
+
+$NFT -f - <<< "$RULESET"
+if [ $? -ne 0 ] ; then
+        echo "E: unable to load good ruleset" >&2
+        exit 1
+fi