freebsd-dev/contrib/ipfilter/test/dotest

35 lines
693 B
Plaintext
Raw Normal View History

#!/bin/sh
2005-12-30 11:34:54 +00:00
thistest=$1
format=$2
2005-12-30 11:34:54 +00:00
output=$3
tuning=$4
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
2005-12-30 11:34:54 +00:00
if [ "$tuning" != "" ] ; then
tuning="-T $tuning"
fi
echo "${thistest}...";
/bin/cp /dev/null results/${thistest}
( while read rule; do
2005-12-30 11:34:54 +00:00
echo "$rule" | ../ipftest -F $format -Rbr - -i input/${thistest} $tuning>> results/${thistest};
if [ $? -ne 0 ] ; then
exit 1;
fi
2005-12-30 11:34:54 +00:00
echo "--------" >> results/${thistest}
done ) < regress/${thistest}
cmp expected/${thistest} results/${thistest}
status=$?
if [ $status = 0 ] ; then
2005-12-30 11:34:54 +00:00
$TOUCH ${thistest}
fi
exit $status