summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/test/logtest
blob: 0600056c00ed0ac5c1961e8482d2ef3f7e26e20c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
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
/bin/cp /dev/null results/$1.b

( while read rule; do
	echo $rule >> results/$1 
	echo $rule | ../ipftest -br - -Hi input/$1 -l logout > /dev/null
	if [ $? -ne 0 ] ; then
		/bin/rm -f logout
		exit 1
	fi
	../ipmon -P /dev/null -f logout >> results/$1
        echo "--------" >> results/$1
	../ipmon -P /dev/null -bf logout >> results/$1.b
        echo "--------" >> results/$1.b
done ) < regress/$1
../ipftest -br regress/$1 -Hi input/$1 -l logout > /dev/null
../ipmon -P /dev/null -f logout >> results/$1
echo "--------" >> results/$1
../ipmon -P /dev/null -bf logout >> results/$1.b
echo "--------" >> results/$1.b

cmp expected/$1 results/$1
status=$?
if [ $status -ne 0 ] ; then
	exit $status
fi
cmp expected/$1.b results/$1.b
status=$?
if [ $status -ne 0 ] ; then
	exit $status
fi
/bin/rm -f logout
$TOUCH $1
exit 0
OpenPOWER on IntegriCloud