Commit 75b763b4 authored by Geoff Simmons's avatar Geoff Simmons

Test logging failure exit status.

parent 04f843cd
......@@ -71,6 +71,7 @@ endif
EXTRA_DIST = \
vdfp_pipe.vcc \
$(srcdir)/tests/slow.sh \
$(srcdir)/tests/fail.sh \
$(VMOD_TESTS)
CLEANFILES = \
......
......@@ -30,3 +30,25 @@ logexpect l1 -v v1 -g vxid -d 1 -q Error {
expect * = Error {^vdfp_pipe: vdp cat: ${cat} stderr: }
expect * = End
} -run
varnish v1 -vcl+backend {
import ${vmod_pipe};
sub vcl_init {
new fail = pipe.vdp(path="${testdir}/fail.sh");
}
sub vcl_deliver {
set resp.filters = "fail";
}
}
logexpect l1 -v v1 -g vxid -d 0 -q Error {
expect 0 * Begin {^req \d+ rxreq$}
expect * = Error {^vdfp_pipe: vdp fail: .+/fail.sh exited with status 47$}
expect * = End
} -start
client c1 -run
logexpect l1 -wait
#! /bin/sh
while read line
do
echo $line
done
exit 47
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