[master] 88f326a Add a testcase for H1->H2 upgrade

Poul-Henning Kamp phk at FreeBSD.org
Wed Sep 7 09:26:11 CEST 2016


commit 88f326a799c05b8f3d4256ede612c6b08abbb720
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Sep 7 07:02:33 2016 +0000

    Add a testcase for H1->H2 upgrade

diff --git a/bin/varnishtest/tests/t02000.vtc b/bin/varnishtest/tests/t02000.vtc
index f4d660c..89211f9 100644
--- a/bin/varnishtest/tests/t02000.vtc
+++ b/bin/varnishtest/tests/t02000.vtc
@@ -1,4 +1,4 @@
-varnishtest	"simple H2 get"
+varnishtest	"Direct H2 start"
 
 server s1 {
 	rxreq
diff --git a/bin/varnishtest/tests/t02001.vtc b/bin/varnishtest/tests/t02001.vtc
new file mode 100644
index 0000000..2fc8e54
--- /dev/null
+++ b/bin/varnishtest/tests/t02001.vtc
@@ -0,0 +1,29 @@
+varnishtest	"H1->H2 Upgrade"
+
+server s1 {
+	rxreq
+	expect req.http.host == foo.bar
+	txresp -status 400 -bodylen 10
+} -start
+
+varnish v1 -vcl+backend {} -start
+
+varnish v1 -cliok "param.set feature +http2"
+varnish v1 -cliok "param.set debug +syncvsl"
+
+client c1 {
+	send "GET / HTTP/1.1\r\n"
+	send "Host: foo.bar\r\n"
+	send "Upgrade: h2c\r\n"
+	send "HTTP2-Settings: AAMAAABkAAQAAP__\r\n"
+	send "\r\n"
+	rxresp
+	expect resp.status == 101
+	expect resp.http.upgrade == h2c
+	expect resp.http.connection == Upgrade
+	stream 1 {
+		rxresp
+		expect resp.status == 400
+		expect resp.bodylen == 10
+	} -run
+} -run



More information about the varnish-commit mailing list