[master] 4c1b0345d Add a test case

Martin Blix Grydeland martin at varnish-software.com
Tue May 5 11:39:07 UTC 2020


commit 4c1b0345d32a58a095768996ef03fab9aa878e5f
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Fri Apr 24 16:34:46 2020 +0200

    Add a test case

diff --git a/bin/varnishtest/tests/r03301.vtc b/bin/varnishtest/tests/r03301.vtc
new file mode 100644
index 000000000..d39f31709
--- /dev/null
+++ b/bin/varnishtest/tests/r03301.vtc
@@ -0,0 +1,73 @@
+varnishtest "Issue 3301: Illegal error codes"
+
+varnish v1 -vcl {
+	backend default none;
+	sub vcl_recv {
+		if (req.url == "/test1") {
+			return (synth(1301));
+		}
+		if (req.url == "/test2") {
+			return (synth(1001));
+		}
+	}
+	sub vcl_backend_fetch {
+		if (bereq.url == "/test3") {
+			return (error(1302));
+		}
+		if (bereq.url == "/test4") {
+			return (error(1000));
+		}
+	}
+} -start
+
+varnish v1 -cliok "param.set feature +http2"
+
+client c1 {
+	stream 1 {
+		txreq -url /test1
+		rxresp
+		expect resp.status == 301
+	} -run
+
+	stream 3 {
+		txreq -url /test2
+		rxresp
+		expect resp.status == 503
+	} -run
+
+	stream 5 {
+		txreq -url /test3
+		rxresp
+		expect resp.status == 302
+	} -run
+
+	stream 7 {
+		txreq -url /test4
+		rxresp
+		expect resp.status == 503
+	} -run
+} -run
+
+client c2 {
+	txreq -url /test1
+	rxresp
+	expect resp.status == 301
+	expect resp.reason == "Moved Permanently"
+
+	txreq -url /test2
+	rxresp
+	expect resp.status == 503
+} -run
+
+client c2 {
+	txreq -url /test3
+	rxresp
+	expect resp.status == 302
+	expect resp.reason == "Found"
+} -run
+
+client c2 {
+	txreq -url /test4
+	rxresp
+	expect resp.status == 503
+} -run


More information about the varnish-commit mailing list