Commit 4c4224e0 authored by Geoff Simmons's avatar Geoff Simmons

Test an error on update.

parent d0bc503b
......@@ -38,11 +38,12 @@ varnish v1 -vcl+backend {
}
sub vcl_recv {
set req.http.Get = rdr.get();
return (synth(200));
}
sub vcl_synth {
set resp.http.Get = rdr.get();
set resp.http.Get = req.http.Get;
return (deliver);
}
}
......@@ -58,3 +59,23 @@ client c1 {
expect resp.status == 200
expect resp.http.Get == "quux baz bar foo"
} -run
shell {rm -f ${tmpdir}/file}
delay .1
client c1 {
txreq
rxresp
expect resp.status == 503
expect resp.reason == "VCL failed"
} -run
logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
expect 0 * Begin req
expect * = VCL_Error {^rdr\.get\(\): vmod file failure: rdr: cannot read info about}
expect * = End
} -run
logexpect l1 -v v1 -d 1 -g raw -q "Error" {
expect * 0 Error {^vmod file failure: rdr: cannot read info about}
} -run
......@@ -47,9 +47,6 @@
#include "vcc_if.h"
#define FAIL(ctx, msg) \
VRT_fail((ctx), "vmod file failure: " msg)
#define VFAIL(ctx, fmt, ...) \
VRT_fail((ctx), "vmod file failure: " fmt, __VA_ARGS__)
......@@ -352,7 +349,7 @@ vmod_reader_get(VRT_CTX, struct VPFX(file_reader) *rdr)
}
AN(strcmp(rdr->errbuf, NO_ERR));
VFAIL(ctx, "%s.get(): %s", rdr->vcl_name, rdr->errbuf);
VRT_fail(ctx, "%s.get(): %s", rdr->vcl_name, rdr->errbuf);
return (NULL);
}
......
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