[master] 75ce6ba Document expect

Guillaume Quintard guillaume at varnish-software.com
Mon Jun 6 11:01:09 CEST 2016


commit 75ce6ba09a26ee40322e85b0cee8990e50fe4a94
Author: Guillaume Quintard <guillaume at varnish-software.com>
Date:   Wed Jun 1 18:12:35 2016 +0200

    Document expect

diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index 7b49a13..184384c 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -256,8 +256,40 @@ http_count_header(char * const *hh, const char *hdr)
 	return (r);
 }
 
-/**********************************************************************
- * Expect
+/* SECTION: client-server.spec.expect
+ *
+ * expect STRING1 OP STRING2
+ *         Test if "STRING1 OP STRING2" is true, and if not, fails the test.
+ *         OP can be ==, <, <=, >, >= when STRING1 and STRING2 represent numbers
+ *         in which case it's an order operator. If STRING1 and STRING2 are
+ *         meant as strings OP is a matching operator, either == (exact match)
+ *         or ~ (regex match).
+ *
+ *         varnishtet will first try to resolve STRING1 and STRING2 by looking
+ *         if they have special meanings, in which case, the resolved value is
+ *         use for the test. Note that this value can be a string representing a
+ *         number, allowing for tests such as::
+ *
+ *                 expect req.http.x-num > 2
+ *
+ *         Here's the list of recognized strings, most should be obvious as they
+ *         either match VCL logic, or the txreq/txresp options:
+ *
+ *         - remote.ip
+ *         - remote.port
+ *         - req.method
+ *         - req.url
+ *         - req.proto
+ *         - resp.proto
+ *         - resp.status
+ *         - resp.msg
+ *         - resp.chunklen
+ *         - req.bodylen
+ *         - req.body
+ *         - resp.bodylen
+ *         - resp.body
+ *         - req.http.NAME
+ *         - resp.http.NAME
  */
 
 static const char *



More information about the varnish-commit mailing list