-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: add -p <vcl_path> arg to vcl.load
This commit adds a -p argument to the vcl.load cli command to allow the user to specify a path that will be appended to the begining of VCL_PATH when loading the vcl
- Loading branch information
Showing
5 changed files
with
71 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
varnishtest "Test vcl.load -p arg" | ||
|
||
server s1 { | ||
rxreq | ||
txresp | ||
} -start | ||
|
||
varnish v1 -vcl+backend {} -start | ||
|
||
shell { | ||
( | ||
echo 'vcl 4.0;' | ||
echo 'backend default {' | ||
echo ' .host="${s1_addr}";' | ||
echo ' .port="${s1_port}";' | ||
echo '}' | ||
echo '' | ||
echo 'include "inc.vcl";' | ||
) > ${tmpdir}/c00123.vcl | ||
} | ||
|
||
shell { | ||
( | ||
echo 'sub vcl_deliver {' | ||
echo ' set resp.http.test = "c00123";' | ||
echo '}' | ||
) > ${tmpdir}/inc.vcl | ||
} | ||
|
||
varnish v1 -cliexpect "No such file or directory" {vcl.load foo c00123.vcl} | ||
|
||
varnish v1 -cliok {vcl.load -p ${tmpdir} foo c00123.vcl} | ||
varnish v1 -cliok {vcl.use foo} | ||
|
||
client c1 { | ||
txreq | ||
rxresp | ||
expect resp.http.test == "c00123" | ||
} -run |
This file contains 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