From ee79e3b9186615d449640a8d080359bd5e0ed5b0 Mon Sep 17 00:00:00 2001 From: bluhm Date: Wed, 29 Nov 2017 13:37:08 +0000 Subject: [PATCH] Test invalid divert combinations and adapt error messages. --- regress/sbin/pfctl/Makefile | 3 ++- regress/sbin/pfctl/pfail55.ok | 2 +- regress/sbin/pfctl/pfail56.ok | 2 +- regress/sbin/pfctl/pfail63.in | 1 + regress/sbin/pfctl/pfail63.ok | 1 + regress/sbin/pfctl/pfail64.in | 1 + regress/sbin/pfctl/pfail64.ok | 1 + regress/sbin/pfctl/pfail65.in | 1 + regress/sbin/pfctl/pfail65.ok | 1 + regress/sbin/pfctl/pfail66.in | 1 + regress/sbin/pfctl/pfail66.ok | 1 + regress/sbin/pfctl/pfail67.in | 1 + regress/sbin/pfctl/pfail67.ok | 1 + 13 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 regress/sbin/pfctl/pfail63.in create mode 100644 regress/sbin/pfctl/pfail63.ok create mode 100644 regress/sbin/pfctl/pfail64.in create mode 100644 regress/sbin/pfctl/pfail64.ok create mode 100644 regress/sbin/pfctl/pfail65.in create mode 100644 regress/sbin/pfctl/pfail65.ok create mode 100644 regress/sbin/pfctl/pfail66.in create mode 100644 regress/sbin/pfctl/pfail66.ok create mode 100644 regress/sbin/pfctl/pfail67.in create mode 100644 regress/sbin/pfctl/pfail67.ok diff --git a/regress/sbin/pfctl/Makefile b/regress/sbin/pfctl/Makefile index 281f282ea15..51fa4833437 100644 --- a/regress/sbin/pfctl/Makefile +++ b/regress/sbin/pfctl/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.229 2017/11/29 00:24:32 sashan Exp $ +# $OpenBSD: Makefile,v 1.230 2017/11/29 13:37:08 bluhm Exp $ # TARGETS # pf: feed pfNN.in through pfctl and check whether the output matches pfNN.ok @@ -19,6 +19,7 @@ PFTESTS+=74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 PFTESTS+=97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 PFFAIL=1 2 3 4 5 6 7 8 11 12 13 14 15 16 17 19 20 23 25 27 PFFAIL+=30 37 38 39 40 41 42 43 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 +PFFAIL+=63 64 65 66 67 PFSIMPLE=1 2 PFSETUP=1 4 PFLOAD=1 2 3 4 5 7 8 9 10 11 12 13 14 15 16 17 18 19 20 23 24 25 26 27 28 29 diff --git a/regress/sbin/pfctl/pfail55.ok b/regress/sbin/pfctl/pfail55.ok index eec355ad3bd..6bd08796c58 100644 --- a/regress/sbin/pfctl/pfail55.ok +++ b/regress/sbin/pfctl/pfail55.ok @@ -1 +1 @@ -stdin:1: address family mismatch for divert +stdin:1: divert-to address family mismatch diff --git a/regress/sbin/pfctl/pfail56.ok b/regress/sbin/pfctl/pfail56.ok index eec355ad3bd..6bd08796c58 100644 --- a/regress/sbin/pfctl/pfail56.ok +++ b/regress/sbin/pfctl/pfail56.ok @@ -1 +1 @@ -stdin:1: address family mismatch for divert +stdin:1: divert-to address family mismatch diff --git a/regress/sbin/pfctl/pfail63.in b/regress/sbin/pfctl/pfail63.in new file mode 100644 index 00000000000..9834c00cdaf --- /dev/null +++ b/regress/sbin/pfctl/pfail63.in @@ -0,0 +1 @@ +pass divert-to 127.0.0.1 port 1 divert-reply diff --git a/regress/sbin/pfctl/pfail63.ok b/regress/sbin/pfctl/pfail63.ok new file mode 100644 index 00000000000..5c57e65aba1 --- /dev/null +++ b/regress/sbin/pfctl/pfail63.ok @@ -0,0 +1 @@ +stdin:1: more than one divert option diff --git a/regress/sbin/pfctl/pfail64.in b/regress/sbin/pfctl/pfail64.in new file mode 100644 index 00000000000..6d1c5d0786f --- /dev/null +++ b/regress/sbin/pfctl/pfail64.in @@ -0,0 +1 @@ +pass divert-reply divert-packet port 1234 diff --git a/regress/sbin/pfctl/pfail64.ok b/regress/sbin/pfctl/pfail64.ok new file mode 100644 index 00000000000..5c57e65aba1 --- /dev/null +++ b/regress/sbin/pfctl/pfail64.ok @@ -0,0 +1 @@ +stdin:1: more than one divert option diff --git a/regress/sbin/pfctl/pfail65.in b/regress/sbin/pfctl/pfail65.in new file mode 100644 index 00000000000..ca71003e8f3 --- /dev/null +++ b/regress/sbin/pfctl/pfail65.in @@ -0,0 +1 @@ +pass divert-packet port 12345 divert-to 127.0.0.1 port 1 diff --git a/regress/sbin/pfctl/pfail65.ok b/regress/sbin/pfctl/pfail65.ok new file mode 100644 index 00000000000..5c57e65aba1 --- /dev/null +++ b/regress/sbin/pfctl/pfail65.ok @@ -0,0 +1 @@ +stdin:1: more than one divert option diff --git a/regress/sbin/pfctl/pfail66.in b/regress/sbin/pfctl/pfail66.in new file mode 100644 index 00000000000..f701d77f73e --- /dev/null +++ b/regress/sbin/pfctl/pfail66.in @@ -0,0 +1 @@ +pass out divert-to 127.0.0.1 port 1 diff --git a/regress/sbin/pfctl/pfail66.ok b/regress/sbin/pfctl/pfail66.ok new file mode 100644 index 00000000000..49580a8edc3 --- /dev/null +++ b/regress/sbin/pfctl/pfail66.ok @@ -0,0 +1 @@ +stdin:1: divert-to used with outgoing rule diff --git a/regress/sbin/pfctl/pfail67.in b/regress/sbin/pfctl/pfail67.in new file mode 100644 index 00000000000..5011c1e6c4f --- /dev/null +++ b/regress/sbin/pfctl/pfail67.in @@ -0,0 +1 @@ +pass in divert-reply diff --git a/regress/sbin/pfctl/pfail67.ok b/regress/sbin/pfctl/pfail67.ok new file mode 100644 index 00000000000..8fad7138491 --- /dev/null +++ b/regress/sbin/pfctl/pfail67.ok @@ -0,0 +1 @@ +stdin:1: divert-reply used with incoming rule -- 2.20.1