diff options
Diffstat (limited to 'tests/shell')
-rwxr-xr-x | tests/shell/testcases/sets/0011add_many_elements_0 | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/shell/testcases/sets/0011add_many_elements_0 b/tests/shell/testcases/sets/0011add_many_elements_0 new file mode 100755 index 00000000..ba23f90f --- /dev/null +++ b/tests/shell/testcases/sets/0011add_many_elements_0 @@ -0,0 +1,32 @@ +#!/bin/bash + +# test adding many sets elements + +HOWMANY=255 + +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() { + echo -n "{" + for ((i=1; i<=HOWMANY; i++)) ; do + for ((j=1; j<=HOWMANY; j++)) ; do + echo -n "10.0.${i}.${j}" + [ "$i" == "$HOWMANY" ] && [ "$j" == "$HOWMANY" ] && break + echo -n ", " + done + done + echo -n "}" +} + +echo "add table x +add set x y { type ipv4_addr; } +add element x y $(generate)" > $tmpfile + +set -e +$NFT -f $tmpfile |