]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/shell: Test flush and nat chain recreate in one go
authorPhil Sutter <phil@nwl.cc>
Wed, 21 Mar 2018 11:59:11 +0000 (12:59 +0100)
committerFlorian Westphal <fw@strlen.de>
Wed, 21 Mar 2018 13:13:00 +0000 (14:13 +0100)
This tests what kernel commit ae6153b50f9bf ("netfilter: nf_tables:
permit second nat hook if colliding hook is going away") fixed for.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/testcases/transactions/0041nat_restore_0 [new file with mode: 0755]

diff --git a/tests/shell/testcases/transactions/0041nat_restore_0 b/tests/shell/testcases/transactions/0041nat_restore_0
new file mode 100755 (executable)
index 0000000..6297185
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+set -e
+
+RULESET="
+add table ip t
+add chain ip t c { type nat hook postrouting priority 0; }
+"
+
+$NFT -f - <<< $RULESET
+
+RULESET="
+flush ruleset
+$RULESET
+"
+
+$NFT -f - <<< $RULESET