[master] 4edf07e Change the remaining badvcl to errvcl

Poul-Henning Kamp phk at varnish-cache.org
Thu Oct 25 11:13:24 CEST 2012


commit 4edf07ee3ede3fd48a1ceaf20bd9df98dc0da8b4
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Oct 25 09:13:06 2012 +0000

    Change the remaining badvcl to errvcl

diff --git a/bin/varnishtest/tests/v00003.vtc b/bin/varnishtest/tests/v00003.vtc
index ec4248d..f519721 100644
--- a/bin/varnishtest/tests/v00003.vtc
+++ b/bin/varnishtest/tests/v00003.vtc
@@ -1,35 +1,35 @@
 varnishtest "VCL: test syntax/semantic checks on director decls."
 
 # syntax in inline backend
-varnish v1 -badvcl {
+varnish v1 -errvcl {Unknown field: 'foo' at} {
 	director r1 random {
 		{ .backend = { .foo = 2; }; .weight = 1;}
 	}
 }
 
 # reference to unknown backend host
-varnish v1 -badvcl {
+varnish v1 -errvcl {Reference to unknown backend 'b2' at} {
 	director r1 random {
 		{ .backend = b2; .weight = 1; }
 	}
 }
 
 # missing backend
-varnish v1 -badvcl {
+varnish v1 -errvcl {Mandatory field 'backend' missing.} {
 	director r1 random {
 		{ .weight = 1; }
 	}
 }
 
 # invalid weight
-varnish v1 -badvcl {
+varnish v1 -errvcl {Expected CNUM got 'k'} {
 	director r1 random {
 		{ .backend = {.host = "127.0.0.1";}  .weight = k; }
 	}
 }
 
 # invalid weight
-varnish v1 -badvcl {
+varnish v1 -errvcl {The .weight must be higher than zero.} {
 	director r1 random {
 		{ .backend = {.host = "127.0.0.1";}  .weight = 0; }
 	}
@@ -43,14 +43,14 @@ varnish v1 -vcl {
 	}
 }
 	
-varnish v1 -badvcl {
+varnish v1 -errvcl {Unknown field: 'foobar' at} {
 	director r1 random {
 		.foobar = 3;
 		{ .backend = {.host = "127.0.0.1";}  .weight = 1; }
 	}
 }
 	
-varnish v1 -badvcl {
+varnish v1 -errvcl {Expected CNUM got 'x'} {
 	director r1 random {
 		.retries = x;
 		{ .backend = {.host = "127.0.0.1";}  .weight = 1; }
diff --git a/bin/varnishtest/tests/v00005.vtc b/bin/varnishtest/tests/v00005.vtc
index a84d3be..0b4b780 100644
--- a/bin/varnishtest/tests/v00005.vtc
+++ b/bin/varnishtest/tests/v00005.vtc
@@ -33,7 +33,7 @@ varnish v1 -vcl {
 }
 
 # Check redefinition
-varnish v1 -badvcl {
+varnish v1 -errvcl {Probe request redefinition at:} {
 	backend b1 {
 		.host = "127.0.0.1";
 		.probe = {
@@ -46,7 +46,7 @@ varnish v1 -badvcl {
 }
 
 # Check redefinition the other way
-varnish v1 -badvcl {
+varnish v1 -errvcl {Probe request redefinition at:} {
 	backend b1 {
 		.host = "127.0.0.1";
 		.probe = {
diff --git a/bin/varnishtest/tests/v00016.vtc b/bin/varnishtest/tests/v00016.vtc
index 691cc56..5b17ed6 100644
--- a/bin/varnishtest/tests/v00016.vtc
+++ b/bin/varnishtest/tests/v00016.vtc
@@ -7,14 +7,14 @@ varnish v1 -vcl {
 	include "${tmpdir}/_varnishtest_empty_file" ;
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {include <string> not followed by semicolon.} {
 	backend b { .host = "127.0.0.1"; }
 	include "${tmpdir}/_varnishtest_empty_file" |
 }
 
 shell "rm -f ${tmpdir}/_varnishtest_empty_file"
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {include not followed by string constant.} {
 	backend b { .host = "127.0.0.1"; }
 	include <<
 }
@@ -29,7 +29,7 @@ varnish v1 -vcl {
 	}
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {include not followed by string constant.} {
 	/* token test */
         error lookup hash pipe pass fetch deliver discard keep restart
         include 
@@ -73,22 +73,22 @@ varnish v1 -vcl {
 	
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Unknown time unit 'k'.  Legal are 's', 'm', 'h' and 'd'} {
 	backend b { .host = "127.0.0.1"; }
 	sub vcl_fetch { set obj.ttl = 1. k; }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Expression has type DURATION, expected BOOL} {
 	backend b { .host = "127.0.0.1"; }
 	sub vcl_fetch { if (obj.ttl *= 2) { } }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Operator > not possible on BACKEND} {
 	backend b { .host = "127.0.0.1"; }
 	sub vcl_recv { if (req.backend > b) { } }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Symbol not found: 'req.hash' (expected type BOOL):} {
 	backend b { .host = "127.0.0.1"; }
 	sub vcl_hash { if (req.hash != "foo") { } }
 }
diff --git a/bin/varnishtest/tests/v00017.vtc b/bin/varnishtest/tests/v00017.vtc
index 66d54fb..9c385f5 100644
--- a/bin/varnishtest/tests/v00017.vtc
+++ b/bin/varnishtest/tests/v00017.vtc
@@ -1,12 +1,12 @@
 varnishtest "VCL compiler coverage test: vcc_acl.c"
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Too wide mask (33) for IPv4 address} {
 	backend b { .host = "127.0.0.1"; }
 	acl a { "10.1.2.3"/33; }
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Too wide mask (129) for IPv6 address} {
 	backend b { .host = "127.0.0.1"; }
 	acl a { "1::2"/129; }
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
@@ -21,7 +21,7 @@ varnish v1 -vcl {
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Conflicting ACL entries:} {
 	backend b { .host = "127.0.0.1"; }
 	acl a {
 		"1.2.3.4";
@@ -30,25 +30,25 @@ varnish v1 -badvcl {
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {DNS lookup(...com): } {
 	backend b { .host = "127.0.0.1"; }
 	acl a { "...com"; }
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {DNS lookup(10.1.2.): } {
 	backend b { .host = "127.0.0.1"; }
 	acl a { "10.1.2."; }
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Expected ')' got ';'} {
 	backend b { .host = "127.0.0.1"; }
 	acl a { ( "10.1.2"; }
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Expected ';' got ')'} {
 	backend b { .host = "127.0.0.1"; }
 	acl a { "10.1.2" ); }
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
@@ -70,7 +70,7 @@ varnish v1 -vcl {
 	sub vcl_miss { if (client.ip != "127.0.0.1") { return(pass); } }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Operator > not possible on IP} {
 	backend b { .host = "127.0.0.1"; }
 	sub vcl_recv { if (client.ip > "127.0.0.1") { return(pass); } }
 }
diff --git a/bin/varnishtest/tests/v00019.vtc b/bin/varnishtest/tests/v00019.vtc
index eabcdd0..b8e5466 100644
--- a/bin/varnishtest/tests/v00019.vtc
+++ b/bin/varnishtest/tests/v00019.vtc
@@ -1,6 +1,6 @@
 varnishtest "VCL compiler coverage test: vcc_token.c"
 
-varnish v1 -badvcl " C{ "
+varnish v1 -errvcl {Unterminated inline C source, starting at} " C{ "
 
 varnish v1 -vcl {
 	backend b { .host = "127.0.0.1"; }
@@ -8,17 +8,17 @@ varnish v1 -vcl {
 	sub vcl_recv { set req.url = "x"; }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Unterminated /* ... */ comment, starting at} {
 	backend b { .host = "127.0.0.1"; }
 	/*
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Unterminated long-string, starting at} {
 	backend b { .host = "127.0.0.1"; }
 	{" }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Unterminated string at} {
 	backend b { .host = "127.0.0.1"; }
 	"
 }
@@ -28,12 +28,12 @@ varnish v1 -vcl {
 	sub vcl_recv { C{ int i; (void)i; }C }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Syntax error at} {
 	backend b { .host = "127.0.0.1"; }
 	?
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
 	backend b { .host = "127.0.0.1"; }
 	sub vcl_recv {
 		if ("foo" + "bar" == 777) {
@@ -42,7 +42,7 @@ varnish v1 -badvcl {
 	}
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
 	backend b { .host = "127.0.0.1"; }
 	sub vcl_recv {
 		if ("foo" + "bar" ==
@@ -52,7 +52,7 @@ varnish v1 -badvcl {
 	}
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
 	backend b { .host = "127.0.0.1"; }
 	sub vcl_recv {
 		if ("foo" + "bar" ==
diff --git a/bin/varnishtest/tests/v00030.vtc b/bin/varnishtest/tests/v00030.vtc
index a2dff48..9e855ec 100644
--- a/bin/varnishtest/tests/v00030.vtc
+++ b/bin/varnishtest/tests/v00030.vtc
@@ -1,6 +1,6 @@
 varnishtest "DNS director bad VCL tests"
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Expected '.' got '192'} {
        director directorname dns {
                .list = {
                        192.168.15.0/24;
@@ -8,7 +8,7 @@ varnish v1 -badvcl {
        }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl "Expected '.' got '}'" {
        director directorname dns {
                .list = {
                        .host_header = "www.example.com";
@@ -18,7 +18,7 @@ varnish v1 -badvcl {
        }
 }
 
-varnish v9 -badvcl {
+varnish v9 -errvcl {Unknown field: 'host_hdr' at} {
        director directorname dns {
                .list = {
                        .host_hdr = "192.168.1.1";
@@ -26,7 +26,7 @@ varnish v9 -badvcl {
                }
        }
 }
-varnish v1 -badvcl {
+varnish v1 -errvcl {Unknown field: 'host_hdr' at} {
        director directorname dns {
                .list = {
                        .host_hdr = "www.example.com";
@@ -35,7 +35,7 @@ varnish v1 -badvcl {
        }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Expected CSTR got '80'} {
        director directorname dns {
                .list = {
                        .port = 80;
@@ -43,7 +43,9 @@ varnish v1 -badvcl {
                }
        }
 }
-varnish v1 -badvcl {
+
+# XXX: reported token should be improved
+varnish v1 -errvcl {IP and network mask not compatible: ';' at} {
        director directorname dns {
                .list = {
                        "192.168.15.0"/33;
@@ -51,7 +53,8 @@ varnish v1 -badvcl {
        }
 }
 
-varnish v1 -badvcl {
+# XXX: reported token should be improved
+varnish v1 -errvcl {IP and network mask not compatible: ';' at} {
        director directorname dns {
                .list = {
                        "192.168.16.255"/24;
diff --git a/bin/varnishtest/tests/v00031.vtc b/bin/varnishtest/tests/v00031.vtc
index 0bae6e0..70ca757 100644
--- a/bin/varnishtest/tests/v00031.vtc
+++ b/bin/varnishtest/tests/v00031.vtc
@@ -1,6 +1,6 @@
 varnishtest "param vcc_err_unref"
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Unused backend c, defined:} {
 	backend b { .host = "127.0.0.1"; }
 	backend c { .host = "127.0.0.1"; }
 }
@@ -14,7 +14,7 @@ varnish v1 -vcl {
 
 varnish v1 -cliok "param.set vcc_err_unref true"
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Unused backend c, defined:} {
 	backend b { .host = "127.0.0.1"; }
 	backend c { .host = "127.0.0.1"; }
 }
diff --git a/bin/varnishtest/tests/v00033.vtc b/bin/varnishtest/tests/v00033.vtc
index 403931d..ceb5c12 100644
--- a/bin/varnishtest/tests/v00033.vtc
+++ b/bin/varnishtest/tests/v00033.vtc
@@ -37,13 +37,13 @@ client c1 {
 	expect resp.http.bar == true
 } -run
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Expected BYTES unit (B, KB, MB...) got '"X"'} {
 	sub vcl_recv {
 		if (storage.nowhere.free_space > 4 "X") {
 		}
 	}
 }
-varnish v1 -badvcl {
+varnish v1 -errvcl {Unknown BYTES unit 'X'.  Legal are 'B', 'KB', 'MB', 'GB' and 'TB'} {
 	sub vcl_recv {
 		if (storage.nowhere.free_space > 4 X) {
 		}
diff --git a/bin/varnishtest/tests/v00034.vtc b/bin/varnishtest/tests/v00034.vtc
index fdc6e20..f7d4ed0 100644
--- a/bin/varnishtest/tests/v00034.vtc
+++ b/bin/varnishtest/tests/v00034.vtc
@@ -7,19 +7,19 @@ server s1 {
 
 varnish v1 -vcl+backend { } -start
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Function c1 redefined} {
 	backend foo { .host = "127.0.0.1"; }
 	sub c1 { }
 	sub c1 { }
 	sub vcl_recv { call c1; }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Backend s1 redefined} {
 	backend s1 { .host = "127.0.0.1"; }
 	backend s1 { .host = "127.0.0.1"; }
 }
 
-varnish v1 -badvcl {
+varnish v1 -errvcl {Probe p1 redefined} {
 	backend s1 { .host = "127.0.0.1"; .probe = p1;}
 	probe p1 { }
 	probe p1 { }



More information about the varnish-commit mailing list