summaryrefslogtreecommitdiff
path: root/regress/sbin/pfctl
diff options
context:
space:
mode:
authorjasoni <jasoni@cvs.openbsd.org>2001-09-06 18:45:14 +0000
committerjasoni <jasoni@cvs.openbsd.org>2001-09-06 18:45:14 +0000
commit0c52404ed4af04d0ad6d217dcfccea0defa0721d (patch)
tree7261a0d941ee84e3e325523feb4391cbcfdde281 /regress/sbin/pfctl
parentf3ea1e8fdf9dc8f33844b588e6c20e09fe96e8e2 (diff)
add test for binat
Diffstat (limited to 'regress/sbin/pfctl')
-rw-r--r--regress/sbin/pfctl/Makefile13
-rw-r--r--regress/sbin/pfctl/binat1.in12
-rw-r--r--regress/sbin/pfctl/binat1.ok8
3 files changed, 31 insertions, 2 deletions
diff --git a/regress/sbin/pfctl/Makefile b/regress/sbin/pfctl/Makefile
index 7f01d0d1f2c..d756fd597fe 100644
--- a/regress/sbin/pfctl/Makefile
+++ b/regress/sbin/pfctl/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.7 2001/09/04 13:58:49 dhartmei Exp $
+# $OpenBSD: Makefile,v 1.8 2001/09/06 18:45:13 jasoni Exp $
NOMAN=
NOPROG=
@@ -21,7 +21,16 @@ pf${n}.out:
CLEANFILES+=pf${n}.out
.endfor
-regress: pfail1
+binat1: binat1.out
+ @cmp -s ${.CURDIR}/binat1.ok binat1.out || \
+ echo 'test binat1 output does not match expected output'
+
+binat1.out:
+ pfctl -nv -N - < ${.CURDIR}/binat1.in > $@
+
+CLEANFILES+=binat1.out
+
+regress: pfail1 binat1
.PHONY: regress pfail1
.include <bsd.prog.mk>
diff --git a/regress/sbin/pfctl/binat1.in b/regress/sbin/pfctl/binat1.in
new file mode 100644
index 00000000000..a9ee3be7d8b
--- /dev/null
+++ b/regress/sbin/pfctl/binat1.in
@@ -0,0 +1,12 @@
+# test binat
+
+binat on fxp0 from 192.168.1.1 to any -> 10.0.0.1
+binat on fxp0 proto tcp from 192.168.1.2 to any -> 10.0.0.2
+binat on fxp0 proto udp from 192.168.1.3 to any -> 10.0.0.3
+binat on fxp0 proto icmp from 192.168.1.4 to any -> 10.0.0.4
+
+binat on fxp0 from 192.168.1.5 to 172.16.1.1 -> 10.0.0.5
+binat on fxp0 from 192.168.1.6 to 172.16.1.2/32 -> 10.0.0.6
+binat on fxp0 from 192.168.1.7 to 172.16.2.0/24 -> 10.0.0.7
+
+binat on fxp0 from 192.168.1.8 to ! 172.17.0.0/16 -> 10.0.0.8
diff --git a/regress/sbin/pfctl/binat1.ok b/regress/sbin/pfctl/binat1.ok
new file mode 100644
index 00000000000..390c11fda26
--- /dev/null
+++ b/regress/sbin/pfctl/binat1.ok
@@ -0,0 +1,8 @@
+@binat on fxp0 from 192.168.1.1 to any -> 10.0.0.1
+@binat on fxp0 proto tcp from 192.168.1.2 to any -> 10.0.0.2
+@binat on fxp0 proto udp from 192.168.1.3 to any -> 10.0.0.3
+@binat on fxp0 proto icmp from 192.168.1.4 to any -> 10.0.0.4
+@binat on fxp0 from 192.168.1.5 to 172.16.1.1 -> 10.0.0.5
+@binat on fxp0 from 192.168.1.6 to 172.16.1.2 -> 10.0.0.6
+@binat on fxp0 from 192.168.1.7 to 172.16.2.0/255.255.255.0 -> 10.0.0.7
+@binat on fxp0 from 192.168.1.8 to ! 172.17.0.0/255.255.0.0 -> 10.0.0.8