changeset 738:0881219c0699

Tests: HTTP/2 tests for Upgrade-based negotiation.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 19 Oct 2015 17:03:04 +0300
parents abf42eb6cf48
children 610e394a6e73
files h2.t
diffstat 1 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h2.t
+++ b/h2.t
@@ -32,7 +32,7 @@ plan(skip_all => 'IO::Socket::SSL too ol
 
 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/)
 	->has(qw/limit_conn rewrite realip shmem/)
-	->has_daemon('openssl')->plan(223);
+	->has_daemon('openssl')->plan(225);
 
 # Some systems have a bug in not treating zero writev iovcnt as EINVAL
 
@@ -261,6 +261,25 @@ my %cframe = (
 
 ###############################################################################
 
+# Upgrade mechanism
+
+my $r = http(<<EOF);
+GET / HTTP/1.1
+Host: localhost
+Connection: Upgrade, HTTP2-Settings
+Upgrade: h2c
+HTTP2-Settings: AAMAAABkAAQAAP__
+
+EOF
+
+SKIP: {
+skip 'no Upgrade-based negotiation', 2 if $r !~ m!HTTP/1.1 101!;
+
+like($r, qr!Connection: Upgrade!, 'upgrade - connection');
+like($r, qr!Upgrade: h2c!, 'upgrade - token');
+
+}
+
 # SETTINGS
 
 my $sess = new_session();