[7.0] 61a465e02 VRB_Ignore() errors and connection close test case

Martin Blix Grydeland martin at varnish-software.com
Tue Jan 25 11:06:07 UTC 2022


commit 61a465e022d3cee4925e47cf456b01b99e1d0b2f
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Fri Dec 17 22:10:27 2021 +0100

    VRB_Ignore() errors and connection close test case

diff --git a/bin/varnishtest/tests/f00008.vtc b/bin/varnishtest/tests/f00008.vtc
new file mode 100644
index 000000000..4d6161a35
--- /dev/null
+++ b/bin/varnishtest/tests/f00008.vtc
@@ -0,0 +1,56 @@
+varnishtest "VRB_Ignore and connection close"
+
+server s1 {
+	rxreq
+	txresp -body HIT
+} -start
+
+varnish v1 -arg "-p timeout_idle=1" -vcl+backend {
+	sub vcl_recv {
+		if (req.url == "/synth") {
+			return (synth(200, "SYNTH"));
+		}
+	}
+} -start
+
+# Prime an object
+client c1 {
+	txreq -url /hit
+	rxresp
+	expect resp.status == 200
+	expect resp.body == HIT
+} -run
+
+# Test synth
+client c2 {
+	txreq -req POST -url /synth -hdr "Content-Length: 2"
+	# Send 1 byte
+	send a
+	# Wait timeout_idle
+	delay 1.1
+	# Send 1 byte
+	send b
+	rxresp
+	expect resp.status == 200
+	expect resp.reason == SYNTH
+	expect resp.http.connection == close
+	timeout 0.5
+	expect_close
+} -run
+
+# Test cache hit
+client c3 {
+	txreq -req GET -url /hit -hdr "Content-Length: 2"
+	# Send 1 byte
+	send a
+	# Wait timeout_idle
+	delay 1.1
+	# Send 1 byte
+	send b
+	rxresp
+	expect resp.status == 200
+	expect resp.body == HIT
+	expect resp.http.connection == close
+	timeout 0.5
+	expect_close
+} -run


More information about the varnish-commit mailing list