Sign inSign up

komivlad/varnishtest

By komivlad

•Updated over 7 years ago

varnish-4.1.10 revision 1d090c5a08f41c36562644bafcce9d3cb85d824f

Image
0

209

komivlad/varnishtest repository overview

Varnishtest docker image
varnish-4.1.10 revision 1d090c5a08f41c36562644bafcce9d3cb85d824f
for run tests
docker run --rm -v $(pwd):/tmp komivlad/varnishtest /test_varnish.sh
tests file should named
tests.vtc
example from official doc

varnishtest "#1029"

server s1 {
        rxreq
        expect req.url == "/bar"
        txresp -gzipbody {[bar]}

        rxreq
        expect req.url == "/foo"
        txresp -body {<h1>FOO<esi:include src="/bar"/>BARF</h1>}

} -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

Tag summary

Content type

Image

Digest

Size

90 MB

Last updated

over 7 years ago

docker pull komivlad/varnishtest