diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-01-21 20:16:58 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-01-21 20:16:58 +0000 |
commit | ea00133635fa2e6ec642a0d67e215aaa985de0c4 (patch) | |
tree | e9b35e5c09af1b04573cd0db1d5a5a3dbb71c5ef /regress | |
parent | 1dd0c38510c71a37f7714361d123b11f5788a5e7 (diff) |
Add ssl tests for https chunked and https contentlength over relayd.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.sbin/relayd/Relayd.pm | 4 | ||||
-rw-r--r-- | regress/usr.sbin/relayd/args-https-chunked.pl | 30 | ||||
-rw-r--r-- | regress/usr.sbin/relayd/args-https-contentlength.pl | 29 | ||||
-rw-r--r-- | regress/usr.sbin/relayd/args-https-persistent.pl | 2 |
4 files changed, 63 insertions, 2 deletions
diff --git a/regress/usr.sbin/relayd/Relayd.pm b/regress/usr.sbin/relayd/Relayd.pm index 08d3fcfd672..0b40257bbe3 100644 --- a/regress/usr.sbin/relayd/Relayd.pm +++ b/regress/usr.sbin/relayd/Relayd.pm @@ -1,4 +1,4 @@ -# $OpenBSD: Relayd.pm,v 1.5 2012/12/28 20:36:25 bluhm Exp $ +# $OpenBSD: Relayd.pm,v 1.6 2013/01/21 20:16:57 bluhm Exp $ # Copyright (c) 2010-2012 Alexander Bluhm <bluhm@openbsd.org> # @@ -47,6 +47,8 @@ sub new { or croak "$class connect port not given"; my $test = basename($self->{testfile} || ""); + # ssl does not allow a too long session id, so truncate it + substr($test, 25, length($test) - 25, "") if length($test) > 25; open(my $fh, '>', $self->{conffile}) or die ref($self), " conf file $self->{conffile} create failed: $!"; print $fh "log all\n"; diff --git a/regress/usr.sbin/relayd/args-https-chunked.pl b/regress/usr.sbin/relayd/args-https-chunked.pl new file mode 100644 index 00000000000..fb8d58238d6 --- /dev/null +++ b/regress/usr.sbin/relayd/args-https-chunked.pl @@ -0,0 +1,30 @@ +# test chunked https 1.1 connection over http relay + +use strict; +use warnings; + +my @lengths = ([ 251, 10000, 10 ], 1, [2, 3]); +our %args = ( + client => { + func => \&http_client, + lengths => \@lengths, + ssl => 1, + }, + relayd => { + protocol => [ "http", + "request header log foo", + "response header log Transfer-Encoding", + ], + loggrep => { "log 'Transfer-Encoding: chunked'" => 2 }, + forwardssl => 1, + listenssl => 1, + }, + server => { + func => \&http_server, + ssl => 1, + }, + lengths => \@lengths, + md5 => "bc3a3f39af35fe5b1687903da2b00c7f", +); + +1; diff --git a/regress/usr.sbin/relayd/args-https-contentlength.pl b/regress/usr.sbin/relayd/args-https-contentlength.pl new file mode 100644 index 00000000000..33d1bff9906 --- /dev/null +++ b/regress/usr.sbin/relayd/args-https-contentlength.pl @@ -0,0 +1,29 @@ +# test persistent https 1.1 connection and grep for content length + +use strict; +use warnings; + +my @lengths = (1, 2, 0, 3, 4); +our %args = ( + client => { + func => \&http_client, + lengths => \@lengths, + ssl => 1, + }, + relayd => { + protocol => [ "http", + "request header log foo", + "response header log Content-Length", + ], + loggrep => [ map { "log 'Content-Length: $_'" } @lengths ], + forwardssl => 1, + listenssl => 1, + }, + server => { + func => \&http_server, + ssl => 1, + }, + lengths => \@lengths, +); + +1; diff --git a/regress/usr.sbin/relayd/args-https-persistent.pl b/regress/usr.sbin/relayd/args-https-persistent.pl index ed4569ade88..b53985b0783 100644 --- a/regress/usr.sbin/relayd/args-https-persistent.pl +++ b/regress/usr.sbin/relayd/args-https-persistent.pl @@ -1,4 +1,4 @@ -# test persistent http 1.1 connection over http relay +# test persistent https 1.1 connection over http relay use strict; use warnings; |