From 6fa0d6980923b96d0a8e11b1ad1dca4abfe20507 Mon Sep 17 00:00:00 2001 From: bluhm Date: Mon, 18 Aug 2014 21:43:45 +0000 Subject: [PATCH] Add test cases for multiple small HTTP requests. Many PUT requests with ony byte content length triggered relayd to hang. This has been fixed already. --- regress/usr.sbin/relayd/args-http-multi.pl | 25 ++++++++++++++++ .../usr.sbin/relayd/args-http-put-multi.pl | 25 ++++++++++++++++ regress/usr.sbin/relayd/args-https-multi.pl | 29 +++++++++++++++++++ .../usr.sbin/relayd/args-https-put-multi.pl | 29 +++++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 regress/usr.sbin/relayd/args-http-multi.pl create mode 100644 regress/usr.sbin/relayd/args-http-put-multi.pl create mode 100644 regress/usr.sbin/relayd/args-https-multi.pl create mode 100644 regress/usr.sbin/relayd/args-https-put-multi.pl diff --git a/regress/usr.sbin/relayd/args-http-multi.pl b/regress/usr.sbin/relayd/args-http-multi.pl new file mode 100644 index 00000000000..2cc16566451 --- /dev/null +++ b/regress/usr.sbin/relayd/args-http-multi.pl @@ -0,0 +1,25 @@ +# test 50 http get with length 1 over http relay + +use strict; +use warnings; + +my @lengths = map { 1 } (1..50); +our %args = ( + client => { + func => \&http_client, + lengths => \@lengths, + method => "GET", + }, + relayd => { + protocol => [ "http" ], + loggrep => { + qr/, (?:done|last write \(done\)), GET/ => (1 + @lengths), + }, + }, + server => { + func => \&http_server, + }, + lengths => \@lengths, +); + +1; diff --git a/regress/usr.sbin/relayd/args-http-put-multi.pl b/regress/usr.sbin/relayd/args-http-put-multi.pl new file mode 100644 index 00000000000..380d7166bde --- /dev/null +++ b/regress/usr.sbin/relayd/args-http-put-multi.pl @@ -0,0 +1,25 @@ +# test 50 http put with length 1 over http relay + +use strict; +use warnings; + +my @lengths = map { 1 } (1..50); +our %args = ( + client => { + func => \&http_client, + lengths => \@lengths, + method => "PUT", + }, + relayd => { + protocol => [ "http" ], + loggrep => { + qr/, (?:done|last write \(done\)), PUT/ => (1 + @lengths), + }, + }, + server => { + func => \&http_server, + }, + lengths => \@lengths, +); + +1; diff --git a/regress/usr.sbin/relayd/args-https-multi.pl b/regress/usr.sbin/relayd/args-https-multi.pl new file mode 100644 index 00000000000..32aa8fd6357 --- /dev/null +++ b/regress/usr.sbin/relayd/args-https-multi.pl @@ -0,0 +1,29 @@ +# test 50 https get with length 1 over http relay + +use strict; +use warnings; + +my @lengths = map { 1 } (1..50); +our %args = ( + client => { + func => \&http_client, + lengths => \@lengths, + method => "GET", + ssl => 1, + }, + relayd => { + protocol => [ "http" ], + loggrep => { + qr/, (?:done|last write \(done\)), GET/ => (1 + @lengths), + }, + forwardssl => 1, + listenssl => 1, + }, + server => { + func => \&http_server, + ssl => 1, + }, + lengths => \@lengths, +); + +1; diff --git a/regress/usr.sbin/relayd/args-https-put-multi.pl b/regress/usr.sbin/relayd/args-https-put-multi.pl new file mode 100644 index 00000000000..74ea56ee592 --- /dev/null +++ b/regress/usr.sbin/relayd/args-https-put-multi.pl @@ -0,0 +1,29 @@ +# test 50 https put with length 1 over http relay + +use strict; +use warnings; + +my @lengths = map { 1 } (1..50); +our %args = ( + client => { + func => \&http_client, + lengths => \@lengths, + method => "PUT", + ssl => 1, + }, + relayd => { + protocol => [ "http" ], + loggrep => { + qr/, (?:done|last write \(done\)), PUT/ => (1 + @lengths), + }, + forwardssl => 1, + listenssl => 1, + }, + server => { + func => \&http_server, + ssl => 1, + }, + lengths => \@lengths, +); + +1; -- 2.20.1