.TH VARNISHTEST "" "" "" .SH NAME varnishtest \- Test program for Varnish .\" Man page generated from reStructeredText. . .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 varnishtest [\-iklLqv] [\-n iter] [\-D name=val] [\-j jobs] [\-t duration] file [file ...] .UNINDENT .UNINDENT .SH DESCRIPTION .sp The varnishtest program is a script driven program used to test the Varnish Cache. .sp The varnishtest program, when started and given one or more script files, can create a number of threads representing backends, some threads representing clients, and a varnishd process. This is then used to simulate a transaction to provoke a specific behavior. .sp The following options are available: .sp \-D name=val Define macro for use in scripts .INDENT 0.0 .TP .B \-i Find varnishd in build tree .TP .BI \-j \ jobs Run this many tests in parallel .TP .B \-k Continue on test failure .TP .B \-l Leave temporary vtc.* if test fails .TP .B \-L Always leave temporary vtc.* .TP .BI \-n \ iterations Run tests this many times .TP .B \-q Quiet mode: report only failures .TP .BI \-t \ duration Time tests out after this long .TP .B \-v Verbose mode: always report test log .TP .B \-h Show help .UNINDENT .sp file File to use as a script .sp Macro definitions that can be overridden. .sp varnishd Path to varnishd to use [varnishd] .sp If \fITMPDIR\fP is set in the environment, varnishtest creates temporary \fIvtc.*\fP directories for each test in \fI$TMPDIR\fP, otherwise in \fI/tmp\fP. .SH SCRIPTS .sp The script language used for Varnishtest is not a strictly defined language. The best reference for writing scripts is the varnishtest program itself. In the Varnish source code repository, under \fIbin/varnishtest/tests/\fP, all the regression tests for Varnish are kept. .sp An example: .sp .nf .ft C varnishtest "#1029" server s1 { rxreq expect req.url == "/bar" txresp \-gzipbody {[bar]} rxreq expect req.url == "/foo" txresp \-body {

FOOBARF

} } \-start varnish v1 \-vcl+backend { sub vcl_backend_response { set beresp.do_esi = true; if (bereq.url == "/foo") { set beresp.ttl = 0s; } else { set beresp.ttl = 10m; } } } \-start client c1 { txreq \-url "/bar" \-hdr "Accept\-Encoding: gzip" rxresp gunzip expect resp.bodylen == 5 txreq \-url "/foo" \-hdr "Accept\-Encoding: gzip" rxresp expect resp.bodylen == 21 } \-run .ft P .fi .sp When run, the above script will simulate a server (s1) that expects two different requests. It will start a Varnish server (v1) and add the backend definition to the VCL specified (\-vcl+backend). Finally it starts the c1\-client, which is a single client sending two requests. .SH SEE ALSO .INDENT 0.0 .IP \(bu 2 varnishtest source code repository with tests .IP \(bu 2 varnishhist(1) .IP \(bu 2 varnishlog(1) .IP \(bu 2 varnishncsa(1) .IP \(bu 2 varnishstat(1) .IP \(bu 2 varnishtop(1) .IP \(bu 2 vcl(7) .UNINDENT .SH HISTORY .sp The varnishtest program was developed by Poul\-Henning Kamp <\fI\%phk@phk.freebsd.dk\fP> in cooperation with Varnish Software AS. This manual page was originally written by Stig Sandbeck Mathisen <\fI\%ssm@linpro.no\fP> and updated by Kristian Lyngstøl <\fI\%kristian@varnish\-cache.org\fP>. .SH COPYRIGHT .sp This document is licensed under the same licence as Varnish itself. See LICENCE for details. .INDENT 0.0 .IP \(bu 2 Copyright (c) 2007\-2014 Varnish Software AS .UNINDENT .\" Generated by docutils manpage writer. .\" .