r2833 - trunk/varnish-cache/bin/varnishtest/tests

phk at projects.linpro.no phk at projects.linpro.no
Thu Jun 26 14:12:29 CEST 2008


Author: phk
Date: 2008-06-26 14:12:29 +0200 (Thu, 26 Jun 2008)
New Revision: 2833

Added:
   trunk/varnish-cache/bin/varnishtest/tests/c00008.vtc
Log:
Test If-Modified-Since



Added: trunk/varnish-cache/bin/varnishtest/tests/c00008.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/c00008.vtc	                        (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/c00008.vtc	2008-06-26 12:12:29 UTC (rev 2833)
@@ -0,0 +1,34 @@
+# $Id$
+
+test "Test If-Modified-Since"
+
+server s1 {
+	rxreq
+	expect req.url == "/foo"
+	txresp -hdr "Last-Modified: Thu, 26 Jun 2008 12:00:01 GMT" -body "11111\n"
+} -start
+
+varnish v1 -vcl+backend { } -start
+
+client c1 {
+	txreq -url "/foo"
+	rxresp
+	expect resp.status == 200
+	expect resp.http.content-length == 6
+
+	txreq -url "/foo" -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:00 GMT"
+	rxresp
+	expect resp.status == 200
+
+	txreq -url "/foo" -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT"
+	rxresp
+	expect resp.status == 304
+
+	txreq -url "/foo" -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:02 GMT"
+	rxresp
+	expect resp.status == 304
+} 
+
+client c1 -run
+
+client c1 -run




More information about the varnish-commit mailing list