[master] ed9d11c More test coverage

Poul-Henning Kamp phk at FreeBSD.org
Tue Mar 7 00:56:05 CET 2017


commit ed9d11cf46e65e2f226ca446c772b74ebe8c4c24
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Mar 6 23:49:18 2017 +0000

    More test coverage

diff --git a/bin/varnishtest/tests/m00008.vtc b/bin/varnishtest/tests/m00008.vtc
index 5912dc5..202ce56 100644
--- a/bin/varnishtest/tests/m00008.vtc
+++ b/bin/varnishtest/tests/m00008.vtc
@@ -1,7 +1,13 @@
-varnishtest "Test import vs. unsafe_path"
+varnishtest "VCL compiler vmod coverage / vmod loading"
 
 feature topbuild
 
+varnish v1 -errvcl {Module debug conflicts with other symbol.} {
+	backend b { .host = "127.0.0.1"; }
+	sub debug {}
+	import debug;
+}
+
 server s1 {
 	rxreq
 	txresp
@@ -32,3 +38,9 @@ varnish v1 -cliok "param.set vmod_path /nowhere:/else"
 varnish v1 -vcl+backend {
 	import std from "${topbuild}/lib/libvmod_std/.libs/";
 }
+
+varnish v1 -errvcl {Malformed VMOD std} {
+	backend default { .host = "${s1_sock}"; }
+	import std from "${topbuild}/lib/libvmod_debug/.libs/libvmod_debug.so";
+}
+
diff --git a/bin/varnishtest/tests/v00016.vtc b/bin/varnishtest/tests/v00016.vtc
index 2c3c232..8337ba7 100644
--- a/bin/varnishtest/tests/v00016.vtc
+++ b/bin/varnishtest/tests/v00016.vtc
@@ -2,6 +2,8 @@ varnishtest "Various VCL compiler coverage tests"
 
 shell "true > ${tmpdir}/_varnishtest_empty_file"
 
+feature dns
+
 varnish v1 -vcl {
 	backend b { .host = "127.0.0.1"; }
 	include "${tmpdir}/_varnishtest_empty_file" ;
@@ -72,3 +74,21 @@ varnish v1 -errvcl {Symbol not found: 'c' (expected type BACKEND):} {
 		}
 	}
 }
+
+varnish v1 -errvcl {Regexp compilation error:} {
+	backend b { .host = "127.0.0.1"; }
+	sub vcl_recv {
+		if (req.url ~ "[a") {}
+	}
+}
+
+varnish v1 -errvcl {resolves to neither IPv4 nor IPv6 addresses.} {
+	backend b { .host = "/"; }
+}
+
+varnish v1 -errvcl {resolves to too many addresses} {
+	backend b { .host = "127.0.0.1"; }
+	sub vcl_recv {
+		if (remote.ip == "varnish-cache.org") {}
+	}
+}
diff --git a/bin/varnishtest/tests/v00021.vtc b/bin/varnishtest/tests/v00021.vtc
index 5288ff5..8dd69ad 100644
--- a/bin/varnishtest/tests/v00021.vtc
+++ b/bin/varnishtest/tests/v00021.vtc
@@ -90,3 +90,8 @@ varnish v1 -vcl {
 		set resp.http.buckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckin = "foobar";
 	}
 }
+
+varnish v1 -errvcl {Unknown variable 'req.foobar'} {
+	backend foo { .host = "127.0.0.1"; }
+	sub vcl_recv { set req.foobar = 3; }
+}



More information about the varnish-commit mailing list