diff options
Diffstat (limited to 'tests/runtest.sh')
-rwxr-xr-x | tests/runtest.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/runtest.sh b/tests/runtest.sh new file mode 100755 index 0000000..028e968 --- /dev/null +++ b/tests/runtest.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +tests="init" +tests+=" ipmap macipmap portmap" +tests+=" iphash nethash ipporthash" +tests+=" iptree iptreemap" + +for types in $tests; do + ipset -X test >/dev/null 2>&1 + while read ret cmd; do + case $ret in + \#) + if [ "$cmd" = "eof" ]; then + break + fi + what=$cmd + continue + ;; + *) + ;; + esac + echo -ne "$types: $what: " + eval $cmd >/dev/null 2>&1 + r=$? + # echo $ret $r + if [ "$ret" = "$r" ]; then + echo "OK" + else + echo "FAILED" + echo "Failed test: $cmd" + exit 1 + fi + # sleep 1 + done < $types.t +done +for x in $tests; do + case $x in + init) + ;; + *) + rmmod ip_set_$x >/dev/null 2>&1 + ;; + esac +done +rmmod ip_set >/dev/null 2>&1 +echo "All tests are OK" + |