r5182 - trunk/varnish-cache/bin/varnishtest/tests

phk at varnish-cache.org phk at varnish-cache.org
Wed Sep 8 11:00:43 CEST 2010


Author: phk
Date: 2010-09-08 11:00:43 +0200 (Wed, 08 Sep 2010)
New Revision: 5182

Added:
   trunk/varnish-cache/bin/varnishtest/tests/m00000.vtc
Log:
Add the first 'm' class test, to exercise the vmod and std vmod.



Added: trunk/varnish-cache/bin/varnishtest/tests/m00000.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/m00000.vtc	                        (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/m00000.vtc	2010-09-08 09:00:43 UTC (rev 5182)
@@ -0,0 +1,26 @@
+# $Id$
+
+test "Test std vmod"
+
+server s1 {
+	rxreq 
+	txresp -hdr "foo: bAr" -hdr "bar: fOo" -bodylen 4
+} -start
+
+varnish v1 -vcl+backend {
+	import std from "${topsrc}/lib/libvmod_std/.libs/libvmod_std.so.1" ;
+
+	sub vcl_deliver {
+		set resp.http.foo = std.toupper(resp.http.foo);
+		set resp.http.bar = std.tolower(resp.http.bar);
+	}
+} -start
+
+client c1 {
+	txreq -url "/bar"
+	rxresp
+	expect resp.status == 200
+	expect resp.http.content-length == "4"
+	expect resp.http.foo == "BAR"
+	expect resp.http.bar == "foo"
+} -run




More information about the varnish-commit mailing list