[master] a468ee22d Add an out-of-workspace test for VMOD blob's sub() function.
Geoff Simmons
geoff at uplex.de
Wed Jul 18 12:47:07 UTC 2018
commit a468ee22deedbaa24c88e46864af638331c734e8
Author: Geoff Simmons <geoff at uplex.de>
Date: Wed Jul 18 14:45:50 2018 +0200
Add an out-of-workspace test for VMOD blob's sub() function.
diff --git a/bin/varnishtest/tests/m00049.vtc b/bin/varnishtest/tests/m00049.vtc
index 6850ffc26..17ea49e84 100644
--- a/bin/varnishtest/tests/m00049.vtc
+++ b/bin/varnishtest/tests/m00049.vtc
@@ -161,3 +161,26 @@ varnish v1 -vcl {
client c1 -run
client c2 -run
client c3 -run
+
+# sub() function
+varnish v1 -vcl {
+ import blob;
+ import vtc;
+ backend b { .host = "${bad_ip}"; }
+
+ sub vcl_miss {
+ if (req.url == "/1") {
+ # Not enough for req.hash + vmod_priv
+ vtc.workspace_alloc(client, -65);
+ }
+ elsif (req.url == "/2") {
+ # Not enough for req.hash + vmod_priv + 30 bytes
+ vtc.workspace_alloc(client, -90);
+ }
+ set req.http.Encode = blob.encode(blob=blob.sub(req.hash, 30B));
+ return( synth(200) );
+ }
+}
+
+client c1 -run
+client c2 -run
More information about the varnish-commit
mailing list