diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2013-04-04 16:32:20 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2013-04-09 21:42:16 +0200 |
commit | fd9361feaafe075c50c2a2a2a627553d097cb1b3 (patch) | |
tree | 2628c04a8c329fe2ea102af0d882a01e61610bd8 /tests/resizen.sh | |
parent | 2222b6adb0be1bdffd58875c5c874e89b0aec4cd (diff) |
Add new testsuite entries to verify counters and the new type implementations
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Diffstat (limited to 'tests/resizen.sh')
-rw-r--r-- | tests/resizen.sh | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/tests/resizen.sh b/tests/resizen.sh new file mode 100644 index 0000000..1294efc --- /dev/null +++ b/tests/resizen.sh @@ -0,0 +1,78 @@ +#!/bin/sh + +# set -x +set -e + +ipset=../src/ipset + +case "$1" in + -4) + ip=10.0. + sep=. + net=32 + ip2=192.168.162.33 + ;; + -6) + ip=10:: + sep=: + net=128 + ip2=192:168::162:33 + ;; +esac + +case "$2" in + ipportnet) + $ipset n test hash:ip,port,net $1 hashsize 64 + for x in `seq 0 16`; do + for y in `seq 0 255`; do + $ipset a test $ip$x$sep$y,1023,$ip2/$net nomatch + done + done + for x in `seq 0 16`; do + for y in `seq 0 255`; do + $ipset t test $ip$x$sep$y,1023,$ip2/$net nomatch 2>/dev/null + done + done + ;; + net) + $ipset n test hash:net $1 hashsize 64 + for x in `seq 0 16`; do + for y in `seq 0 255`; do + $ipset a test $ip$x$sep$y/$net nomatch + done + done + for x in `seq 0 16`; do + for y in `seq 0 255`; do + $ipset t test $ip$x$sep$y/$net nomatch 2>/dev/null + done + done + ;; + netport) + $ipset n test hash:net,port $1 hashsize 64 + for x in `seq 0 16`; do + for y in `seq 0 255`; do + $ipset a test $ip$x$sep$y/$net,1023 nomatch + done + done + for x in `seq 0 16`; do + for y in `seq 0 255`; do + $ipset t test $ip$x$sep$y/$net,1023 nomatch 2>/dev/null + done + done + ;; + netiface) + $ipset n test hash:net,iface $1 hashsize 64 + for x in `seq 0 16`; do + for y in `seq 0 255`; do + $ipset a test $ip$x$sep$y/$net,eth0 nomatch + done + done + for x in `seq 0 16`; do + for y in `seq 0 255`; do + $ipset t test $ip$x$sep$y/$net,eth0 nomatch 2>/dev/null + done + done + ;; +esac +$ipset x +exit 0 |