Commit 3ab1faee authored by Geoff Simmons's avatar Geoff Simmons

Add the backend timeout test.

parent 61c2ab4a
varnishtest "like e00003.vtc but backend timeout at ESI level 1"
server s1 {
rxreq
expect req.http.esi0 == "foo"
txresp -body {
<html>
Before include
<esi:include src="/body" sr="foo"/>
After include
</html>
}
} -start
server s2 {
rxreq
expect req.url == "/body1"
expect req.http.esi0 != "foo"
delay 0.6
txresp -body {
Included file
}
} -start
varnish v1 -vcl+backend {
import ${vmod_pesi};
sub vcl_recv {
if (req.esi_level > 0) {
set req.url = req.url + req.esi_level;
} else {
set req.http.esi0 = "foo";
}
}
sub vcl_backend_fetch {
if (bereq.url == "/") {
set bereq.backend = s1;
}
else {
set bereq.backend = s2;
set bereq.first_byte_timeout = 0.5s;
}
}
sub vcl_backend_response {
if (bereq.url == "/") {
set beresp.do_esi = true;
}
}
sub vcl_deliver {
pesi.activate();
}
sub vcl_backend_error {
set beresp.body = "ouch!";
return(deliver);
}
} -start
client c1 {
txreq -hdr "Host: foo"
rxresp
expect resp.status == 200
expect resp.bodylen == 62
expect resp.body == {
<html>
Before include
ouch!
After include
</html>
}
} -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment