Created
November 13, 2008 18:05
-
-
Save nkallen/24538 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test "Authorization tokens are cached" | |
server s { | |
rxreq | |
expect req.url == "/" | |
expect req.http.Authorization == "Basic foo" | |
txresp -status 200 | |
rxreq | |
expect req.url == "/" | |
expect req.http.Authorization == "Basic bar" | |
txresp -status 404 | |
} -start | |
varnish v -vcl+backend { | |
include "/usr/local/etc/varnish/default.vcl"; | |
} -start | |
client c1 { | |
txreq -req GET -url "/" -hdr "Authorization: Basic foo" | |
rxresp | |
txreq -req GET -url "/" -hdr "Authorization: Basic foo" | |
rxresp | |
} -run | |
client c2 { | |
txreq -req GET -url "/" -hdr "Authorization: Basic bar" | |
rxresp | |
expect resp.status == 404 | |
txreq -req GET -url "/" -hdr "Authorization: Basic bar" | |
rxresp | |
expect resp.status == 404 | |
} -run | |
varnish v -expect cache_hit == 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment