r2127 - trunk/varnish-tools/regress/lib/Varnish/Test/Case

des at projects.linpro.no des at projects.linpro.no
Fri Oct 19 11:09:43 CEST 2007


Author: des
Date: 2007-10-19 11:09:42 +0200 (Fri, 19 Oct 2007)
New Revision: 2127

Modified:
   trunk/varnish-tools/regress/lib/Varnish/Test/Case/Pipeline.pm
Log:
Also test pipelining of POST requests (in pass mode)


Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Case/Pipeline.pm
===================================================================
--- trunk/varnish-tools/regress/lib/Varnish/Test/Case/Pipeline.pm	2007-10-19 09:09:17 UTC (rev 2126)
+++ trunk/varnish-tools/regress/lib/Varnish/Test/Case/Pipeline.pm	2007-10-19 09:09:42 UTC (rev 2127)
@@ -41,7 +41,15 @@
     'Williams' => "I have always depended upon the kindness of strangers.",
 );
 
-sub testPipeline($) {
+our $VCL = <<EOVCL;
+sub vcl_recv {
+    if (req.request == "POST") {
+	pass;
+    }
+}
+EOVCL
+
+sub testPipelineGet($) {
     my ($self) = @_;
 
     my $client = $self->new_client;
@@ -58,11 +66,31 @@
     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);




More information about the varnish-commit mailing list