From: des Date: Fri, 19 Oct 2007 09:09:42 +0000 (+0000) Subject: Also test pipelining of POST requests (in pass mode) X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c876f061c9af72cb16475f8800dc7e2f13566ef0;p=varnish Also test pipelining of POST requests (in pass mode) git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2127 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-tools/regress/lib/Varnish/Test/Case/Pipeline.pm b/varnish-tools/regress/lib/Varnish/Test/Case/Pipeline.pm index 9dedb5e5..b407c6a9 100644 --- a/varnish-tools/regress/lib/Varnish/Test/Case/Pipeline.pm +++ b/varnish-tools/regress/lib/Varnish/Test/Case/Pipeline.pm @@ -41,7 +41,15 @@ our %CONTENT = ( 'Williams' => "I have always depended upon the kindness of strangers.", ); -sub testPipeline($) { +our $VCL = <new_client; @@ -58,11 +66,31 @@ sub testPipeline($) { return 'OK' } -sub server_get($$$) { +sub testPipelinePost($) { + my ($self) = @_; + + my $client = $self->new_client; + foreach my $author (sort keys %CONTENT) { + $self->post($client, "/$author", [], $CONTENT{$author}); + } + foreach my $author (sort keys %CONTENT) { + $self->wait(); + $self->assert_ok(); + $self->assert_xid(); + $self->assert_body(qr/\Q$CONTENT{$author}\E/); + } + + return 'OK' +} + +sub server($$$) { my ($self, $request, $response) = @_; my ($author) = ($request->uri =~ m/(\w+)$/); if ($CONTENT{$author}) { + if ($request->method eq 'POST') { + die unless $request->content =~ qr/\Q$CONTENT{$author}\E/; + } $response->content($CONTENT{$author}); } else { $response->code(404);