]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ipfilter/test/dotest
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ipfilter / test / dotest
1 #!/bin/sh
2 thistest=$1
3 format=$2
4 output=$3
5 tuning=$4
6 if [ -f /usr/ucb/touch ] ; then
7         TOUCH=/usr/ucb/touch
8 else
9         if [ -f /usr/bin/touch ] ; then
10                 TOUCH=/usr/bin/touch
11         else
12                 if [ -f /bin/touch ] ; then
13                         TOUCH=/bin/touch
14                 fi
15         fi
16 fi
17 if [ "$tuning" != "" ] ; then
18         case $tuning in
19         -*)
20                 ;;
21         *)
22                 tuning="-T $tuning"
23                 ;;
24         esac
25 fi
26 echo "${thistest}...";
27 /bin/cp /dev/null results/${thistest}
28 ( while read rule; do
29         echo "$rule" | ../ipftest -F $format -Rbr - -i input/${thistest} $tuning>> results/${thistest};
30         if [ $? -ne 0 ] ; then
31                 exit 1;
32         fi
33         echo "--------" >> results/${thistest}
34 done ) < regress/${thistest}
35 cmp expected/${thistest} results/${thistest}
36 status=$?
37 if [ $status = 0 ] ; then
38         $TOUCH ${thistest}
39 fi
40 exit $status