Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-backend_dyn
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carl P. Corliss
libvmod-backend_dyn
Commits
42015170
Commit
42015170
authored
Nov 08, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test g00006.vtc
parent
2b8f60c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
102 additions
and
0 deletions
+102
-0
g00006.vtc
src/tests/g00006.vtc
+102
-0
No files found.
src/tests/g00006.vtc
0 → 100644
View file @
42015170
varnishtest "Backend IMS'ing g[un]zip'ed objects"
server s1 {
rxreq
expect req.url == /1
txresp -hdr "Last-Modified: Wed, 11 Sep 2013 13:36:55 GMT" \
-hdr {ETag: "foozle"} \
-bodylen 20
rxreq
expect req.url == /1
expect req.http.if-modified-since == "Wed, 11 Sep 2013 13:36:55 GMT"
txresp -status 304 \
-hdr {ETag: "fizle"} \
-nolen
rxreq
expect req.url == /2
txresp -hdr "Last-Modified: Wed, 11 Sep 2013 13:36:55 GMT" \
-hdr {ETag: "foobar"} \
-gzipbody "012345678901234567"
rxreq
expect req.url == /2
expect req.http.if-modified-since == "Wed, 11 Sep 2013 13:36:55 GMT"
txresp -status 304 -hdr "Content-Encoding: gzip,rot13" \
-hdr {ETag: "snafu"} \
-nolen
} -start
varnish v1 -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.http.foobar = beresp.http.content-encoding;
if (bereq.url == "/1") {
set beresp.do_gzip = true;
} else {
set beresp.do_gunzip = true;
}
set beresp.ttl = 1s;
set beresp.grace = 0s;
set beresp.keep = 60s;
}
} -start
client c1 {
txreq -url /1 -hdr "Accept-Encoding: gzip"
rxresp
expect resp.http.content-encoding == "gzip"
expect resp.http.foobar == ""
expect resp.http.etag == {W/"foozle"}
gunzip
expect resp.bodylen == 20
delay 1
txreq -url /1 -hdr "Accept-Encoding: gzip"
rxresp
expect resp.http.content-encoding == "gzip"
expect resp.http.foobar == "gzip"
expect resp.http.etag == {W/"fizle"}
gunzip
expect resp.bodylen == 20
delay .2
txreq -url /2
rxresp
expect resp.http.content-encoding == "<undef>"
expect resp.http.foobar == "gzip"
expect resp.bodylen == 18
expect resp.http.etag == {W/"foobar"}
delay 1
txreq -url /2
rxresp
expect resp.http.content-encoding == "<undef>"
# Here we see the C-E of the IMS OBJ
expect resp.http.foobar == ""
expect resp.http.etag == {W/"snafu"}
expect resp.bodylen == 18
} -run
varnish v1 -expect VBE.vcl1.be.happy == 0
varnish v1 -expect MAIN.n_backend == 2
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment