summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/test/nattest
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ipfilter/test/nattest')
-rwxr-xr-xcontrib/ipfilter/test/nattest43
1 files changed, 19 insertions, 24 deletions
diff --git a/contrib/ipfilter/test/nattest b/contrib/ipfilter/test/nattest
index fece276..c970877 100755
--- a/contrib/ipfilter/test/nattest
+++ b/contrib/ipfilter/test/nattest
@@ -1,4 +1,10 @@
#!/bin/sh
+name=$1
+
+. ./ipflib.sh
+
+test_init
+
if [ $3 = hex ] ; then
format="-xF $2"
else
@@ -14,29 +20,18 @@ if [ "$4" != "" ] ; then
;;
esac
fi
-if [ -f /usr/ucb/touch ] ; then
- TOUCH=/usr/ucb/touch
-else
- if [ -f /usr/bin/touch ] ; then
- TOUCH=/usr/bin/touch
- else
- if [ -f /bin/touch ] ; then
- TOUCH=/bin/touch
- fi
- fi
-fi
-echo "$1...";
-/bin/cp /dev/null results/$1
+
+echo "$name...";
+n=1
+/bin/cp /dev/null results/$name
( while read rule; do
- echo "$rule" | ../ipftest $format -RbN - -i input/$1 >> results/$1;
- if [ $? -ne 0 ] ; then
- exit 1;
- fi
- echo "-------------------------------" >> results/$1
-done ) < regress/$1
-cmp expected/$1 results/$1
-status=$?
-if [ $status = 0 ] ; then
- $TOUCH $1
-fi
+ set_core $name $n
+ echo "$rule" | ../ipftest $format -DRbN - -i input/$name >>results/$name &
+ back=$!
+ wait $back
+ test_end_leak $?
+ n=`expr $n + 1`
+ echo "-------------------------------" >> results/$name
+done ) < regress/$name
+check_results $name
exit $status
OpenPOWER on IntegriCloud