diff h2_max_requests.t @ 1668:0c1bd4c23c95

Tests: $connection_requests and $connection_time tests.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 08 Apr 2021 14:51:04 +0300
parents bdebd63dbab3
children 5ac6efbe5552
line wrap: on
line diff
--- a/h2_max_requests.t
+++ b/h2_max_requests.t
@@ -63,6 +63,8 @@ http {
 
         keepalive_time 1s;
 
+        add_header X-Conn $connection_requests:$connection_time;
+
         location / { }
     }
 }
@@ -75,7 +77,7 @@ EOF
 # suppress deprecation warning
 
 open OLDERR, ">&", \*STDERR; close STDERR;
-$t->try_run('no keepalive_time')->plan(17);
+$t->try_run('no keepalive_time')->plan(19);
 open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
@@ -158,6 +160,7 @@ ok($frame, 'keepalive_timeout 0 - GOAWAY
 
 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
 is($frame->{headers}->{':status'}, 200, 'keepalive time request');
+like($frame->{headers}->{'x-conn'}, qr/^1:0/, 'keepalive time variables');
 
 $frames = $s->read(all => [{ type => 'GOAWAY' }], wait => 0.5);
 
@@ -171,6 +174,7 @@ select undef, undef, undef, 1.1;
 
 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
 is($frame->{headers}->{':status'}, 200, 'keepalive time request 2');
+like($frame->{headers}->{'x-conn'}, qr/^2:[^0]/, 'keepalive time variables 2');
 
 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
 ok($frame, 'keepalive time limit - GOAWAY');