Blame tests/setlist_resize.sh
|
Packit Bot |
e97e7f |
#!/bin/sh
|
|
Packit Bot |
e97e7f |
|
|
Packit Bot |
e97e7f |
# set -x
|
|
Packit Bot |
e97e7f |
|
|
Packit Bot |
e97e7f |
ipset=${IPSET_BIN:-../src/ipset}
|
|
Packit Bot |
e97e7f |
|
|
Packit Bot |
e97e7f |
loop=8
|
|
Packit Bot |
e97e7f |
|
|
Packit Bot |
e97e7f |
for x in ip_set_list_set ip_set_hash_netiface ip_set_hash_ipportnet \
|
|
Packit Bot |
e97e7f |
ip_set_hash_netport ip_set_hash_net ip_set_hash_ipportip \
|
|
Packit Bot |
e97e7f |
ip_set_hash_ipport ip_set_hash_ip ip_set_hash_netnet \
|
|
Packit Bot |
e97e7f |
ip_set_hash_netportnet ip_set_hash_ipmark ip_set_hash_mac \
|
|
Packit Bot |
e97e7f |
ip_set_bitmap_port ip_set_bitmap_ipmac \
|
|
Packit Bot |
e97e7f |
ip_set_bitmap_ip xt_set ip_set; do
|
|
Packit Bot |
e97e7f |
rmmod $x
|
|
Packit Bot |
e97e7f |
done
|
|
Packit Bot |
e97e7f |
|
|
Packit Bot |
e97e7f |
create() {
|
|
Packit Bot |
e97e7f |
n=$1
|
|
Packit Bot |
e97e7f |
while [ $n -le 1024 ]; do
|
|
Packit Bot |
e97e7f |
$ipset c test$n hash:ip
|
|
Packit Bot |
e97e7f |
n=$((n+2))
|
|
Packit Bot |
e97e7f |
done
|
|
Packit Bot |
e97e7f |
}
|
|
Packit Bot |
e97e7f |
|
|
Packit Bot |
e97e7f |
for x in `seq 1 $loop`; do
|
|
Packit Bot |
e97e7f |
# echo "test round $x"
|
|
Packit Bot |
e97e7f |
create 1 &
|
|
Packit Bot |
e97e7f |
create 2 &
|
|
Packit Bot |
e97e7f |
wait
|
|
Packit Bot |
e97e7f |
test `$ipset l -n | wc -l` -eq 1024 || exit 1
|
|
Packit Bot |
e97e7f |
$ipset x
|
|
Packit Bot |
e97e7f |
test `lsmod|grep -w ^ip_set_hash_ip | awk '{print $3}'` -eq 0 || exit 1
|
|
Packit Bot |
e97e7f |
rmmod ip_set_hash_ip
|
|
Packit Bot |
e97e7f |
rmmod ip_set
|
|
Packit Bot |
e97e7f |
done
|