Commit 8e3fe48e authored by Geoff Simmons's avatar Geoff Simmons

add test c00014.vtc

parent 933904ad
varnishtest "Test parking second request on backend delay, then pass"
server s1 {
rxreq
expect req.url == "/foo"
sema r1 sync 2
send "HTTP/1.1 200 OK\r\nContent-Length: 12\r\n\r\n"
send "line1\n"
send "line2\n"
rxreq
expect req.url == "/foo"
txresp -body "foobar"
} -start
varnish v1 -vcl {
import backend_dyn from "${vmod_topbuild}/src/.libs/libvmod_backend_dyn.so";
backend dummy { .host="${bad_ip}"; }
sub vcl_init {
if (!backend_dyn.create(name="be", host="${s1_addr}",
port="${s1_port}")) {
return(fail);
}
}
sub vcl_backend_fetch {
set bereq.backend = backend_dyn.by_name("be");
}
sub vcl_backend_response {
set beresp.do_stream = false;
set beresp.uncacheable = true;
}
} -start
client c1 {
txreq -url "/foo"
rxresp
expect resp.status == 200
expect resp.bodylen == 12
expect resp.http.x-varnish == "1001"
} -start
sema r1 sync 2
delay .2
client c2 {
txreq -url "/foo"
rxresp
expect resp.status == 200
expect resp.bodylen == 6
expect resp.http.x-varnish == "1004"
} -run
client c1 -wait
varnish v1 -expect cache_hitpass == 1
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