summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2011-07-27 10:40:06 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2011-07-27 10:40:06 +0000
commit5b0ff694132da6adf809f0a7fb35bf0ea41300c7 (patch)
tree66986bdb6eb2eb07e9d8d90b781ec5bc8d25fbce
parenta812c9e739517995c9311b5c89ac84c1f52998ba (diff)
Update regress tests for weighted round-robin (and recent pool bugfix)
-rw-r--r--regress/sbin/pfctl/Makefile4
-rw-r--r--regress/sbin/pfctl/pf46.loaded4
-rw-r--r--regress/sbin/pfctl/pf46.ok4
-rw-r--r--regress/sbin/pfctl/pf46.optimized4
-rw-r--r--regress/sbin/pfctl/pfr13.in6
-rw-r--r--regress/sbin/pfctl/pfr13.ok53
-rw-r--r--regress/sbin/pfctl/pfr14.in13
-rw-r--r--regress/sbin/pfctl/pfr14.ok81
-rw-r--r--regress/sbin/pfctl/pfr15.in8
-rw-r--r--regress/sbin/pfctl/pfr15.ok24
10 files changed, 188 insertions, 13 deletions
diff --git a/regress/sbin/pfctl/Makefile b/regress/sbin/pfctl/Makefile
index 0fb1483ea07..18479488c7b 100644
--- a/regress/sbin/pfctl/Makefile
+++ b/regress/sbin/pfctl/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.217 2011/07/24 01:22:11 mcbride Exp $
+# $OpenBSD: Makefile,v 1.218 2011/07/27 10:40:05 mcbride Exp $
# TARGETS
# pf: feed pfNN.in through pfctl and check whether the output matches pfNN.ok
@@ -29,7 +29,7 @@ PFALTQ=1 2 3 4 5 6 7 8 9 10 11 12 13 14
# PFLOAD+=33 35 37 42 43 45 51 58 59 62 63 64
# only testing parser, load test would be useless
# PFLOAD+=6 22 41 50 52 53 55 57 83 85 86
-PFTABLE=1 2 3 4 5 6 7 8 9 10 11 12 13
+PFTABLE=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
PFOPT=1 2 3 6
PFIF2IP=1 2 3
PFCHKSUM=1 2 3
diff --git a/regress/sbin/pfctl/pf46.loaded b/regress/sbin/pfctl/pf46.loaded
index 98b2fe3f488..da5a3115506 100644
--- a/regress/sbin/pfctl/pf46.loaded
+++ b/regress/sbin/pfctl/pf46.loaded
@@ -10,7 +10,7 @@
[ Skip steps: i=end d=end f=end p=end sa=end da=end sp=end dp=end ]
[ queue: qname= qid=0 pqname= pqid=0 ]
[ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
-@3 pass out on lo0 inet all flags S/SA dup-to 127.0.0.0/24@pflog0
+@3 pass out on lo0 inet all flags S/SA dup-to 127.0.0.0/24@pflog0 random
[ Skip steps: i=end d=end f=end p=end sa=end da=end sp=end dp=end ]
[ queue: qname= qid=0 pqname= pqid=0 ]
[ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
@@ -22,7 +22,7 @@
[ Skip steps: i=end d=end f=end p=end sa=end da=end sp=end dp=end ]
[ queue: qname= qid=0 pqname= pqid=0 ]
[ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
-@6 pass in on lo0 inet all flags S/SA dup-to 127.0.0.0/24@pflog0
+@6 pass in on lo0 inet all flags S/SA dup-to 127.0.0.0/24@pflog0 round-robin
[ Skip steps: i=end r=end d=end f=end p=end sa=end da=end sp=end dp=end ]
[ queue: qname= qid=0 pqname= pqid=0 ]
[ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
diff --git a/regress/sbin/pfctl/pf46.ok b/regress/sbin/pfctl/pf46.ok
index 37cb299ef5b..5daee273a36 100644
--- a/regress/sbin/pfctl/pf46.ok
+++ b/regress/sbin/pfctl/pf46.ok
@@ -3,7 +3,7 @@ table <__automatic_1> const { 127.0.0.1@pflog0 127.0.0.2@pflog0 }
pass in on lo0 inet all flags S/SA route-to <__automatic_0> round-robin
pass out on lo0 inet all flags S/SA route-to <__automatic_1> round-robin
pass in on lo0 inet all flags S/SA route-to 127.0.0.0/24@pflog0 bitmask
-pass out on lo0 inet all flags S/SA dup-to 127.0.0.0/24@pflog0
+pass out on lo0 inet all flags S/SA dup-to 127.0.0.0/24@pflog0 random
pass in on lo0 inet all flags S/SA reply-to 127.0.0.0/28@pflog0
pass out on lo0 inet all flags S/SA route-to 127.0.0.0/24@pflog0 source-hash 0x4da8e393fd22f577426cfdf7fe52d3b0
-pass in on lo0 inet all flags S/SA dup-to 127.0.0.0/24@pflog0
+pass in on lo0 inet all flags S/SA dup-to 127.0.0.0/24@pflog0 round-robin
diff --git a/regress/sbin/pfctl/pf46.optimized b/regress/sbin/pfctl/pf46.optimized
index 98b2fe3f488..da5a3115506 100644
--- a/regress/sbin/pfctl/pf46.optimized
+++ b/regress/sbin/pfctl/pf46.optimized
@@ -10,7 +10,7 @@
[ Skip steps: i=end d=end f=end p=end sa=end da=end sp=end dp=end ]
[ queue: qname= qid=0 pqname= pqid=0 ]
[ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
-@3 pass out on lo0 inet all flags S/SA dup-to 127.0.0.0/24@pflog0
+@3 pass out on lo0 inet all flags S/SA dup-to 127.0.0.0/24@pflog0 random
[ Skip steps: i=end d=end f=end p=end sa=end da=end sp=end dp=end ]
[ queue: qname= qid=0 pqname= pqid=0 ]
[ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
@@ -22,7 +22,7 @@
[ Skip steps: i=end d=end f=end p=end sa=end da=end sp=end dp=end ]
[ queue: qname= qid=0 pqname= pqid=0 ]
[ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
-@6 pass in on lo0 inet all flags S/SA dup-to 127.0.0.0/24@pflog0
+@6 pass in on lo0 inet all flags S/SA dup-to 127.0.0.0/24@pflog0 round-robin
[ Skip steps: i=end r=end d=end f=end p=end sa=end da=end sp=end dp=end ]
[ queue: qname= qid=0 pqname= pqid=0 ]
[ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ]
diff --git a/regress/sbin/pfctl/pfr13.in b/regress/sbin/pfctl/pfr13.in
index 6edd6e2453e..c0c310f7eb5 100644
--- a/regress/sbin/pfctl/pfr13.in
+++ b/regress/sbin/pfctl/pfr13.in
@@ -3,9 +3,13 @@ pass load table <regress> persist file "DIR/pfr.addrs1"
pass show
pass load table <regress> persist file "DIR/pfr.addrs1" file "DIR/pfr.addrs2"
pass show
+pass load table <regress> persist file "DIR/pfr.addrs3"
+pass show
+pass load table <regress> persist file "DIR/pfr.addrs1" file "DIR/pfr.addrs3"
+pass show
pass load table <regress> persist { !127.0.0.1 } file "DIR/pfr.addrs1"
pass show
pass load table <regress> persist file "DIR/pfr.addrs1" { 3.3.3.3 }
pass show
-pass load table <regress> persist { 11/8 } file "DIR/pfr.addrs1" { !12/8 }
+pass load table <regress> persist { 11/8 } file "DIR/pfr.addrs3" { !12/8 }
pass show
diff --git a/regress/sbin/pfctl/pfr13.ok b/regress/sbin/pfctl/pfr13.ok
index c79a00cc2a3..e825f91222e 100644
--- a/regress/sbin/pfctl/pfr13.ok
+++ b/regress/sbin/pfctl/pfr13.ok
@@ -332,6 +332,48 @@
fe80::/24
fe80::/16
fe80::1
+# pass load table <regress> persist file "DIR/pfr.addrs3"
+# pass show
+ 1.1.1.1
+ 2.2.2.2
+ 3.3.3.3
+ Weight: 6
+ 10.0.0.0/8
+ 127.0.0.0/24
+ 127.0.0.0/8
+ 127.0.0.1
+ 172.16.0.0/12
+ 192.168.0.0/16
+ ::/24
+ ::1
+ ::4
+ Weight: 6
+ ::5
+ 2000::1
+ fe80::/24
+ fe80::/16
+ fe80::1
+# pass load table <regress> persist file "DIR/pfr.addrs1" file "DIR/pfr.addrs3"
+# pass show
+ 1.1.1.1
+ 2.2.2.2
+ 3.3.3.3
+ Weight: 6
+ 10.0.0.0/8
+ 127.0.0.0/24
+ 127.0.0.0/8
+ 127.0.0.1
+ 172.16.0.0/12
+ 192.168.0.0/16
+ ::/24
+ ::1
+ ::4
+ Weight: 6
+ ::5
+ 2000::1
+ fe80::/24
+ fe80::/16
+ fe80::1
# pass load table <regress> persist { !127.0.0.1 } file "DIR/pfr.addrs1"
# pass show
1.1.1.1
@@ -367,10 +409,11 @@
fe80::/24
fe80::/16
fe80::1
-# pass load table <regress> persist { 11/8 } file "DIR/pfr.addrs1" { !12/8 }
+# pass load table <regress> persist { 11/8 } file "DIR/pfr.addrs3" { !12/8 }
# pass show
1.1.1.1
2.2.2.2
+ 3.3.3.3
10.0.0.0/8
11.0.0.0/8
!12.0.0.0/8
@@ -381,6 +424,8 @@
192.168.0.0/16
::/24
::1
+ ::4
+ Weight: 6
::5
2000::1
fe80::/24
@@ -389,7 +434,7 @@
# kill
1 tables deleted.
rules cleared
-ktable: 8 allocated, 8 released, 0 leaked.
-pfrke_plain: 377 allocated, 377 released, 0 leaked.
+ktable: 10 allocated, 10 released, 0 leaked.
+pfrke_plain: 397 allocated, 397 released, 0 leaked.
pfrke_route: 0 allocated, 0 released, 0 leaked.
-pfrke_cost: 0 allocated, 0 released, 0 leaked.
+pfrke_cost: 16 allocated, 16 released, 0 leaked.
diff --git a/regress/sbin/pfctl/pfr14.in b/regress/sbin/pfctl/pfr14.in
new file mode 100644
index 00000000000..2b806e6b60d
--- /dev/null
+++ b/regress/sbin/pfctl/pfr14.in
@@ -0,0 +1,13 @@
+# loading weights via file
+pass add 1.1.1.1 1.1.1.2 weight 1 1.1.1.3 weight 5
+pass show
+pass delete 1.1.1.1 weight 1 1.1.1.2 1.1.1.4
+pass show
+pass replace 1.1.1.1 1.1.1.2 weight 5 1.1.1.3 weight 1
+pass show
+pass test 1.1.1.1 1.1.1.2 1.1.1.3
+fail test 1.1.1.1 1.1.1.2 1.1.1.4
+pass zero
+pass show
+pass flush
+pass list
diff --git a/regress/sbin/pfctl/pfr14.ok b/regress/sbin/pfctl/pfr14.ok
new file mode 100644
index 00000000000..69fa1ee394e
--- /dev/null
+++ b/regress/sbin/pfctl/pfr14.ok
@@ -0,0 +1,81 @@
+# create
+# pass add -n 1.1.1.1 1.1.1.2 weight 1 1.1.1.3 weight 5
+3/3 addresses added (dummy).
+# pass add -nf-
+3/3 addresses added (dummy).
+# pass add -nqv 1.1.1.1 1.1.1.2 weight 1 1.1.1.3 weight 5
+A 1.1.1.1
+A 1.1.1.2
+A 1.1.1.3
+# pass add -nqvv 1.1.1.1 1.1.1.2 weight 1 1.1.1.3 weight 5
+A 1.1.1.1
+A 1.1.1.2
+A 1.1.1.3
+# pass add 1.1.1.1 1.1.1.2 weight 1 1.1.1.3 weight 5
+3/3 addresses added.
+# pass show
+ 1.1.1.1
+ 1.1.1.2
+ Weight: 1
+ 1.1.1.3
+ Weight: 5
+# pass delete -n 1.1.1.1 weight 1 1.1.1.2 1.1.1.4
+2/3 addresses deleted (dummy).
+# pass delete -nf-
+2/3 addresses deleted (dummy).
+# pass delete -nqv 1.1.1.1 weight 1 1.1.1.2 1.1.1.4
+D 1.1.1.1
+D 1.1.1.2
+# pass delete -nqvv 1.1.1.1 weight 1 1.1.1.2 1.1.1.4
+ 1.1.1.4
+D 1.1.1.1
+D 1.1.1.2
+# pass delete 1.1.1.1 weight 1 1.1.1.2 1.1.1.4
+2/3 addresses deleted.
+# pass show
+ 1.1.1.3
+ Weight: 5
+# pass replace -n 1.1.1.1 1.1.1.2 weight 5 1.1.1.3 weight 1
+2 addresses added (dummy).
+# pass replace -nf-
+2 addresses added (dummy).
+# pass replace -nqv 1.1.1.1 1.1.1.2 weight 5 1.1.1.3 weight 1
+A 1.1.1.1
+A 1.1.1.2
+# pass replace -nqvv 1.1.1.1 1.1.1.2 weight 5 1.1.1.3 weight 1
+ 1.1.1.3
+A 1.1.1.1
+A 1.1.1.2
+# pass replace 1.1.1.1 1.1.1.2 weight 5 1.1.1.3 weight 1
+2 addresses added.
+# pass show
+ 1.1.1.1
+ 1.1.1.2
+ Weight: 5
+ 1.1.1.3
+ Weight: 5
+# pass test 1.1.1.1 1.1.1.2 1.1.1.3
+3/3 addresses match.
+# fail test 1.1.1.1 1.1.1.2 1.1.1.4
+2/3 addresses match.
+# pass zero
+1 table/stats cleared.
+# pass show
+ 1.1.1.1
+ 1.1.1.2
+ Weight: 5
+ 1.1.1.3
+ Weight: 5
+# pass flush
+3 addresses deleted.
+# pass list
+regress
+# pass list -v
+-pa---- regress regress
+# kill
+1 tables deleted.
+rules cleared
+ktable: 13 allocated, 13 released, 0 leaked.
+pfrke_plain: 10 allocated, 10 released, 0 leaked.
+pfrke_route: 0 allocated, 0 released, 0 leaked.
+pfrke_cost: 15 allocated, 15 released, 0 leaked.
diff --git a/regress/sbin/pfctl/pfr15.in b/regress/sbin/pfctl/pfr15.in
new file mode 100644
index 00000000000..1d230484717
--- /dev/null
+++ b/regress/sbin/pfctl/pfr15.in
@@ -0,0 +1,8 @@
+# weight loading from pf.conf
+pass list
+pass load table <regress> { 1.2.3.4 1.2.3.4 weight 1 4.3.2.1 weight 5 } persist
+pass show
+pass load table <regress> persist
+pass show
+pass load table <regress> persist {}
+pass show
diff --git a/regress/sbin/pfctl/pfr15.ok b/regress/sbin/pfctl/pfr15.ok
new file mode 100644
index 00000000000..59fc0c22a88
--- /dev/null
+++ b/regress/sbin/pfctl/pfr15.ok
@@ -0,0 +1,24 @@
+# create
+# pass list
+regress
+# pass list -v
+-pa---- regress regress
+# pass load table <regress> { 1.2.3.4 1.2.3.4 weight 1 4.3.2.1 weight 5 } persist
+# pass show
+ 1.2.3.4
+ 4.3.2.1
+ Weight: 5
+# pass load table <regress> persist
+# pass show
+ 1.2.3.4
+ 4.3.2.1
+ Weight: 5
+# pass load table <regress> persist {}
+# pass show
+# kill
+1 tables deleted.
+rules cleared
+ktable: 6 allocated, 6 released, 0 leaked.
+pfrke_plain: 1 allocated, 1 released, 0 leaked.
+pfrke_route: 0 allocated, 0 released, 0 leaked.
+pfrke_cost: 1 allocated, 1 released, 0 leaked.