varnish at bsdchicks
Aug 29, 2011, 4:34 PM
Post #1 of 1
A while in the making, but 2 full rewrites later, here it is.
[PATCH] varnishlog functionality in varnishtest
Please be sure to apply
well, or there's a good chance you'll get errors during "make check".
What this adds:
- When given a second -v, varnishlog output is added to the overall test
- The varnish component gets a -logexpecttag action. It takes 2 arguments,
a number (0+) and a VSL tag. It will see how many of said tag have passed
by since the child was started, and match it with the number.
- And it gets a -logexpectregex action. Again 2 arguments, a number
(0+) and a regex. The regex is matched with the contents of the loglines,
just like varnishlog et al do.
Do give the varnishd a smidgen of time to write to the VSL before doing
your expects. How much is a bit of an inexact science, but 0.2 has been
working for me. (See a00012.vtc)
Any comments are welcome, as are suggestions for better alternatives to
-logexpect(tag|regex). They're a bit horrible in length.
Also, I'm tempted to scrap the second verbosity level and always include
VSL in the test log. Opinions on that?