Commit 5e36127a authored by Geoff Simmons's avatar Geoff Simmons

add test g00002.vtc

parent 2851f4b9
varnishtest "test basic gunzip for client"
server s1 {
rxreq
expect req.http.accept-encoding == "gzip"
expect req.url == "/foo"
txresp -proto HTTP/1.0 -nolen -gziplen 4100
accept
rxreq
expect req.url == "/bar"
txresp -body {<H1><esi:include src="/foo"/></H1>}
} -start
varnish v1 \
-arg "-smalloc,2m" \
-cliok "param.set http_gzip_support true" \
-cliok "param.set gzip_memlevel 1" \
-vcl {
import backend_dyn from "${vmod_topbuild}/src/.libs/libvmod_backend_dyn.so";
backend dummy { .host = "${bad_ip}"; }
sub vcl_init {
if (!backend_dyn.create(name="be", host="${s1_addr}",
port="${s1_port}")) {
return(fail);
}
}
sub vcl_recv {
set req.backend_hint = backend_dyn.by_name("be");
}
sub vcl_backend_response {
set beresp.do_esi = true;
}
} -start
varnish v1 -cliok "param.set fetch_chunksize 4k"
varnish v1 -cliok "param.set vsl_mask +VfpAcct"
client c1 {
txreq -url /foo -hdr "Accept-Encoding: gzip"
rxresp
gunzip
expect resp.http.content-encoding == "gzip"
expect resp.bodylen == 4100
} -run
# If this fails, the multiple storage allocations did not happen
varnish v1 -expect SMA.s0.c_req > 2
client c1 {
# See varnish can gunzip it.
txreq -url /foo -hdr "Accept-Encoding: null"
rxresp
expect resp.http.content-encoding == <undef>
expect resp.bodylen == 4100
delay .1
# See varnish can gunzip it, inside ESI
txreq -url /bar -hdr "Accept-Encoding: null"
rxresp
expect resp.http.content-encoding == <undef>
expect resp.bodylen == 4109
} -run
varnish v1 -expect VBE.vcl1.be.happy == 0
varnish v1 -expect MAIN.n_backend == 2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment