[master] de03c2c Switch varnishtest to default to vcl4.1

Poul-Henning Kamp phk at FreeBSD.org
Mon Feb 5 10:26:14 UTC 2018


commit de03c2cd88b904c19c2e71eee5baf74a1455ece1
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Feb 5 10:25:16 2018 +0000

    Switch varnishtest to default to vcl4.1

diff --git a/bin/varnishtest/tests/v00016.vtc b/bin/varnishtest/tests/v00016.vtc
index 937fa83..1d1637f 100644
--- a/bin/varnishtest/tests/v00016.vtc
+++ b/bin/varnishtest/tests/v00016.vtc
@@ -89,7 +89,7 @@ varnish v1 -errvcl {resolves to too many addresses} {
 	}
 }
 
-varnish v1 -errvcl {Undefined acl foo} {
+varnish v1 -errvcl {Symbol 'foo' has wrong type (instance):} {
 	import directors;
 	backend b { .host = "127.0.0.1"; }
 
@@ -103,7 +103,22 @@ varnish v1 -errvcl {Undefined acl foo} {
 	}
 }
 
-varnish v1 -errvcl {Symbol not found: 'foo'} {
+varnish v1 -syntax 4.0 -errvcl {Undefined acl foo} {
+	import directors;
+	backend b { .host = "127.0.0.1"; }
+
+	sub vcl_init {
+		new foo = directors.shard();
+	}
+	sub vcl_recv {
+		if (client.ip ~ foo) {
+			return (synth(200));
+		}
+	}
+}
+
+# 'foo' overloaded
+varnish v1 -syntax 4.0 -errvcl {Symbol not found: 'foo'} {
 	backend b { .host = "127.0.0.1"; }
 
 	acl foo {
diff --git a/bin/varnishtest/tests/v00018.vtc b/bin/varnishtest/tests/v00018.vtc
index afba076..bc152ec 100644
--- a/bin/varnishtest/tests/v00018.vtc
+++ b/bin/varnishtest/tests/v00018.vtc
@@ -127,7 +127,13 @@ varnish v1 -errvcl {Not a valid action in method 'vcl_recv'} {
 	}
 }
 
-varnish v1 -errvcl {Not a VCL label:} {
+varnish v1 -errvcl {Symbol 'vcl_recv' has wrong type (sub):} {
+	sub vcl_recv {
+		return (vcl(vcl_recv));
+	}
+}
+
+varnish v1 -syntax 4.0 -errvcl {Not a VCL label:} {
 	sub vcl_recv {
 		return (vcl(vcl_recv));
 	}
diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index 0917a49..73ca160 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -1014,7 +1014,7 @@ varnish_expect(const struct varnish *v, char * const *av)
  *         Stop the child process.
  *
  * \-syntax
- *         Set the VCL syntax level for this command (default: 4.0)
+ *         Set the VCL syntax level for this command (default: 4.1)
  *
  * \-wait
  *         Wait for that instance to terminate.
@@ -1087,7 +1087,7 @@ cmd_varnish(CMD_ARGS)
 	if (v == NULL)
 		v = varnish_new(av[0]);
 	av++;
-	v->syntax = 4.0;
+	v->syntax = 4.1;
 
 	for (; *av != NULL; av++) {
 		if (vtc_error)


More information about the varnish-commit mailing list