[4.1] 80a169e Backport m00025.vtc

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Sep 8 23:27:09 CEST 2016


commit 80a169e80ba8ccb9982140d5344c094688a8d415
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Thu Sep 8 23:25:35 2016 +0200

    Backport m00025.vtc

diff --git a/bin/varnishtest/tests/m00025.vtc b/bin/varnishtest/tests/m00025.vtc
new file mode 100644
index 0000000..cf78acd
--- /dev/null
+++ b/bin/varnishtest/tests/m00025.vtc
@@ -0,0 +1,13 @@
+varnishtest "Pass probe definitions to VMODs"
+
+varnish v1 -vcl {
+	import ${vmod_debug};
+
+	backend be { .host = "${bad_ip}"; }
+	probe pb { }
+
+	sub vcl_init {
+		debug.test_probe(pb);
+		debug.test_probe(pb, pb);
+	}
+}
diff --git a/lib/libvmod_debug/vmod.vcc b/lib/libvmod_debug/vmod.vcc
index 3ec9511..b905227 100644
--- a/lib/libvmod_debug/vmod.vcc
+++ b/lib/libvmod_debug/vmod.vcc
@@ -158,3 +158,7 @@ Perform an IP match against a named ACL.
 $Function BOOL barrier_sync(STRING)
 
 Synchronize with a varnishtest shared barrier.
+
+$Function VOID test_probe(PROBE probe, PROBE same = 0)
+
+Only here to make sure probe definitions are passed properly.
diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_debug.c
index cca54e8..f2e0c38 100644
--- a/lib/libvmod_debug/vmod_debug.c
+++ b/lib/libvmod_debug/vmod_debug.c
@@ -513,3 +513,13 @@ vmod_barrier_sync(VRT_CTX, VCL_STRING addr)
 		VSLb(ctx->vsl, SLT_Error, "Barrier unexpected data (%zdB)", sz);
 	return (0);
 }
+
+VCL_VOID
+vmod_test_probe(VRT_CTX, VCL_PROBE probe, VCL_PROBE same)
+{
+
+	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
+	CHECK_OBJ_NOTNULL(probe, VRT_BACKEND_PROBE_MAGIC);
+	CHECK_OBJ_ORNULL(same, VRT_BACKEND_PROBE_MAGIC);
+	AZ(same == NULL || probe == same);
+}



More information about the varnish-commit mailing list