diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2010-06-25 16:30:52 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2010-06-25 16:30:52 +0200 |
commit | 780f6384c5c6639da3f5a6ac8d30653e8a26d6c0 (patch) | |
tree | 9c8091a4d0a01f0f3216dd5758bf4d07e81cb843 /tests/runtest.sh | |
parent | 020936c8c3375e1efe44a3087c891a4b2cbfe044 (diff) |
ipset 5: IPv6 port related and manpage fixes, more testsv5.0-pre4
- getting ports for family INET6 fixed
- more manpage polishing
- tests to check the iptables/ip6tables match and target added
Diffstat (limited to 'tests/runtest.sh')
-rwxr-xr-x | tests/runtest.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/runtest.sh b/tests/runtest.sh index ccd057e..32702c9 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -10,8 +10,40 @@ tests="$tests nethash hash:net hash:net6" tests="$tests setlist" tests="$tests iptree iptreemap" +add_tests() { + # inet|inet6 network + if [ $1 = "inet" ]; then + cmd=iptables-save + add=match_target + else + cmd=ip6tables-save + add=match_target6 + fi + modprobe ip_tables + if [ ! -e /var/log/kern.log -a -z "`grep 'kernel: ip_tables: ' /var/log/kern/log`" ]; then + echo "The destination for kernel log is not /var/log/kern.log, skipping $1 match and target tests" + return + fi + if [ `$cmd -t filter | wc -l` -eq 7 -a \ + `$cmd -t filter | grep ACCEPT | wc -l` -eq 3 ]; then + if [ -z "`which sendip`" ]; then + echo "sendip utility is missig: skipping $1 match and target tests" + elif [ -n "`netstat --protocol $1 -n | grep $2`" ]; then + echo "Our test network $2 in use: skipping $1 match and target tests" + else + tests="$tests $add" + fi + : + else + echo "You have got iptables rules: skipping $1 match and target tests" + fi +} + if [ "$1" ]; then tests="init $@" +else + add_tests inet 10.255.255 + add_tests inet6 1002:1002:1002:1002:: fi for types in $tests; do |