Commit f46cbfdc authored by Nils Goroll's avatar Nils Goroll

add test for resolve=LAZY (default)

parent a1aa7632
......@@ -25,7 +25,8 @@ AM_VTC_LOG_FLAGS = \
-p vmod_path="$(abs_builddir)/.libs:$(vmoddir)"
TESTS = \
vtc/vmod_cluster.vtc
vtc/vmod_cluster.vtc \
vtc/lazy.vtc
# Documentation
......
varnishtest "vmod_cluster toy example with round-robin - lazy resolution"
server s1 {
rxreq
txresp
} -start
server s2 {
}
server s3 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
import cluster;
import directors;
sub vcl_init {
new rr = directors.round_robin();
rr.add_backend(s1);
rr.add_backend(s2);
new cl = cluster.cluster(rr.backend(), deny=s2, real=s3,
uncacheable_direct=false);
}
sub vcl_recv {
return (pass);
}
sub vcl_backend_fetch {
set bereq.backend = cl.backend();
}
sub vcl_backend_response {
set beresp.http.backend = beresp.backend;
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.http.backend == "s1"
txreq
rxresp
expect resp.status == 200
expect resp.http.backend == "s3"
} -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