blob: 95e90d2dd9b70b8f8711987349ddefcfef0d792f [file] [log] [blame] [raw]
#!/bin/sh
testitem=$1
TESTMODE=$2
mode=$3
. ./ipflib.sh
test_init
if [ -z $todo -o -z $resdir ] ; then
echo "arg1 wrong - '$testitem'"
exit 1
fi
set $args
name=$1
inputformat=$2
output=$3
shift
if [ $output = hex ] ; then
format="-xF $inputformat"
else
format="-F $inputformat"
fi
shift
shift
while [ $# -ge 1 ] ; do
l=`echo $1 | cut -c1`
if [ "$l" = "-" ] ; then
format="$format $1"
else
format="-T $1 $format"
fi
shift
done
. ./setup_test.sh
case $mode in
single)
echo "${todo}...";
/bin/cp /dev/null ${results}
( while read rule; do
if [ ${TESTMODE} = kern ] ; then
../ipf -D
../ipf -E
fi
echo "$rule" | ../ipftest -M ${TESTMODE} -R $format -b \
-r ${regress_ipf} -N - \
-i ${input} >> ${results} &
back=$!
wait $back
status=$?
if [ ${TESTMODE} = kern ] ; then
../ipf -D
fi
test_end_leak $status
echo "-------------------------------" >> ${results}
next_core
done ) < ${regress_nat}
check_results
;;
multi)
echo "${todo}...";
/bin/cp /dev/null ${results}
if [ ${TESTMODE} = kern ] ; then
../ipf -D
../ipf -E
fi
../ipftest -M ${TESTMODE} -R $format -b -r ${regress_ipf} \
-N ${regress_nat} -i ${input} >> ${results} &
back=$!
wait $back
status=$?
if [ ${TESTMODE} = kern ] ; then
../ipf -D
fi
test_end_leak $status
echo "-------------------------------" >> ${results}
check_results
;;
esac
exit $status