Commit 3775948d authored by Geoff Simmons's avatar Geoff Simmons

Test error handling for an illegal TTL.

And improve the error message a bit.
parent 4f24cb21
......@@ -100,3 +100,12 @@ varnish v1 -errvcl {vmod file failure: new rdr: name is empty} {
new rdr = file.reader("");
}
}
varnish v1 -errvcl {vmod file failure: new rdr: ttl -1.000 must be > 0s} {
import ${vmod_file};
backend b { .host = "${bad_ip}"; }
sub vcl_init {
new rdr = file.reader("foo", ttl=-1s);
}
}
......@@ -208,7 +208,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp,
return;
}
if (ttl <= 0) {
VFAIL(ctx, "new %s: ttl %.03f must be > 0", vcl_name, ttl);
VFAIL(ctx, "new %s: ttl %.03f must be > 0s", vcl_name, ttl);
return;
}
......
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