summaryrefslogtreecommitdiff
path: root/regress/sbin/pfctl
diff options
context:
space:
mode:
authorCamiel Dobbelaar <camield@cvs.openbsd.org>2005-05-26 20:22:30 +0000
committerCamiel Dobbelaar <camield@cvs.openbsd.org>2005-05-26 20:22:30 +0000
commitc63407bd41ca3772f9ab0556f51f1dfcd785f67c (patch)
treeb9f50a7f92c62fc2f9c41f8ccc603e5703510513 /regress/sbin/pfctl
parent07f6b5d7d3c29c51512d62bcdaff737f7cb17b75 (diff)
nat pass log tests
Diffstat (limited to 'regress/sbin/pfctl')
-rw-r--r--regress/sbin/pfctl/Makefile4
-rw-r--r--regress/sbin/pfctl/pf80.in9
-rw-r--r--regress/sbin/pfctl/pf80.ok7
-rw-r--r--regress/sbin/pfctl/pf80.optimized28
-rw-r--r--regress/sbin/pfctl/pfail51.in3
-rw-r--r--regress/sbin/pfctl/pfail51.ok3
6 files changed, 51 insertions, 3 deletions
diff --git a/regress/sbin/pfctl/Makefile b/regress/sbin/pfctl/Makefile
index c03e6709a0b..477d4107530 100644
--- a/regress/sbin/pfctl/Makefile
+++ b/regress/sbin/pfctl/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.186 2005/04/22 11:08:32 camield Exp $
+# $OpenBSD: Makefile,v 1.187 2005/05/26 20:22:29 camield Exp $
# TARGETS
# pf: feed pfNN.in through pfctl and check wether the output matches pfNN.ok
@@ -16,7 +16,7 @@ PFTESTS+=28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
PFTESTS+=51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
PFTESTS+=74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
PFFAIL=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 23 24 25 27
-PFFAIL+=28 29 30 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
+PFFAIL+=28 29 30 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
PFSIMPLE=1 2
PFSETUP=1 2 3 4
PFLOAD=1 2 3 4 5 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 24 25 26 27 28 29
diff --git a/regress/sbin/pfctl/pf80.in b/regress/sbin/pfctl/pf80.in
index 6913dd36055..a4471b8c193 100644
--- a/regress/sbin/pfctl/pf80.in
+++ b/regress/sbin/pfctl/pf80.in
@@ -1,4 +1,11 @@
nat pass on lo0 from 10/8 to 172.16/16 -> 172.16.0.1
rdr pass on lo0 proto tcp from any to 1.2.3.4 port 80 -> 127.0.0.1 port 8080
+binat pass on lo0 from 10/8 to 11/8 -> 12/8
- \ No newline at end of file
+nat pass log on lo0 from 10/8 to 172.16/16 -> 172.16.0.1
+rdr pass log on lo0 proto tcp from any to 1.2.3.4 port 80 -> 127.0.0.1 port 8080
+binat pass log on lo0 from 10/8 to 11/8 -> 12/8
+
+nat pass log-all on lo0 from 10/8 to 172.16/16 -> 172.16.0.1
+rdr pass log-all on lo0 proto tcp from any to 1.2.3.4 port 80 -> 127.0.0.1 port 8080
+binat pass log-all on lo0 from 10/8 to 11/8 -> 12/8
diff --git a/regress/sbin/pfctl/pf80.ok b/regress/sbin/pfctl/pf80.ok
index 0748c539a21..8ebbfb693d3 100644
--- a/regress/sbin/pfctl/pf80.ok
+++ b/regress/sbin/pfctl/pf80.ok
@@ -1,2 +1,9 @@
nat pass on lo0 inet from 10.0.0.0/8 to 172.16.0.0/16 -> 172.16.0.1
rdr pass on lo0 inet proto tcp from any to 1.2.3.4 port = www -> 127.0.0.1 port 8080
+binat pass on lo0 inet from 10.0.0.0/8 to 11.0.0.0/8 -> 12.0.0.0/8
+nat pass log on lo0 inet from 10.0.0.0/8 to 172.16.0.0/16 -> 172.16.0.1
+rdr pass log on lo0 inet proto tcp from any to 1.2.3.4 port = www -> 127.0.0.1 port 8080
+binat pass log on lo0 inet from 10.0.0.0/8 to 11.0.0.0/8 -> 12.0.0.0/8
+nat pass log-all on lo0 inet from 10.0.0.0/8 to 172.16.0.0/16 -> 172.16.0.1
+rdr pass log-all on lo0 inet proto tcp from any to 1.2.3.4 port = www -> 127.0.0.1 port 8080
+binat pass log-all on lo0 inet from 10.0.0.0/8 to 11.0.0.0/8 -> 12.0.0.0/8
diff --git a/regress/sbin/pfctl/pf80.optimized b/regress/sbin/pfctl/pf80.optimized
index 410125072c1..cd48bc92f2e 100644
--- a/regress/sbin/pfctl/pf80.optimized
+++ b/regress/sbin/pfctl/pf80.optimized
@@ -2,7 +2,35 @@
[ Skip steps: i=end d=end f=end p=end sa=end sp=end da=end dp=end ]
[ queue: qname= qid=0 pqname= pqid=0 ]
[ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
+@1 nat pass log on lo0 inet from 10.0.0.0/8 to 172.16.0.0/16 -> 172.16.0.1
+ [ Skip steps: i=end d=end f=end p=end sa=end sp=end da=end dp=end ]
+ [ queue: qname= qid=0 pqname= pqid=0 ]
+ [ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
+@2 nat pass log-all on lo0 inet from 10.0.0.0/8 to 172.16.0.0/16 -> 172.16.0.1
+ [ Skip steps: i=end d=end f=end p=end sa=end sp=end da=end dp=end ]
+ [ queue: qname= qid=0 pqname= pqid=0 ]
+ [ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
@0 rdr pass on lo0 inet proto tcp from any to 1.2.3.4 port = www -> 127.0.0.1 port 8080
[ Skip steps: i=end d=end f=end p=end sa=end sp=end da=end dp=end ]
[ queue: qname= qid=0 pqname= pqid=0 ]
[ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
+@1 rdr pass log on lo0 inet proto tcp from any to 1.2.3.4 port = www -> 127.0.0.1 port 8080
+ [ Skip steps: i=end d=end f=end p=end sa=end sp=end da=end dp=end ]
+ [ queue: qname= qid=0 pqname= pqid=0 ]
+ [ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
+@2 rdr pass log-all on lo0 inet proto tcp from any to 1.2.3.4 port = www -> 127.0.0.1 port 8080
+ [ Skip steps: i=end d=end f=end p=end sa=end sp=end da=end dp=end ]
+ [ queue: qname= qid=0 pqname= pqid=0 ]
+ [ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
+@0 binat pass on lo0 inet from 10.0.0.0/8 to 11.0.0.0/8 -> 12.0.0.0/8
+ [ Skip steps: i=end d=end f=end p=end sa=end sp=end da=end dp=end ]
+ [ queue: qname= qid=0 pqname= pqid=0 ]
+ [ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
+@1 binat pass log on lo0 inet from 10.0.0.0/8 to 11.0.0.0/8 -> 12.0.0.0/8
+ [ Skip steps: i=end d=end f=end p=end sa=end sp=end da=end dp=end ]
+ [ queue: qname= qid=0 pqname= pqid=0 ]
+ [ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
+@2 binat pass log-all on lo0 inet from 10.0.0.0/8 to 11.0.0.0/8 -> 12.0.0.0/8
+ [ Skip steps: i=end d=end f=end p=end sa=end sp=end da=end dp=end ]
+ [ queue: qname= qid=0 pqname= pqid=0 ]
+ [ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
diff --git a/regress/sbin/pfctl/pfail51.in b/regress/sbin/pfctl/pfail51.in
new file mode 100644
index 00000000000..e0bd2806481
--- /dev/null
+++ b/regress/sbin/pfctl/pfail51.in
@@ -0,0 +1,3 @@
+no nat pass all -> 127.0.0.1
+no rdr pass all -> 127.0.0.1
+no binat pass from 10/8 to 11/8 -> 12/8
diff --git a/regress/sbin/pfctl/pfail51.ok b/regress/sbin/pfctl/pfail51.ok
new file mode 100644
index 00000000000..31ca3a2c76f
--- /dev/null
+++ b/regress/sbin/pfctl/pfail51.ok
@@ -0,0 +1,3 @@
+stdin:1: "pass" not valid with "no"
+stdin:2: "pass" not valid with "no"
+stdin:3: "pass" not valid with "no"