[PATCH 3/3] Test case for expiry callbacks
Martin Blix Grydeland
martin at varnish-software.com
Wed Feb 25 16:00:15 CET 2015
---
bin/varnishtest/tests/m00021.vtc | 45 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
create mode 100644 bin/varnishtest/tests/m00021.vtc
diff --git a/bin/varnishtest/tests/m00021.vtc b/bin/varnishtest/tests/m00021.vtc
new file mode 100644
index 0000000..df70e02
--- /dev/null
+++ b/bin/varnishtest/tests/m00021.vtc
@@ -0,0 +1,45 @@
+varnishtest "Test expiry callbacks"
+
+server s1 {
+ rxreq
+ txresp
+} -start
+
+varnish v1 -vcl+backend {} -start
+
+varnish v1 -cliok "param.set debug +vclrel"
+
+logexpect l1 -v v1 -g raw {
+ expect * 0 Debug "exp_cb: registered"
+ expect * 0 Debug "exp_cb_insert: 0x[0-9a-f]+"
+ expect * 0 Debug "exp_cb_remove: 0x[0-9a-f]+"
+ expect * 0 Debug "exp_cb: deregistered"
+} -start
+
+varnish v1 -vcl+backend {
+ import ${vmod_debug};
+
+ sub vcl_recv {
+ if (req.method == "PURGE") {
+ return (purge);
+ }
+ }
+}
+
+client c1 {
+ txreq
+ rxresp
+ expect resp.status == 200
+
+ txreq -req PURGE
+ rxresp
+} -run
+varnish v1 -expect n_object == 0
+
+varnish v1 -vcl+backend {}
+varnish v1 -cliok "vcl.discard vcl2"
+varnish v1 -cliok "debug.vmod"
+varnish v1 -cliok "vcl.list"
+varnish v1 -expect vmods == 0
+
+logexpect l1 -wait
--
2.1.4
More information about the varnish-dev
mailing list