Created
August 16, 2017 18:45
-
-
Save rezan/3904e31826496d99afd01bf1d31e48d9 to your computer and use it in GitHub Desktop.
VTC checking for a log line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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