Commit 747f4c7d authored by Nils Goroll's avatar Nils Goroll

better test coverage for changing the uncacheable_direct argument

parent d234259d
...@@ -21,17 +21,20 @@ varnish v1 -vcl+backend { ...@@ -21,17 +21,20 @@ varnish v1 -vcl+backend {
new rr = directors.round_robin(); new rr = directors.round_robin();
rr.add_backend(s1); rr.add_backend(s1);
rr.add_backend(s2); rr.add_backend(s2);
new cl = cluster.cluster(rr.backend(), deny=s2, real=s3, new cl = cluster.cluster(rr.backend(), deny=s2, real=s3);
uncacheable_direct=false);
} }
sub vcl_recv { sub vcl_recv {
return (pass); return (pass);
} }
sub vcl_backend_fetch { sub vcl_backend_fetch {
set bereq.backend = cl.backend(); set bereq.http.unc1 = cl.get_uncacheable_direct();
set bereq.backend = cl.backend(uncacheable_direct=false);
set bereq.http.unc2 = cl.get_uncacheable_direct();
} }
sub vcl_backend_response { sub vcl_backend_response {
set beresp.http.unc1 = bereq.http.unc1;
set beresp.http.backend = beresp.backend; set beresp.http.backend = beresp.backend;
set beresp.http.unc2 = bereq.http.unc2;
} }
} -start } -start
...@@ -39,9 +42,13 @@ client c1 { ...@@ -39,9 +42,13 @@ client c1 {
txreq txreq
rxresp rxresp
expect resp.status == 200 expect resp.status == 200
expect resp.http.unc1 == "true"
expect resp.http.backend == "s1" expect resp.http.backend == "s1"
expect resp.http.unc2 == "false"
txreq txreq
rxresp rxresp
expect resp.status == 200 expect resp.status == 200
expect resp.http.unc1 == "true"
expect resp.http.backend == "s3" expect resp.http.backend == "s3"
expect resp.http.unc2 == "false"
} -run } -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