Mercurial > hg > nginx-tests
changeset 1463:5ac92857e419
Tests: fastcgi_catch_stderr test.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 11 Apr 2019 20:12:24 +0300 |
parents | fe886814b25a |
children | 4bc1490cedbc |
files | fastcgi.t |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/fastcgi.t Tue Apr 09 18:52:53 2019 +0300 +++ b/fastcgi.t Thu Apr 11 20:12:24 2019 +0300 @@ -25,7 +25,7 @@ plan(skip_all => 'FCGI not installed') if $@; plan(skip_all => 'win32') if $^O eq 'MSWin32'; -my $t = Test::Nginx->new()->has(qw/http fastcgi/)->plan(7) +my $t = Test::Nginx->new()->has(qw/http fastcgi/)->plan(8) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -51,6 +51,12 @@ fastcgi_param REQUEST_URI $request_uri; } + location /catch { + fastcgi_pass 127.0.0.1:8081; + fastcgi_param REQUEST_URI "/stderr"; + fastcgi_catch_stderr sample; + } + location /var { fastcgi_pass $arg_b; fastcgi_param REQUEST_URI $request_uri; @@ -72,6 +78,7 @@ unlike(http_head('/'), qr/SEE-THIS/, 'no data in HEAD'); like(http_get('/stderr'), qr/SEE-THIS/, 'large stderr handled'); +like(http_get('/catch'), qr/502 Bad/, 'catch stderr'); like(http_get('/var?b=127.0.0.1:' . port(8081)), qr/SEE-THIS/, 'fastcgi with variables');