-
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: allow loading multiple files with vcl.load
This commit adds the ability to specify multiple vcl files with vcl.load cli command: vcl.load [-s auto|cold|warm] [-p vcl_path] <configname> <file1> [file2, ...]
- Loading branch information
Showing
7 changed files
with
97 additions
and
28 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,53 @@ | ||
varnishtest "Test vcl.load with multiple vcl files" | ||
|
||
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 'sub vcl_deliver {' | ||
echo ' set resp.http.test1 = "test1";' | ||
echo '}' | ||
) > ${tmpdir}/file1.vcl | ||
} | ||
|
||
shell { | ||
( | ||
echo 'vcl 4.0;' | ||
echo 'sub vcl_deliver {' | ||
echo ' set resp.http.test2 = "test2";' | ||
echo '}' | ||
) > ${tmpdir}/file2.vcl | ||
} | ||
|
||
shell { | ||
( | ||
echo 'vcl 4.0;' | ||
echo 'sub vcl_deliver {' | ||
echo ' set resp.http.test3 = "test3";' | ||
echo '}' | ||
) > ${tmpdir}/file3.vcl | ||
} | ||
|
||
varnish v1 -cliok {vcl.load -s cold foo ${tmpdir}/file1.vcl ${tmpdir}/file2.vcl ${tmpdir}/file3.vcl} | ||
varnish v1 -cliexpect "VCL 'foo' is cold" {vcl.use foo} | ||
varnish v1 -cliok {vcl.state foo warm} | ||
varnish v1 -cliok {vcl.use foo} | ||
|
||
client c1 { | ||
txreq | ||
rxresp | ||
expect resp.http.test1 == "test1" | ||
expect resp.http.test2 == "test2" | ||
expect resp.http.test3 == "test3" | ||
} -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
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