All of lore.kernel.org
 help / color / mirror / Atom feed
* [nft PATCH 1/2] tests: shell: add a testcase for many defines
@ 2016-11-28 12:59 Arturo Borrero Gonzalez
  2016-11-28 12:59 ` [nft PATCH 2/2] tests: shell: add testcase for different defines usage Arturo Borrero Gonzalez
  2016-11-29 21:20 ` [nft PATCH 1/2] tests: shell: add a testcase for many defines Pablo Neira Ayuso
  0 siblings, 2 replies; 4+ messages in thread
From: Arturo Borrero Gonzalez @ 2016-11-28 12:59 UTC (permalink / raw)
  To: netfilter-devel

From: Arturo Borrero Gonzalez <arturo@debian.org>

Use many defines in a single nft -f run.

Signed-off-by: Arturo Borrero Gonzalez <arturo@debian.org>
---
 tests/shell/testcases/nft-f/0011manydefines_0 |   37 +++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100755 tests/shell/testcases/nft-f/0011manydefines_0

diff --git a/tests/shell/testcases/nft-f/0011manydefines_0 b/tests/shell/testcases/nft-f/0011manydefines_0
new file mode 100755
index 0000000..84664f4
--- /dev/null
+++ b/tests/shell/testcases/nft-f/0011manydefines_0
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# tests many defines in a single nft -f run
+
+HOWMANY=20000
+
+tmpfile=$(mktemp)
+if [ ! -w $tmpfile ] ; then
+	echo "Failed to create tmp file" >&2
+	exit 0
+fi
+
+trap "rm -rf $tmpfile" EXIT # cleanup if aborted
+
+generate1()
+{
+	for ((i=0; i<=HOWMANY; i++)) ; do
+		echo "define data_${i} = ${i}"
+	done
+}
+
+generate2()
+{
+	for ((i=0; i<=HOWMANY; i++)) ; do
+		echo "iifname \$data_${i}"
+	done
+}
+
+echo " $(generate1)
+table t {
+	chain c {
+		$(generate2)
+	}
+}" > $tmpfile
+
+set -e
+$NFT -f $tmpfile


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-29 21:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-28 12:59 [nft PATCH 1/2] tests: shell: add a testcase for many defines Arturo Borrero Gonzalez
2016-11-28 12:59 ` [nft PATCH 2/2] tests: shell: add testcase for different defines usage Arturo Borrero Gonzalez
2016-11-29 21:20   ` Pablo Neira Ayuso
2016-11-29 21:20 ` [nft PATCH 1/2] tests: shell: add a testcase for many defines Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.