[PATCH nft] tests: shell: Add test case for multiple sets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This test case tests the id allocation of nftable set names.

Signed-off-by: Varsha Rao <rvarsha016@xxxxxxxxx>
---
 .../shell/testcases/sets/0034add_many_sets_0  | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100755 tests/shell/testcases/sets/0034add_many_sets_0

diff --git a/tests/shell/testcases/sets/0034add_many_sets_0 b/tests/shell/testcases/sets/0034add_many_sets_0
new file mode 100755
index 0000000..cd23082
--- /dev/null
+++ b/tests/shell/testcases/sets/0034add_many_sets_0
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# This testscase checks addition of multiple sets.
+
+COUNT=40000
+
+tmpfile=$(mktemp)
+if [ ! -w $tmpfile ] ; then
+        echo "Failed to create tmp file" >&2
+        exit 0
+fi
+
+trap "rm -rf $tmpfile" EXIT # cleanup if aborted
+
+generate() {
+        for ((i=1; i<=COUNT; i++)) ; do
+		echo "add set x y${i} { type ipv4_addr; }"
+        done
+}
+
+echo "add table x
+$(generate)" > $tmpfile
+
+set -e
+$NFT -f $tmpfile
-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux