diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2002-06-09 02:51:46 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2002-06-09 02:51:46 +0000 |
commit | 8b822fe91b5cc5f7f3ce8220c9295a29b77a8a87 (patch) | |
tree | d208b451968d0a16774664710fb92bcbfbbc9700 /regress | |
parent | 6d9949dcf6f61043d12022336c125034c0fab9d7 (diff) |
Add regression tests for rdr list processing
Diffstat (limited to 'regress')
-rw-r--r-- | regress/sbin/pfctl/Makefile | 4 | ||||
-rw-r--r-- | regress/sbin/pfctl/rdr1.in | 10 | ||||
-rw-r--r-- | regress/sbin/pfctl/rdr1.ok | 13 |
3 files changed, 24 insertions, 3 deletions
diff --git a/regress/sbin/pfctl/Makefile b/regress/sbin/pfctl/Makefile index 31567648579..15ade1d072a 100644 --- a/regress/sbin/pfctl/Makefile +++ b/regress/sbin/pfctl/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.15 2002/06/08 09:43:58 kjell Exp $ +# $OpenBSD: Makefile,v 1.16 2002/06/09 02:51:45 kjell Exp $ PFTESTS=1 2 3 4 5 6 7 8 9 10 11 12 13 14 PFFAIL=1 2 3 4 5 6 7 8 @@ -22,7 +22,7 @@ pf${n}: .endfor -NATTESTS=binat1 nat1 +NATTESTS=binat1 nat1 rdr1 .for n in ${NATTESTS} REGRESSTARGETS+=${n} diff --git a/regress/sbin/pfctl/rdr1.in b/regress/sbin/pfctl/rdr1.in index 1eb062750cd..2a261c24d9c 100644 --- a/regress/sbin/pfctl/rdr1.in +++ b/regress/sbin/pfctl/rdr1.in @@ -1 +1,9 @@ -rdr on ne0 proto tcp from any to 1.2.3.4/32 port 2222 -> 10.0.0.10 port 22 +EVIL = "lo0" +GOOD = "{ lo0, lo1 }" +GOOD_NET = "{ 127.0.0.0/24, 10.0.1.0/24 }" +DEST_NET = "{ 1.2.3.4/25, 2.4.6.8/30 }" + +rdr on lo0 proto tcp from any to 1.2.3.4/32 port 2222 -> 10.0.0.10 port 22 + +# Test list processing +rdr on $GOOD proto tcp from $GOOD_NET to $DEST_NET port 21 -> 127.0.0.1 port 8021 diff --git a/regress/sbin/pfctl/rdr1.ok b/regress/sbin/pfctl/rdr1.ok new file mode 100644 index 00000000000..206b7492f33 --- /dev/null +++ b/regress/sbin/pfctl/rdr1.ok @@ -0,0 +1,13 @@ +EVIL = lo0 +GOOD = { lo0, lo1 } +GOOD_NET = { 127.0.0.0/24, 10.0.1.0/24 } +DEST_NET = { 1.2.3.4/25, 2.4.6.8/30 } +rdr on lo0 inet proto tcp from any to 1.2.3.4 port 2222 -> 10.0.0.10 port 22 +rdr on lo1 inet proto tcp from 10.0.1.0/24 to 2.4.6.8/30 port 21 -> 127.0.0.1 port 8021 +rdr on lo1 inet proto tcp from 10.0.1.0/24 to 1.2.3.4/25 port 21 -> 127.0.0.1 port 8021 +rdr on lo1 inet proto tcp from 127.0.0.0/24 to 2.4.6.8/30 port 21 -> 127.0.0.1 port 8021 +rdr on lo1 inet proto tcp from 127.0.0.0/24 to 1.2.3.4/25 port 21 -> 127.0.0.1 port 8021 +rdr on lo0 inet proto tcp from 10.0.1.0/24 to 2.4.6.8/30 port 21 -> 127.0.0.1 port 8021 +rdr on lo0 inet proto tcp from 10.0.1.0/24 to 1.2.3.4/25 port 21 -> 127.0.0.1 port 8021 +rdr on lo0 inet proto tcp from 127.0.0.0/24 to 2.4.6.8/30 port 21 -> 127.0.0.1 port 8021 +rdr on lo0 inet proto tcp from 127.0.0.0/24 to 1.2.3.4/25 port 21 -> 127.0.0.1 port 8021 |