Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/regress/sys/kern Added ipf regression tests
details: https://anonhg.NetBSD.org/src/rev/24cb2639a5c5
branches: trunk
changeset: 526885:24cb2639a5c5
user: martti <martti%NetBSD.org@localhost>
date: Mon May 13 06:34:13 2002 +0000
description:
Added ipf regression tests
diffstat:
regress/sys/kern/Makefile | 4 ++--
regress/sys/kern/ipf/Makefile | 31 +++++++++++++++----------------
regress/sys/kern/ipf/dotest | 11 ++++++++---
regress/sys/kern/ipf/expected/in1 | 6 +++---
regress/sys/kern/ipf/hextest | 11 ++++++++---
regress/sys/kern/ipf/intest | 9 +++++++--
regress/sys/kern/ipf/itest | 9 +++++++--
regress/sys/kern/ipf/logtest | 23 ++++++++++++++---------
regress/sys/kern/ipf/mhtest | 11 ++++++++---
regress/sys/kern/ipf/mtest | 11 ++++++++---
regress/sys/kern/ipf/natipftest | 13 +++++++++----
regress/sys/kern/ipf/nattest | 11 ++++++++---
12 files changed, 97 insertions(+), 53 deletions(-)
diffs (truncated from 418 to 300 lines):
diff -r 878a644043bb -r 24cb2639a5c5 regress/sys/kern/Makefile
--- a/regress/sys/kern/Makefile Mon May 13 06:33:09 2002 +0000
+++ b/regress/sys/kern/Makefile Mon May 13 06:34:13 2002 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.12 2002/04/09 06:10:43 jdolecek Exp $
+# $NetBSD: Makefile,v 1.13 2002/05/13 06:34:13 martti Exp $
-SUBDIR+= execve extent getcwd lockf pipe sigtramp sysvmsg sysvsem sysvshm \
+SUBDIR+= execve extent getcwd ipf lockf pipe sigtramp sysvmsg sysvsem sysvshm \
unfdpass writev
.include <bsd.subdir.mk>
diff -r 878a644043bb -r 24cb2639a5c5 regress/sys/kern/ipf/Makefile
--- a/regress/sys/kern/ipf/Makefile Mon May 13 06:33:09 2002 +0000
+++ b/regress/sys/kern/ipf/Makefile Mon May 13 06:34:13 2002 +0000
@@ -1,3 +1,4 @@
+# $NetBSD: Makefile,v 1.2 2002/05/13 06:34:14 martti Exp $
#
# (C)opyright 1993-1996 by Darren Reed.
#
@@ -5,11 +6,9 @@
# provided that this notice is preserved and due credit is given
# to the original author and the contributors.
#
-BINDEST=/usr/local/bin
-SBINDEST=/sbin
-MANDIR=/usr/share/man
+.include <bsd.prog.mk>
-tests: first 0 ftests ptests ntests nitests logtests ipv6 intests
+regress tests: first ftests ptests ntests nitests logtests intests
first:
-mkdir -p results
@@ -22,7 +21,7 @@
ntests: n1 n2 n3 n4 n5 n6 n7
-nitests: ni1 ni2 ni3 ni4 ni5
+nitests: ni1 ni2 ni4 ni5
intests: in1 in2 in3 in4
@@ -34,34 +33,34 @@
@(cd ..; make ipftest; )
f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f14:
- @/bin/sh ./dotest $@
+ @/bin/sh ${.CURDIR}/dotest $@ ${.CURDIR}
f12 f13:
- @/bin/sh ./hextest $@
+ @/bin/sh ${.CURDIR}/hextest $@ ${.CURDIR}
f15 f16:
- @/bin/sh ./mtest $@
+ @/bin/sh ${.CURDIR}/mtest $@ ${.CURDIR}
f17:
- @/bin/sh ./mhtest $@
+ @/bin/sh ${.CURDIR}/mhtest $@ ${.CURDIR}
i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11:
- @/bin/sh ./itest $@
+ @/bin/sh ${.CURDIR}/itest $@ ${.CURDIR}
n1 n2 n3 n4 n5 n6 n7:
- @/bin/sh ./nattest $@
+ @/bin/sh ${.CURDIR}/nattest $@ ${.CURDIR}
-ni1 ni2 ni3 ni4 ni5:
- @/bin/sh ./natipftest $@
+ni1 ni2 ni4 ni5:
+ @/bin/sh ${.CURDIR}/natipftest $@ ${.CURDIR}
in1 in2 in3 in4:
- @/bin/sh ./intest $@
+ @/bin/sh ${.CURDIR}/intest $@ ${.CURDIR}
l1:
- @/bin/sh ./logtest $@
+ @/bin/sh ${.CURDIR}/logtest $@ ${.CURDIR}
ipv6.1 ipv6.2:
- @/bin/sh ./dotest6 $@
+ @/bin/sh ${.CURDIR}/dotest6 $@ ${.CURDIR}
clean:
/bin/rm -f f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f13 f12 f14 f15 f16 f17
diff -r 878a644043bb -r 24cb2639a5c5 regress/sys/kern/ipf/dotest
--- a/regress/sys/kern/ipf/dotest Mon May 13 06:33:09 2002 +0000
+++ b/regress/sys/kern/ipf/dotest Mon May 13 06:34:13 2002 +0000
@@ -1,4 +1,7 @@
#!/bin/sh
+#
+# $NetBSD: dotest,v 1.2 2002/05/13 06:34:14 martti Exp $
+#
if [ -f /usr/ucb/touch ] ; then
TOUCH=/usr/ucb/touch
else
@@ -11,15 +14,17 @@
fi
fi
echo "$1...";
+TESTDIR=$2
+[ -z "$2" ] && TESTDIR=${PWD}
/bin/cp /dev/null results/$1
( while read rule; do
- echo "$rule" | ../ipftest -br - -i input/$1 >> results/$1;
+ echo "$rule" | ipftest -br - -i ${TESTDIR}/input/$1 >> results/$1;
if [ $? -ne 0 ] ; then
exit 1;
fi
echo "--------" >> results/$1
-done ) < regress/$1
-cmp expected/$1 results/$1
+done ) < ${TESTDIR}/regress/$1
+cmp ${TESTDIR}/expected/$1 results/$1
status=$?
if [ $status = 0 ] ; then
$TOUCH $1
diff -r 878a644043bb -r 24cb2639a5c5 regress/sys/kern/ipf/expected/in1
--- a/regress/sys/kern/ipf/expected/in1 Mon May 13 06:33:09 2002 +0000
+++ b/regress/sys/kern/ipf/expected/in1 Mon May 13 06:34:13 2002 +0000
@@ -7,9 +7,9 @@
map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap tcp 10000:19999
map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap udp 20000:29999
map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap tcp/udp 30000:39999
-map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap auto
-map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap auto
-map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap auto
+map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap tcp auto
+map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap udp auto
+map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap tcp/udp auto
map ppp0 192.168.0.0/16 -> 0.0.0.0/32 proxy port ftp ftp/tcp
map ppp0 192.168.0.0/16 -> 0.0.0.0/32 proxy port 1010 ftp/tcp
map le0 0.0.0.0/0 -> 0.0.0.0/32 frag
diff -r 878a644043bb -r 24cb2639a5c5 regress/sys/kern/ipf/hextest
--- a/regress/sys/kern/ipf/hextest Mon May 13 06:33:09 2002 +0000
+++ b/regress/sys/kern/ipf/hextest Mon May 13 06:34:13 2002 +0000
@@ -1,4 +1,7 @@
#!/bin/sh
+#
+# $NetBSD: hextest,v 1.2 2002/05/13 06:34:14 martti Exp $
+#
if [ -f /usr/ucb/touch ] ; then
TOUCH=/usr/ucb/touch
else
@@ -11,15 +14,17 @@
fi
fi
echo "$1...";
+TESTDIR=$2
+[ -z "$2" ] && TESTDIR=${PWD}
/bin/cp /dev/null results/$1
( while read rule; do
- echo "$rule" | ../ipftest -br - -Hi input/$1 >> results/$1;
+ echo "$rule" | ipftest -br - -Hi ${TESTDIR}/input/$1 >> results/$1;
if [ $? -ne 0 ] ; then
exit 1;
fi
echo "--------" >> results/$1
-done ) < regress/$1
-cmp expected/$1 results/$1
+done ) < ${TESTDIR}/regress/$1
+cmp ${TESTDIR}/expected/$1 results/$1
status=$?
if [ $status = 0 ] ; then
$TOUCH $1
diff -r 878a644043bb -r 24cb2639a5c5 regress/sys/kern/ipf/intest
--- a/regress/sys/kern/ipf/intest Mon May 13 06:33:09 2002 +0000
+++ b/regress/sys/kern/ipf/intest Mon May 13 06:34:13 2002 +0000
@@ -1,4 +1,7 @@
#!/bin/sh
+#
+# $NetBSD: intest,v 1.2 2002/05/13 06:34:14 martti Exp $
+#
if [ -f /usr/ucb/touch ] ; then
TOUCH=/usr/ucb/touch
else
@@ -11,9 +14,11 @@
fi
fi
echo "$1...";
+TESTDIR=$2
+[ -z "$2" ] && TESTDIR=${PWD}
/bin/cp /dev/null results/$1
-../ipnat -nvf regress/$1 2>/dev/null > results/$1
-cmp expected/$1 results/$1
+ipnat -nvf ${TESTDIR}/regress/$1 2>/dev/null > results/$1
+cmp ${TESTDIR}/expected/$1 results/$1
status=$?
if [ $status = 0 ] ; then
$TOUCH $1
diff -r 878a644043bb -r 24cb2639a5c5 regress/sys/kern/ipf/itest
--- a/regress/sys/kern/ipf/itest Mon May 13 06:33:09 2002 +0000
+++ b/regress/sys/kern/ipf/itest Mon May 13 06:34:13 2002 +0000
@@ -1,4 +1,7 @@
#!/bin/sh
+#
+# $NetBSD: itest,v 1.2 2002/05/13 06:34:14 martti Exp $
+#
if [ -f /usr/ucb/touch ] ; then
TOUCH=/usr/ucb/touch
else
@@ -11,9 +14,11 @@
fi
fi
echo "$1...";
+TESTDIR=$2
+[ -z "$2" ] && TESTDIR=${PWD}
/bin/cp /dev/null results/$1
-../ipf -nvf regress/$1 2>/dev/null > results/$1
-cmp expected/$1 results/$1
+ipf -nvf ${TESTDIR}/regress/$1 2>/dev/null > results/$1
+cmp ${TESTDIR}/expected/$1 results/$1
status=$?
if [ $status = 0 ] ; then
$TOUCH $1
diff -r 878a644043bb -r 24cb2639a5c5 regress/sys/kern/ipf/logtest
--- a/regress/sys/kern/ipf/logtest Mon May 13 06:33:09 2002 +0000
+++ b/regress/sys/kern/ipf/logtest Mon May 13 06:34:13 2002 +0000
@@ -1,4 +1,7 @@
#!/bin/sh
+#
+# $NetBSD: logtest,v 1.2 2002/05/13 06:34:14 martti Exp $
+#
if [ -f /usr/ucb/touch ] ; then
TOUCH=/usr/ucb/touch
else
@@ -11,34 +14,36 @@
fi
fi
echo "$1...";
+TESTDIR=$2
+[ -z "$2" ] && TESTDIR=${PWD}
/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
+ echo $rule | ipftest -br - -Hi ${TESTDIR}/input/$1 -l logout > /dev/null
if [ $? -ne 0 ] ; then
/bin/rm -f logout
exit 1
fi
- TZ=GMT ../ipmon -P /dev/null -f logout >> results/$1
+ TZ=GMT ipmon -P /dev/null -f logout >> results/$1
echo "--------" >> results/$1
- TZ=GMT ../ipmon -P /dev/null -bf logout >> results/$1.b
+ TZ=GMT 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
-TZ=GMT ../ipmon -P /dev/null -f logout >> results/$1
+done ) < ${TESTDIR}/regress/$1
+ipftest -br ${TESTDIR}/regress/$1 -Hi ${TESTDIR}/input/$1 -l logout > /dev/null
+TZ=GMT ipmon -P /dev/null -f logout >> results/$1
echo "--------" >> results/$1
-TZ=GMT ../ipmon -P /dev/null -bf logout >> results/$1.b
+TZ=GMT ipmon -P /dev/null -bf logout >> results/$1.b
echo "--------" >> results/$1.b
-cmp expected/$1 results/$1
+cmp ${TESTDIR}/expected/$1 results/$1
status=$?
if [ $status -ne 0 ] ; then
exit $status
fi
-cmp expected/$1.b results/$1.b
+cmp ${TESTDIR}/expected/$1.b results/$1.b
status=$?
if [ $status -ne 0 ] ; then
exit $status
diff -r 878a644043bb -r 24cb2639a5c5 regress/sys/kern/ipf/mhtest
--- a/regress/sys/kern/ipf/mhtest Mon May 13 06:33:09 2002 +0000
+++ b/regress/sys/kern/ipf/mhtest Mon May 13 06:34:13 2002 +0000
@@ -1,4 +1,7 @@
#!/bin/sh
+#
+# $NetBSD: mhtest,v 1.2 2002/05/13 06:34:15 martti Exp $
+#
# multiple rules at the same time
if [ -f /usr/ucb/touch ] ; then
@@ -13,21 +16,23 @@
fi
fi
echo "$1...";
+TESTDIR=$2
+[ -z "$2" ] && TESTDIR=${PWD}
/bin/cp /dev/null results/$1
-../ipftest -br regress/$1 -Hi input/$1 > results/$1
+ipftest -br ${TESTDIR}/regress/$1 -Hi ${TESTDIR}/input/$1 > results/$1
if [ $? -ne 0 ] ; then
exit 1
Home |
Main Index |
Thread Index |
Old Index