Commit eb7e4b3f authored by Geoff Simmons's avatar Geoff Simmons

Test the set-salt error.

parent 7de2c01d
......@@ -12,7 +12,7 @@ varnishtest "standard encryption VFP"
# random salt is generated.
feature cmd {test $ENABLE_SET_SALT = "yes"}
server s1 {
server s1 -repeat 2 {
rxreq
txresp -body {I am the walrus}
} -start
......@@ -32,6 +32,7 @@ varnish v1 -arg "-p vsl_mask=+VfpAcct" -vcl+backend {
set bereq.http.X-ECE-Key-ID = "";
set bereq.http.XYZZY-ECE-Salt = "I1BsxtFttlv3u/Oo94xnmw==";
set beresp.filters = "ece_encrypt";
set beresp.uncacheable = true;
}
} -start
......@@ -58,3 +59,29 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
expect * = VfpAcct {^ece_encrypt \d+ 53$}
expect * = End
} -run
# set-salt error
varnish v1 -vcl+backend {
import ${vmod_ece};
sub vcl_backend_response {
set bereq.http.X-ECE-Key-ID = "";
set bereq.http.XYZZY-ECE-Salt = "foobar";
set beresp.filters = "ece_encrypt";
}
}
logexpect l1 -v v1 -d 0 -g vxid -q "FetchError" {
expect 0 * Begin bereq
expect * = FetchError {^set-salt base64 decoding error$}
expect * = End
} -start
client c1 {
txreq
rxresp
expect resp.status == 503
expect resp.reason == "Backend fetch failed"
} -run
logexpect l1 -wait
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