Commit 10e3b177 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

vtc: Move the remaining vmod_directors test cases

With a tiny bit of polish here and there.
parent 7cfe14da
......@@ -17,7 +17,7 @@ Naming scheme
id ~ ^a02 --> HTTP2
id ~ ^b --> Basic functionality tests
id ~ ^c --> Complex functionality tests
id ~ ^d --> Director VMOD tests
id ~ ^d --> Director facility tests
id ~ ^e --> ESI tests
id ~ ^f --> Security related tests
id ~ ^g --> GZIP tests
......@@ -34,3 +34,5 @@ Naming scheme
id ~ ^t02 --> HTTP2
id ~ ^u --> Utilities and background processes
id ~ ^v --> VCL tests: execute VRT functions
Coverage for individual VMODs is in "${top_srcdir}vmod/tests".
......@@ -2,17 +2,17 @@ varnishtest "shard director/int key"
server s1 {
rxreq
txresp -body "ech3Ooj"
txresp
} -start
server s2 {
rxreq
txresp -body "ieQu2qua"
txresp
} -start
server s3 {
rxreq
txresp -body "xiuFi3Pe"
txresp
} -start
varnish v1 -vcl+backend {
......@@ -36,31 +36,26 @@ varnish v1 -vcl+backend {
}
sub vcl_recv {
if (req.url == "/1") {
set req.backend_hint = vd.backend(by=KEY, key=1);
}
if (req.url == "/2") {
set req.backend_hint = vd.backend(by=KEY, key=2147483647);
}
if (req.url == "/3") {
set req.backend_hint = vd.backend(by=KEY, key=4294967295);
}
set req.backend_hint = vd.backend(by=KEY, key=std.integer(req.http.key));
return(pass);
}
sub vcl_backend_response {
set beresp.http.backend = beresp.backend;
}
} -start
client c1 {
txreq -url /1
txreq -hdr "key: 1"
rxresp
expect resp.body == "ech3Ooj"
expect resp.http.backend == s1
txreq -url /2
txreq -hdr "key: 2147483647"
rxresp
expect resp.body == "ieQu2qua"
expect resp.http.backend == s2
txreq -url /3
txreq -hdr "key: 4294967295"
rxresp
expect resp.body == "xiuFi3Pe"
expect resp.http.backend == s3
} -run
varnishtest "shard director LAZY - d18.vtc"
varnishtest "shard director LAZY - directors_c00003.vtc"
server s1 -repeat 2 {
rxreq
......
......@@ -2,17 +2,17 @@ varnishtest "shard director by req.url (default)"
server s1 {
rxreq
txresp -body "ech3Ooj"
txresp
} -start
server s2 {
rxreq
txresp -body "ieQu2qua"
txresp
} -start
server s3 {
rxreq
txresp -body "xiuFi3Pe"
txresp
} -start
varnish v1 -vcl+backend {
......@@ -31,19 +31,22 @@ varnish v1 -vcl+backend {
return(pass);
}
sub vcl_backend_response {
set beresp.http.backend = beresp.backend;
}
} -start
client c1 {
txreq -url /Boo0aixe
rxresp
expect resp.body == "ech3Ooj"
expect resp.http.backend == s1
txreq -url /eishoSu2
rxresp
expect resp.body == "ieQu2qua"
expect resp.http.backend == s2
txreq -url /Aunah3uo
rxresp
expect resp.body == "xiuFi3Pe"
expect resp.http.backend == s3
} -run
varnishtest "d00017.vtc but with weights"
varnishtest "directors_c00005.vtc but with weights"
server s1 {
rxreq
......
varnishtest "shard director - same as d00017.vtc but setting backend in fetch"
varnishtest "directors_c00007.vtc but setting backend in fetch"
server s1 {
rxreq
......
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