[master] e177b46 Add a test-case to check that vcl_backend_error{} objects can be cached.
Poul-Henning Kamp
phk at FreeBSD.org
Thu Mar 13 16:53:31 CET 2014
commit e177b4620e3a8e734c751c431541c5b7c27b29d7
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Mar 13 15:53:12 2014 +0000
Add a test-case to check that vcl_backend_error{} objects can be cached.
diff --git a/bin/varnishtest/tests/c00063.vtc b/bin/varnishtest/tests/c00063.vtc
new file mode 100644
index 0000000..0da903e
--- /dev/null
+++ b/bin/varnishtest/tests/c00063.vtc
@@ -0,0 +1,32 @@
+varnishtest "cache backend synth object"
+
+varnish v1 -vcl {
+
+ backend b { .host = "${bad_ip}"; }
+
+ sub vcl_backend_error {
+ set beresp.ttl = 1s;
+ set beresp.grace = 3s;
+ set beresp.http.foobar = "BLA" + bereq.xid;
+ synthetic(beresp.http.foobar);
+ return (deliver);
+ }
+} -start
+
+varnish v1 -cliok "param.set connect_timeout 1.0"
+
+client c1 {
+ txreq
+ rxresp
+ expect resp.http.foobar == "BLA1002"
+
+ delay 2
+ txreq
+ rxresp
+ expect resp.http.foobar == "BLA1002"
+
+ delay 3
+ txreq
+ rxresp
+ expect resp.http.foobar == "BLA1004"
+} -run
More information about the varnish-commit
mailing list