[4.0] 1127242 Add test case to make sure we always emit Date headers
Martin Blix Grydeland
martin at varnish-software.com
Tue Jun 24 11:31:37 CEST 2014
commit 1127242299c930330a389c6960bb27f254132b96
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Mon Apr 14 17:50:51 2014 +0200
Add test case to make sure we always emit Date headers
diff --git a/bin/varnishtest/tests/c00066.vtc b/bin/varnishtest/tests/c00066.vtc
new file mode 100644
index 0000000..eeb1ff9
--- /dev/null
+++ b/bin/varnishtest/tests/c00066.vtc
@@ -0,0 +1,58 @@
+varnishtest "Check that we always deliver Date headers"
+
+server s1 {
+ rxreq
+ txresp
+} -start
+
+varnish v1 -vcl+backend {
+ backend bad { .host = "${bad_ip}"; }
+ sub vcl_recv {
+ if (req.url == "/synth") {
+ return (synth(200, "Synth test"));
+ }
+ if (req.url == "/error") {
+ set req.backend_hint = bad;
+ }
+ }
+ sub vcl_backend_response {
+ set beresp.do_stream = false;
+ }
+} -start
+
+varnish v1 -cliok "param.set connect_timeout 1"
+
+logexpect l1 -v v1 -g request {
+ expect 0 1001 Begin "^req .* rxreq"
+ expect * = ReqURL "/"
+ expect * = RespHeader "^Date: "
+ expect * = End
+
+ expect * 1003 Begin "^req .* rxreq"
+ expect * = ReqURL "/synth"
+ expect * = RespHeader "^Date: "
+ expect * = End
+
+ expect * 1004 Begin "^req .* rxreq"
+ expect * = ReqURL "/error"
+ expect * = RespHeader "^Date: "
+ expect * = End
+} -start
+
+client c1 {
+ txreq -url "/"
+ rxresp
+ expect resp.status == 200
+ expect resp.msg == "Ok"
+
+ txreq -url "/synth"
+ rxresp
+ expect resp.status == 200
+ expect resp.msg == "Synth test"
+
+ txreq -url "/error"
+ rxresp
+ expect resp.status == 503
+} -run
+
+logexpect l1 -wait
More information about the varnish-commit
mailing list