summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/test/natipftest
blob: 493f18b43a83603593628e7e19b31f39dc599205 (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
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
mode=$1
name=$2
input=$3
output=$4
n=1

. ./ipflib.sh

test_init

shift
if [ $output = hex ] ; then
	format="-xF $input"
else
	format="-F $input"
fi
shift
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

case $mode in
single)
	echo "$name...";
	/bin/cp /dev/null results/$name
	( while read rule; do
		set_core $name $n
		echo "$rule" | ../ipftest -R $format -b -r regress/$name.ipf -N - -i input/$name >> \
			results/$name &
		back=$!
		wait $back
		test_end_leak $?
		n=`expr $n + 1`
		echo "-------------------------------" >> results/$name
	done ) < regress/$name.nat
	check_results $name
	;;
multi)
	echo "$name...";
	/bin/cp /dev/null results/$name
	../ipftest -R $format -b -r regress/$name.ipf -N regress/$name.nat \
		-i input/$name >> results/$name &
	back=$!
	wait $back
	test_end_leak $?
	echo "-------------------------------" >> results/$name
	check_results $name
	;;
esac
exit $status
OpenPOWER on IntegriCloud