Mercurial > hg > nginx-tests
changeset 1663:bf69dcabb856
Tests: $sent_http_keep_alive tests (ticket #1850).
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 22 Mar 2021 18:53:09 +0300 |
parents | 7f1579e4372a |
children | 0fae67763be5 |
files | http_keepalive.t |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/http_keepalive.t +++ b/http_keepalive.t @@ -24,7 +24,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http/)->plan(14) +my $t = Test::Nginx->new()->has(qw/http/)->plan(15) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -37,8 +37,10 @@ events { http { %%TEST_GLOBALS_HTTP%% - log_format test $sent_http_connection; - access_log %%TESTDIR%%/test.log test if=$arg_l; + log_format test1 $sent_http_connection; + log_format test2 $sent_http_keep_alive; + access_log %%TESTDIR%%/test1.log test1 if=$arg_l; + access_log %%TESTDIR%%/test2.log test2 if=$arg_l; server { listen 127.0.0.1:8080; @@ -112,7 +114,8 @@ like(http_keepalive('/zero'), qr/Connect TODO: { local $TODO = 'not yet'; -is($t->read_file('test.log'), "keep-alive\nclose\n", 'sent_http_connection'); +is($t->read_file('test1.log'), "keep-alive\nclose\n", 'sent_http_connection'); +is($t->read_file('test2.log'), "timeout=9\n-\n", 'sent_http_keep_alive'); }