summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2014-07-10 19:43:00 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2014-07-10 19:43:00 +0000
commitf9331ca2a7280b691bc2fcfb3cb0216cafaefebe (patch)
tree8b9b6eff96d17754d42354dbeed67edc3db64fa3
parent8b3ff6e6949d2af79655be5361b743620456c453 (diff)
To make sure that at least anything is tested, add a length check
per default for the default length value in check_logs(). If a test doesn't want this check, it has to disable it explicitly with nocheck. Also remove unneeded nocheck switches for deeper testing.
-rw-r--r--regress/usr.sbin/relayd/args-http-append.pl1
-rw-r--r--regress/usr.sbin/relayd/args-http-change-path.pl1
-rw-r--r--regress/usr.sbin/relayd/args-http-change.pl1
-rw-r--r--regress/usr.sbin/relayd/args-http-filter-url-digest.pl1
-rw-r--r--regress/usr.sbin/relayd/args-http-filter-url.pl1
-rw-r--r--regress/usr.sbin/relayd/args-http-hash.pl4
-rw-r--r--regress/usr.sbin/relayd/args-http-label.pl1
-rw-r--r--regress/usr.sbin/relayd/args-http-mark-marked.pl1
-rw-r--r--regress/usr.sbin/relayd/args-http-mark.pl1
-rw-r--r--regress/usr.sbin/relayd/args-http-remove.pl1
-rw-r--r--regress/usr.sbin/relayd/funcs.pl4
11 files changed, 10 insertions, 7 deletions
diff --git a/regress/usr.sbin/relayd/args-http-append.pl b/regress/usr.sbin/relayd/args-http-append.pl
index 3fae3331ed8..db13a06ae3d 100644
--- a/regress/usr.sbin/relayd/args-http-append.pl
+++ b/regress/usr.sbin/relayd/args-http-append.pl
@@ -4,7 +4,6 @@ use warnings;
our %args = (
client => {
func => \&http_client,
- len => 1,
loggrep => {
'X-Server-Append: \d+\.\d+\.\d+\.\d+:\d+$' => 1,
'Set-Cookie: a=b\;' => 1,
diff --git a/regress/usr.sbin/relayd/args-http-change-path.pl b/regress/usr.sbin/relayd/args-http-change-path.pl
index 2596d438858..41a547d672b 100644
--- a/regress/usr.sbin/relayd/args-http-change-path.pl
+++ b/regress/usr.sbin/relayd/args-http-change-path.pl
@@ -21,6 +21,7 @@ our %args = (
qr/GET \/foopath HTTP\/1\.0/ => 1,
},
},
+ len => 8,
);
1;
diff --git a/regress/usr.sbin/relayd/args-http-change.pl b/regress/usr.sbin/relayd/args-http-change.pl
index 54286c53579..fb38379b5ad 100644
--- a/regress/usr.sbin/relayd/args-http-change.pl
+++ b/regress/usr.sbin/relayd/args-http-change.pl
@@ -5,7 +5,6 @@ my %header = ("X-Test-Header" => "XOriginalValue");
our %args = (
client => {
func => \&http_client,
- nocheck => 1,
loggrep => {
qr/X-Test-Header: XChangedValue/ => 1,
qr/Host: foo.bar/ => 1,
diff --git a/regress/usr.sbin/relayd/args-http-filter-url-digest.pl b/regress/usr.sbin/relayd/args-http-filter-url-digest.pl
index 7bfd8af02fe..64551ea3d9b 100644
--- a/regress/usr.sbin/relayd/args-http-filter-url-digest.pl
+++ b/regress/usr.sbin/relayd/args-http-filter-url-digest.pl
@@ -10,6 +10,7 @@ our %args = (
qr/Server: OpenBSD relayd/,
qr/Connection: close/,
],
+ nocheck => 1,
httpnok => 1,
},
relayd => {
diff --git a/regress/usr.sbin/relayd/args-http-filter-url.pl b/regress/usr.sbin/relayd/args-http-filter-url.pl
index c50ec56ed00..ec325f230b6 100644
--- a/regress/usr.sbin/relayd/args-http-filter-url.pl
+++ b/regress/usr.sbin/relayd/args-http-filter-url.pl
@@ -11,6 +11,7 @@ our %args = (
qr/Connection: close/,
],
httpnok => 1,
+ nocheck => 1,
},
relayd => {
protocol => [ "http",
diff --git a/regress/usr.sbin/relayd/args-http-hash.pl b/regress/usr.sbin/relayd/args-http-hash.pl
index 08c070244f2..99b0d9d5232 100644
--- a/regress/usr.sbin/relayd/args-http-hash.pl
+++ b/regress/usr.sbin/relayd/args-http-hash.pl
@@ -5,8 +5,6 @@ our %args = (
client => {
func => \&http_client,
path => "query?foobar",
- len => 21,
- nocheck => 1,
},
relayd => {
table => 1,
@@ -22,8 +20,8 @@ our %args = (
},
server => {
func => \&http_server,
- nocheck => 1,
},
+ len => 13,
);
1;
diff --git a/regress/usr.sbin/relayd/args-http-label.pl b/regress/usr.sbin/relayd/args-http-label.pl
index 94a7a4ff697..b103f402f4c 100644
--- a/regress/usr.sbin/relayd/args-http-label.pl
+++ b/regress/usr.sbin/relayd/args-http-label.pl
@@ -10,6 +10,7 @@ our %args = (
},
path => "query?foo=bar&ok=yes",
httpnok => 1,
+ nocheck => 1,
},
relayd => {
protocol => [ "http",
diff --git a/regress/usr.sbin/relayd/args-http-mark-marked.pl b/regress/usr.sbin/relayd/args-http-mark-marked.pl
index b5a3752a1b7..7beec7496e0 100644
--- a/regress/usr.sbin/relayd/args-http-mark-marked.pl
+++ b/regress/usr.sbin/relayd/args-http-mark-marked.pl
@@ -16,6 +16,7 @@ our %args = (
server => {
func => \&http_server,
},
+ len => 33,
);
1;
diff --git a/regress/usr.sbin/relayd/args-http-mark.pl b/regress/usr.sbin/relayd/args-http-mark.pl
index 960bf9031b9..dfaa5290947 100644
--- a/regress/usr.sbin/relayd/args-http-mark.pl
+++ b/regress/usr.sbin/relayd/args-http-mark.pl
@@ -17,6 +17,7 @@ our %args = (
server => {
func => \&http_server,
},
+ len => 12,
);
1;
diff --git a/regress/usr.sbin/relayd/args-http-remove.pl b/regress/usr.sbin/relayd/args-http-remove.pl
index cee6e5ae9c4..e840563cfef 100644
--- a/regress/usr.sbin/relayd/args-http-remove.pl
+++ b/regress/usr.sbin/relayd/args-http-remove.pl
@@ -8,7 +8,6 @@ my %header = (
our %args = (
client => {
func => \&http_client,
- nocheck => 1,
loggrep => {
"X-Header-Foo: foo" => 0,
"X-Header-Bar: bar" => 1,
diff --git a/regress/usr.sbin/relayd/funcs.pl b/regress/usr.sbin/relayd/funcs.pl
index 5ab7d5279f3..4c729b1afac 100644
--- a/regress/usr.sbin/relayd/funcs.pl
+++ b/regress/usr.sbin/relayd/funcs.pl
@@ -1,4 +1,4 @@
-# $OpenBSD: funcs.pl,v 1.14 2014/07/10 11:56:11 reyk Exp $
+# $OpenBSD: funcs.pl,v 1.15 2014/07/10 19:42:59 bluhm Exp $
# Copyright (c) 2010-2013 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -376,6 +376,8 @@ sub check_logs {
sub check_len {
my ($c, $r, $s, %args) = @_;
+ $args{len} ||= 251 unless $args{lengths};
+
my @clen = $c->loggrep(qr/^LEN: /) or die "no client len"
unless $args{client}{nocheck};
my @slen = $s->loggrep(qr/^LEN: /) or die "no server len"