[master] 9091a9ac0 vtc: Move setenv coverage to the right category

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Sep 10 12:45:07 UTC 2021


commit 9091a9ac0c3237f2e2de9858b077171bcab2cc2a
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Sep 10 14:31:37 2021 +0200

    vtc: Move setenv coverage to the right category

diff --git a/bin/varnishtest/tests/a00022.vtc b/bin/varnishtest/tests/a00022.vtc
new file mode 100644
index 000000000..86a26e86f
--- /dev/null
+++ b/bin/varnishtest/tests/a00022.vtc
@@ -0,0 +1,10 @@
+varnishtest "Test setenv"
+
+setenv FOO "BAR BAZ"
+shell -expect "BAR BAZ" {echo $FOO}
+
+setenv -ifunset FOO QUUX
+shell -expect "BAR BAZ" {echo $FOO}
+
+setenv FOO QUUX
+shell -expect QUUX {echo $FOO}
diff --git a/bin/varnishtest/tests/m00028.vtc b/bin/varnishtest/tests/m00028.vtc
deleted file mode 100644
index 3f527a646..000000000
--- a/bin/varnishtest/tests/m00028.vtc
+++ /dev/null
@@ -1,73 +0,0 @@
-varnishtest "Test setenv"
-
-setenv FOO "BAR BAZ"
-
-varnish v1 -vcl {
-	import std;
-
-	backend dummy { .host = "${bad_ip}"; .port = "9080"; }
-
-	sub vcl_recv {
-		return(synth(200));
-	}
-
-	sub vcl_synth {
-		set resp.http.X-FOO = std.getenv("FOO");
-	}
-} -start
-
-client c1 {
-	txreq
-	rxresp
-	expect resp.http.X-FOO == "BAR BAZ"
-} -run
-
-varnish v1 -stop
-
-setenv -ifunset FOO QUUX
-
-varnish v2 -vcl {
-	import std;
-
-	backend dummy { .host = "${bad_ip}"; .port = "9080"; }
-
-	sub vcl_recv {
-		return(synth(200));
-	}
-
-	sub vcl_synth {
-		set resp.http.X-FOO = std.getenv("FOO");
-	}
-} -start
-
-client c2 -connect ${v2_sock} {
-	txreq
-	rxresp
-	expect resp.http.X-FOO == "BAR BAZ"
-} -run
-
-varnish v2 -stop
-
-setenv FOO QUUX
-
-varnish v3 -vcl {
-	import std;
-
-	backend dummy { .host = "${bad_ip}"; .port = "9080"; }
-
-	sub vcl_recv {
-		return(synth(200));
-	}
-
-	sub vcl_synth {
-		set resp.http.X-FOO = std.getenv("FOO");
-	}
-} -start
-
-client c3 -connect ${v3_sock} {
-	txreq
-	rxresp
-	expect resp.http.X-FOO == "QUUX"
-} -run
-
-varnish v2 -stop


More information about the varnish-commit mailing list