]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ipfilter/test/bpftest
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ipfilter / test / bpftest
1 #!/bin/sh
2 if [ -f /usr/ucb/touch ] ; then
3         TOUCH=/usr/ucb/touch
4 else
5         if [ -f /usr/bin/touch ] ; then
6                 TOUCH=/usr/bin/touch
7         else
8                 if [ -f /bin/touch ] ; then
9                         TOUCH=/bin/touch
10                 fi
11         fi
12 fi
13 echo "$1...";
14 input=`expr $1 : 'bpf-\(.*\)'`
15 /bin/cp /dev/null results/$1
16 ( while read rule; do
17         echo "$rule" | ../ipftest -Rbr - -i input/$input >> results/$1;
18         if [ $? -ne 0 ] ; then
19                 exit 1;
20         fi
21         echo "--------" >> results/$1
22 done ) < regress/$1
23 cmp expected/$1 results/$1
24 status=$?
25 if [ $status = 0 ] ; then
26         $TOUCH $1
27 fi
28 exit $status