Skip to content

Instantly share code, notes, and snippets.

@rezan
Created August 16, 2017 18:45
Show Gist options
  • Save rezan/3904e31826496d99afd01bf1d31e48d9 to your computer and use it in GitHub Desktop.
Save rezan/3904e31826496d99afd01bf1d31e48d9 to your computer and use it in GitHub Desktop.
VTC checking for a log line
varnishtest "Test log"
server s1 -repeat 2 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
import ${vmod_std};
sub vcl_recv {
if (req.url ~ "/nocache") {
std.log("vha-instruction: forbid");
return (pass);
}
}
} -start
logexpect l1 -v v1 {
expect * * ReqURL "^/nocache$"
expect * = VCL_Log "vha-instruction: forbid"
expect * = VCL_Call "PASS"
} -start
client c1 {
txreq -url /
rxresp
expect resp.status == 200
txreq -url /nocache
rxresp
expect resp.status == 200
} -run
logexpect l1 -wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment