Created
February 11, 2020 15:23
-
-
Save rezan/252929df43a6ae2cb69ad27b730251f7 to your computer and use it in GitHub Desktop.
VTC with v1 routing to itself
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
varnishtest "VTC with v1 routing to itself" | |
# Start v1 with no VCL so we can get a addr and port | |
server s1 {} -start | |
varnish v1 -vcl+backend {} -start | |
varnish v1 -vcl+backend { | |
backend self | |
{ | |
.host = "${v1_addr}"; | |
.port = "${v1_port}"; | |
} | |
sub vcl_recv | |
{ | |
if (!req.http.self) { | |
set req.backend_hint = self; | |
set req.http.self = "true"; | |
return (pass); | |
} else { | |
return (synth(200, "SELF")); | |
} | |
} | |
} | |
client c1 { | |
txreq | |
rxresp | |
expect resp.status == 200 | |
expect resp.reason == "SELF" | |
} -run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment