[master] d55f0f0ab Rescue the testcase from #3193

Poul-Henning Kamp phk at FreeBSD.org
Thu May 6 06:11:07 UTC 2021


commit d55f0f0ab9baa5c1f7ece34b43cf8e87bc0ebca1
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu May 6 06:10:21 2021 +0000

    Rescue the testcase from #3193

diff --git a/bin/varnishtest/tests/c00053.vtc b/bin/varnishtest/tests/c00053.vtc
index 6a8e50bb1..20a5f1854 100644
--- a/bin/varnishtest/tests/c00053.vtc
+++ b/bin/varnishtest/tests/c00053.vtc
@@ -1,4 +1,4 @@
-varnishtest "Test include vs. unsafe_path"
+varnishtest "Test include vs. unsafe_path and include glob-ing"
 
 server s1 {
 	rxreq
@@ -25,3 +25,45 @@ varnish v1 -vcl+backend {
 }
 
 shell "rm -f ${tmpdir}/_.c00053"
+
+# Testing of include +glob
+
+varnish v1 -cliok "param.set vcc_unsafe_path on"
+
+varnish v1 -errvcl "glob pattern matched no files." {
+	vcl 4.0;
+
+	include +glob "${tmpdir}/Q*.vcl";
+}
+
+shell {
+	echo 'sub vcl_deliver { set resp.http.foo = "foo"; }' > ${tmpdir}/sub_foo.vcl
+	echo 'sub vcl_deliver { set resp.http.bar = "bar"; }' > ${tmpdir}/sub_bar.vcl
+	echo 'vcl 4.0; backend default { .host = "0:0"; } include +glob "./sub_*.vcl";' > ${tmpdir}/top.vcl
+}
+
+varnish v1 -vcl+backend {
+	include +glob "${tmpdir}/sub_*.vcl";
+} -start
+
+client c1 {
+	txreq
+	rxresp
+	expect resp.http.foo == foo
+	expect resp.http.bar == bar
+} -run
+
+varnish v1 -errvcl {needs absolute filename of including file.} {
+	include +glob "./sub_*.vcl";
+	backend default none;
+}
+
+varnish v1 -cliok "vcl.load foo ${tmpdir}/top.vcl"
+varnish v1 -cliok "vcl.use foo"
+
+client c1 {
+	txreq
+	rxresp
+	expect resp.http.foo == foo
+	expect resp.http.bar == bar
+} -run


More information about the varnish-commit mailing list