summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2011-07-24 02:22:53 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2011-07-24 02:22:53 +0000
commit4a425522d72a6b0e390b2f8323efaa2a18675701 (patch)
treebf235f3399c5564720e548d91295c147ac40cc78
parente24140430dfd46423b9bc028c90ae6e163c5f02d (diff)
Handle 'show' specially to prepare for regress tests on pfrke_route
and pfrke_cost entries. Output becomes sorted in table order.
-rw-r--r--regress/sbin/pfctl/pfr.exec4
-rw-r--r--regress/sbin/pfctl/pfr13.ok34
-rw-r--r--regress/sbin/pfctl/pfr4.ok54
-rw-r--r--regress/sbin/pfctl/pfr5.ok220
-rw-r--r--regress/sbin/pfctl/pfr6.ok14
5 files changed, 165 insertions, 161 deletions
diff --git a/regress/sbin/pfctl/pfr.exec b/regress/sbin/pfctl/pfr.exec
index 4157147f90f..701eebf8416 100644
--- a/regress/sbin/pfctl/pfr.exec
+++ b/regress/sbin/pfctl/pfr.exec
@@ -57,6 +57,10 @@ for LINE in `sed -e "s/ /_/g" $1`; do
rule)
echo $ARGS | pfctl -a $A -f- 2>&1 || exit 1
;;
+ show)
+ pfctl -qvv -a $A -t regress -T $CMD $ARGS 2>&1 | \
+ grep -v "Cleared:"
+ ;;
*)
pfctl -a $A -t regress -T $CMD $ARGS 2>&1 | sort \
|| exit 1
diff --git a/regress/sbin/pfctl/pfr13.ok b/regress/sbin/pfctl/pfr13.ok
index 6c119251381..c79a00cc2a3 100644
--- a/regress/sbin/pfctl/pfr13.ok
+++ b/regress/sbin/pfctl/pfr13.ok
@@ -2,19 +2,19 @@
# pass load table <regress> persist file "DIR/pfr.addrs1"
# pass show
1.1.1.1
+ 2.2.2.2
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
- 2.2.2.2
- 2000::1
::/24
::1
::5
- fe80::/16
+ 2000::1
fe80::/24
+ fe80::/16
fe80::1
# pass load table <regress> persist file "DIR/pfr.addrs1" file "DIR/pfr.addrs2"
# pass show
@@ -318,74 +318,74 @@
1.3.9.7
1.3.9.8
1.3.9.9
+ 2.2.2.2
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
- 2.2.2.2
- 2000::1
::/24
::1
::5
- fe80::/16
+ 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
+ 2.2.2.2
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
- 2.2.2.2
- 2000::1
::/24
::1
::5
- fe80::/16
+ 2000::1
fe80::/24
+ fe80::/16
fe80::1
# pass load table <regress> persist file "DIR/pfr.addrs1" { 3.3.3.3 }
# pass show
1.1.1.1
+ 2.2.2.2
+ 3.3.3.3
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
- 2.2.2.2
- 2000::1
- 3.3.3.3
::/24
::1
::5
- fe80::/16
+ 2000::1
fe80::/24
+ fe80::/16
fe80::1
# pass load table <regress> persist { 11/8 } file "DIR/pfr.addrs1" { !12/8 }
# pass show
1.1.1.1
+ 2.2.2.2
10.0.0.0/8
11.0.0.0/8
+ !12.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
- 2.2.2.2
- 2000::1
::/24
::1
::5
- fe80::/16
+ 2000::1
fe80::/24
+ fe80::/16
fe80::1
- !12.0.0.0/8
# kill
1 tables deleted.
rules cleared
diff --git a/regress/sbin/pfctl/pfr4.ok b/regress/sbin/pfctl/pfr4.ok
index 4d5d2c6a933..f340dfd828c 100644
--- a/regress/sbin/pfctl/pfr4.ok
+++ b/regress/sbin/pfctl/pfr4.ok
@@ -24,14 +24,14 @@ A 0.0.0.0/7
# pass replace 0/0 0/1 0/2 0/3 0/4 0/5 0/6 0/7
8 addresses added.
# pass show
- 0.0.0.0/0
- 0.0.0.0/1
- 0.0.0.0/2
- 0.0.0.0/3
- 0.0.0.0/4
- 0.0.0.0/5
- 0.0.0.0/6
0.0.0.0/7
+ 0.0.0.0/6
+ 0.0.0.0/5
+ 0.0.0.0/4
+ 0.0.0.0/3
+ 0.0.0.0/2
+ 0.0.0.0/1
+ 0.0.0.0/0
# pass replace -n 0/8 0/9 0/10 0/11 0/12 0/13 0/14 0/15
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -76,14 +76,14 @@ D 0.0.0.0/7
8 addresses added.
8 addresses deleted.
# pass show
- 0.0.0.0/10
- 0.0.0.0/11
- 0.0.0.0/12
- 0.0.0.0/13
- 0.0.0.0/14
0.0.0.0/15
- 0.0.0.0/8
+ 0.0.0.0/14
+ 0.0.0.0/13
+ 0.0.0.0/12
+ 0.0.0.0/11
+ 0.0.0.0/10
0.0.0.0/9
+ 0.0.0.0/8
# pass replace -n 0/16 0/17 0/18 0/19 0/20 0/21 0/22 0/23
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -128,14 +128,14 @@ D 0.0.0.0/9
8 addresses added.
8 addresses deleted.
# pass show
- 0.0.0.0/16
- 0.0.0.0/17
- 0.0.0.0/18
- 0.0.0.0/19
- 0.0.0.0/20
- 0.0.0.0/21
- 0.0.0.0/22
0.0.0.0/23
+ 0.0.0.0/22
+ 0.0.0.0/21
+ 0.0.0.0/20
+ 0.0.0.0/19
+ 0.0.0.0/18
+ 0.0.0.0/17
+ 0.0.0.0/16
# pass replace -n 0/24 0/25 0/26 0/27 0/28 0/29 0/30 0/31
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -180,14 +180,14 @@ D 0.0.0.0/23
8 addresses added.
8 addresses deleted.
# pass show
- 0.0.0.0/24
- 0.0.0.0/25
- 0.0.0.0/26
- 0.0.0.0/27
- 0.0.0.0/28
- 0.0.0.0/29
- 0.0.0.0/30
0.0.0.0/31
+ 0.0.0.0/30
+ 0.0.0.0/29
+ 0.0.0.0/28
+ 0.0.0.0/27
+ 0.0.0.0/26
+ 0.0.0.0/25
+ 0.0.0.0/24
# kill
1 tables deleted.
rules cleared
diff --git a/regress/sbin/pfctl/pfr5.ok b/regress/sbin/pfctl/pfr5.ok
index e2fd5da3a6b..ba6caff89fa 100644
--- a/regress/sbin/pfctl/pfr5.ok
+++ b/regress/sbin/pfctl/pfr5.ok
@@ -24,14 +24,14 @@ A ::/7
# pass replace ::/0 ::/1 ::/2 ::/3 ::/4 ::/5 ::/6 ::/7
8 addresses added.
# pass show
- ::/0
- ::/1
- ::/2
- ::/3
- ::/4
- ::/5
- ::/6
::/7
+ ::/6
+ ::/5
+ ::/4
+ ::/3
+ ::/2
+ ::/1
+ ::/0
# pass replace -n ::/8 ::/9 ::/10 ::/11 ::/12 ::/13 ::/14 ::/15
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -76,14 +76,14 @@ D ::/7
8 addresses added.
8 addresses deleted.
# pass show
- ::/10
- ::/11
- ::/12
- ::/13
- ::/14
::/15
- ::/8
+ ::/14
+ ::/13
+ ::/12
+ ::/11
+ ::/10
::/9
+ ::/8
# pass replace -n ::/16 ::/17 ::/18 ::/19 ::/20 ::/21 ::/22 ::/23
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -128,14 +128,14 @@ D ::/9
8 addresses added.
8 addresses deleted.
# pass show
- ::/16
- ::/17
- ::/18
- ::/19
- ::/20
- ::/21
- ::/22
::/23
+ ::/22
+ ::/21
+ ::/20
+ ::/19
+ ::/18
+ ::/17
+ ::/16
# pass replace -n ::/24 ::/25 ::/26 ::/27 ::/28 ::/29 ::/30 ::/31
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -180,14 +180,14 @@ D ::/23
8 addresses added.
8 addresses deleted.
# pass show
- ::/24
- ::/25
- ::/26
- ::/27
- ::/28
- ::/29
- ::/30
::/31
+ ::/30
+ ::/29
+ ::/28
+ ::/27
+ ::/26
+ ::/25
+ ::/24
# pass replace -n ::/32 ::/33 ::/34 ::/35 ::/36 ::/37 ::/38 ::/39
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -232,14 +232,14 @@ D ::/31
8 addresses added.
8 addresses deleted.
# pass show
- ::/32
- ::/33
- ::/34
- ::/35
- ::/36
- ::/37
- ::/38
::/39
+ ::/38
+ ::/37
+ ::/36
+ ::/35
+ ::/34
+ ::/33
+ ::/32
# pass replace -n ::/40 ::/41 ::/42 ::/43 ::/44 ::/45 ::/46 ::/47
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -284,14 +284,14 @@ D ::/39
8 addresses added.
8 addresses deleted.
# pass show
- ::/40
- ::/41
- ::/42
- ::/43
- ::/44
- ::/45
- ::/46
::/47
+ ::/46
+ ::/45
+ ::/44
+ ::/43
+ ::/42
+ ::/41
+ ::/40
# pass replace -n ::/48 ::/49 ::/50 ::/51 ::/52 ::/53 ::/54 ::/55
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -336,14 +336,14 @@ D ::/47
8 addresses added.
8 addresses deleted.
# pass show
- ::/48
- ::/49
- ::/50
- ::/51
- ::/52
- ::/53
- ::/54
::/55
+ ::/54
+ ::/53
+ ::/52
+ ::/51
+ ::/50
+ ::/49
+ ::/48
# pass replace -n ::/56 ::/57 ::/58 ::/59 ::/60 ::/61 ::/62 ::/63
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -388,14 +388,14 @@ D ::/55
8 addresses added.
8 addresses deleted.
# pass show
- ::/56
- ::/57
- ::/58
- ::/59
- ::/60
- ::/61
- ::/62
::/63
+ ::/62
+ ::/61
+ ::/60
+ ::/59
+ ::/58
+ ::/57
+ ::/56
# pass replace -n ::/64 ::/65 ::/66 ::/67 ::/68 ::/69 ::/70 ::/71
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -440,14 +440,14 @@ D ::/63
8 addresses added.
8 addresses deleted.
# pass show
- ::/64
- ::/65
- ::/66
- ::/67
- ::/68
- ::/69
- ::/70
::/71
+ ::/70
+ ::/69
+ ::/68
+ ::/67
+ ::/66
+ ::/65
+ ::/64
# pass replace -n ::/72 ::/73 ::/74 ::/75 ::/76 ::/77 ::/78 ::/79
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -492,14 +492,14 @@ D ::/71
8 addresses added.
8 addresses deleted.
# pass show
- ::/72
- ::/73
- ::/74
- ::/75
- ::/76
- ::/77
- ::/78
::/79
+ ::/78
+ ::/77
+ ::/76
+ ::/75
+ ::/74
+ ::/73
+ ::/72
# pass replace -n ::/80 ::/81 ::/82 ::/83 ::/84 ::/85 ::/86 ::/87
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -544,14 +544,14 @@ D ::/79
8 addresses added.
8 addresses deleted.
# pass show
- ::/80
- ::/81
- ::/82
- ::/83
- ::/84
- ::/85
- ::/86
::/87
+ ::/86
+ ::/85
+ ::/84
+ ::/83
+ ::/82
+ ::/81
+ ::/80
# pass replace -n ::/88 ::/89 ::/90 ::/91 ::/92 ::/93 ::/94 ::/95
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -596,14 +596,14 @@ D ::/87
8 addresses added.
8 addresses deleted.
# pass show
- ::/88
- ::/89
- ::/90
- ::/91
- ::/92
- ::/93
- ::/94
::/95
+ ::/94
+ ::/93
+ ::/92
+ ::/91
+ ::/90
+ ::/89
+ ::/88
# pass replace -n ::/96 ::/97 ::/98 ::/99 ::/100 ::/101 ::/102 ::/103
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -648,14 +648,14 @@ D ::/95
8 addresses added.
8 addresses deleted.
# pass show
- ::/100
- ::/101
- ::/102
::/103
- ::/96
- ::/97
- ::/98
+ ::/102
+ ::/101
+ ::/100
::/99
+ ::/98
+ ::/97
+ ::/96
# pass replace -n ::/104 ::/105 ::/106 ::/107 ::/108 ::/109 ::/110 ::/111
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -700,14 +700,14 @@ D ::/99
8 addresses added.
8 addresses deleted.
# pass show
- ::/104
- ::/105
- ::/106
- ::/107
- ::/108
- ::/109
- ::/110
::/111
+ ::/110
+ ::/109
+ ::/108
+ ::/107
+ ::/106
+ ::/105
+ ::/104
# pass replace -n ::/112 ::/113 ::/114 ::/115 ::/116 ::/117 ::/118 ::/119
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -752,14 +752,14 @@ D ::/111
8 addresses added.
8 addresses deleted.
# pass show
- ::/112
- ::/113
- ::/114
- ::/115
- ::/116
- ::/117
- ::/118
::/119
+ ::/118
+ ::/117
+ ::/116
+ ::/115
+ ::/114
+ ::/113
+ ::/112
# pass replace -n ::/120 ::/121 ::/122 ::/123 ::/124 ::/125 ::/126 ::/127
8 addresses added (dummy).
8 addresses deleted (dummy).
@@ -804,14 +804,14 @@ D ::/119
8 addresses added.
8 addresses deleted.
# pass show
- ::/120
- ::/121
- ::/122
- ::/123
- ::/124
- ::/125
- ::/126
::/127
+ ::/126
+ ::/125
+ ::/124
+ ::/123
+ ::/122
+ ::/121
+ ::/120
# kill
1 tables deleted.
rules cleared
diff --git a/regress/sbin/pfctl/pfr6.ok b/regress/sbin/pfctl/pfr6.ok
index d047b9d2c4b..43c2731ffa0 100644
--- a/regress/sbin/pfctl/pfr6.ok
+++ b/regress/sbin/pfctl/pfr6.ok
@@ -21,10 +21,10 @@ A !::2
6/6 addresses added.
# pass show
1.1.1.1
- 10.10.0.0/16
- ::1
!1.1.1.2
+ 10.10.0.0/16
!10.11.0.0/16
+ ::1
!::2
# pass replace -n 1.1.1.1 !1.1.1.2 !!1.1.1.3 !!!1.1.1.4
2 addresses added (dummy).
@@ -53,8 +53,8 @@ D !::2
4 addresses deleted.
# pass show
1.1.1.1
- 1.1.1.3
!1.1.1.2
+ 1.1.1.3
!1.1.1.4
# pass replace -n fe80::/16 !fe81::/16 !!fe82::/16 !!!fe83::/16
4 addresses added (dummy).
@@ -85,8 +85,8 @@ D !1.1.1.4
4 addresses deleted.
# pass show
fe80::/16
- fe82::/16
!fe81::/16
+ fe82::/16
!fe83::/16
# pass replace -n 10/8 !10.10/16 10.10.10/24 !10.10.10.10
4 addresses added (dummy).
@@ -131,12 +131,12 @@ A !fe80:fe80::/32
3/3 addresses added.
# pass show
10.0.0.0/8
- 10.10.10.0/24
- fe80::/16
- fe80:fe80:fe80::/48
!10.10.0.0/16
+ 10.10.10.0/24
!10.10.10.10
+ fe80::/16
!fe80:fe80::/32
+ fe80:fe80:fe80::/48
# pass test 10.1.1.1 10.10.10.1
2/2 addresses match.
# fail test 11.1.1.1 10.10.1.1 10.10.10.10