r1839 - trunk/varnish-tools/regress/lib/Varnish/Test

des at projects.linpro.no des at projects.linpro.no
Mon Aug 13 20:30:15 CEST 2007


Author: des
Date: 2007-08-13 20:30:15 +0200 (Mon, 13 Aug 2007)
New Revision: 1839

Modified:
   trunk/varnish-tools/regress/lib/Varnish/Test/Case.pm
Log:
Not all responses have XIDs.


Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Case.pm
===================================================================
--- trunk/varnish-tools/regress/lib/Varnish/Test/Case.pm	2007-08-13 18:00:50 UTC (rev 1838)
+++ trunk/varnish-tools/regress/lib/Varnish/Test/Case.pm	2007-08-13 18:30:15 UTC (rev 1839)
@@ -264,10 +264,6 @@
 	if $ev eq 'ev_client_timeout';
     die "Internal error\n"
 	unless $resp && ref($resp) && $resp->isa('HTTP::Response');
-    die "No X-Varnish header\n"
-	unless (!$resp->header('X-Varnish'));
-    die "Invalid X-Varnish header\n"
-	unless ($resp->header('X-Varnish') =~ m/^\d+(?: \d+)?$/);
     $resp->request($req);
     return $self->{'cached_response'} = $resp;
 }
@@ -310,6 +306,18 @@
     $self->assert_code(200, $resp);
 }
 
+sub assert_xid($;$) {
+    my ($self, $resp) = @_;
+
+    $resp = $self->{'cached_response'}
+        unless defined($resp);
+
+    die "No X-Varnish header\n"
+	unless (!$resp->header('X-Varnish'));
+    die "Invalid X-Varnish header\n"
+	unless ($resp->header('X-Varnish') =~ m/^\d+(?: \d+)?$/);
+}
+
 sub assert_cached($;$) {
     my ($self, $resp) = @_;
 




More information about the varnish-commit mailing list