diff mbox series

[nft,2/2] tests: extend existing dormat test case to catch a kernel bug

Message ID 20200714165558.14733-2-fw@strlen.de
State Accepted
Delegated to: Pablo Neira
Headers show
Series [nft,1/2] monitor: print "dormant" flag in monitor mode | expand

Commit Message

Florian Westphal July 14, 2020, 4:55 p.m. UTC
This is a test case for the kernel bug fixed by:
  netfilter: nf_tables: fix nat hook table deletion

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 tests/shell/testcases/transactions/0002table_0           | 1 +
 tests/shell/testcases/transactions/dumps/0002table_0.nft | 4 ++++
 2 files changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/tests/shell/testcases/transactions/0002table_0 b/tests/shell/testcases/transactions/0002table_0
index 246b10924d19..c5f31a6fb401 100755
--- a/tests/shell/testcases/transactions/0002table_0
+++ b/tests/shell/testcases/transactions/0002table_0
@@ -5,6 +5,7 @@  set -e
 RULESET="add table x
 delete table x
 add table x
+add chain x y { type nat hook prerouting priority 0; policy accept; }
 add table x { flags dormant; }"
 
 $NFT -f - <<< "$RULESET"
diff --git a/tests/shell/testcases/transactions/dumps/0002table_0.nft b/tests/shell/testcases/transactions/dumps/0002table_0.nft
index 6eb70726385f..429cbc348781 100644
--- a/tests/shell/testcases/transactions/dumps/0002table_0.nft
+++ b/tests/shell/testcases/transactions/dumps/0002table_0.nft
@@ -1,3 +1,7 @@ 
 table ip x {
 	flags dormant
+
+	chain y {
+		type nat hook prerouting priority filter; policy accept;
+	}
 }