Page MenuHomePhabricator
Paste P8793

30-purge-hash_data.vtc
ActivePublic

Authored by ema on Jul 24 2019, 11:36 AM.
varnishtest "Cache key and PURGE"
server s1 {
rxreq
expect req.url == "/1"
txresp
} -start
varnish v1 -arg "-p vcl_path=${vcl_path} -p vcc_err_unref=false -p vcc_allow_inline_c=true -p cc_command='${cc_command}'" -vcl+backend {
backend vtc_backend {
.host = "${s1_addr}"; .port = "${s1_port}";
}
include "${basepath}/usr/share/varnish/tests/wikimedia_misc-backend.vcl";
}
# Attach the "wikimedia_misc" label to wikimedia_misc-backend.vcl
varnish v1 -cli "vcl.label wikimedia_misc vcl1"
varnish v1 -vcl {
backend vtc_backend {
.host = "${s1_addr}"; .port = "${s1_port}";
}
include "${basepath}/usr/share/varnish/tests/wikimedia_text-backend.vcl";
} -start
client c1 {
txreq -url "/1" -hdr "X-Subdomain: m" -hdr "Cookie: optin=beta"
rxresp
expect resp.status == 200
expect resp.http.X-Cache-Int ~ "miss"
txreq -url "/1" -hdr "X-Subdomain: m" -hdr "Cookie: optin=beta"
rxresp
expect resp.status == 200
expect resp.http.X-Cache-Int ~ "hit"
txreq -req PURGE -url "/1"
rxresp
expect resp.status == 204
txreq -url "/1" -hdr "X-Subdomain: m" -hdr "Cookie: optin=beta"
rxresp
expect resp.status == 200
# This should have been a miss!
expect resp.http.X-Cache-Int ~ "hit"
} -run