]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/shell: Test large transaction with echo output
authorPhil Sutter <phil@nwl.cc>
Wed, 29 May 2019 13:13:46 +0000 (15:13 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 31 May 2019 15:57:36 +0000 (17:57 +0200)
This reliably triggered ENOBUFS condition in mnl_batch_talk(). With the
past changes, it passes even after increasing the number of rules to
300k.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/testcases/transactions/0049huge_0 [new file with mode: 0755]

diff --git a/tests/shell/testcases/transactions/0049huge_0 b/tests/shell/testcases/transactions/0049huge_0
new file mode 100755 (executable)
index 0000000..1233808
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# let's try to exceed transaction buffer space
+
+$NFT flush ruleset
+$NFT add table inet test
+$NFT add chain inet test c
+
+RULESET=$(
+for ((i = 0; i < 3000; i++)); do
+       echo "add rule inet test c accept comment rule$i"
+done
+)
+$NFT -e -f - <<< "$RULESET" >/dev/null