Mercurial > hg > nginx-tests
diff body_chunked.t @ 269:970bb423e59f
Tests: proxy_next_upstream tests in body.t, body_chunked.t.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 12 Mar 2013 20:07:25 +0400 |
parents | 6a0d934950bc |
children | a9621dbbd0d4 |
line wrap: on
line diff
--- a/body_chunked.t +++ b/body_chunked.t @@ -22,7 +22,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(9); +my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(10); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -36,6 +36,11 @@ events { http { %%TEST_GLOBALS_HTTP%% + upstream u { + server 127.0.0.1:8082; + server 127.0.0.1:8080 backup; + } + server { listen 127.0.0.1:8080; server_name localhost; @@ -64,6 +69,9 @@ http { location /discard { return 200 "TEST\n"; } + location /next { + proxy_pass http://u/; + } } server { @@ -74,6 +82,15 @@ http { return 200 "TEST\n"; } } + + server { + listen 127.0.0.1:8082; + server_name localhost; + + location / { + return 444; + } + } } EOF @@ -114,6 +131,11 @@ like(http_get_body('/discard', '01234567 '0123456789', 'foobar'), qr/(TEST.*){4}/ms, 'chunked body discard 2'); +# proxy_next_upstream + +like(http_get_body('/next', '0123456789'), + qr/X-Body: 0123456789\x0d?$/ms, 'body chunked next upstream'); + } ###############################################################################