Mercurial > hg > nginx-tests
diff fastcgi_request_buffering_chunked.t @ 952:e9064d691790
Tests: converted tests to run in parallel.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Tue, 21 Jun 2016 16:39:13 +0300 |
parents | 6bb1f2ccd386 |
children | 882267679006 |
line wrap: on
line diff
--- a/fastcgi_request_buffering_chunked.t +++ b/fastcgi_request_buffering_chunked.t @@ -44,7 +44,7 @@ http { %%TEST_GLOBALS_HTTP%% server { - listen 127.0.0.1:8080; + listen 127.0.0.1:%%PORT_0%%; server_name localhost; client_header_buffer_size 1k; @@ -53,17 +53,17 @@ http { location / { client_body_buffer_size 2k; - fastcgi_pass 127.0.0.1:8081; + fastcgi_pass 127.0.0.1:%%PORT_1%%; } location /single { client_body_in_single_buffer on; - fastcgi_pass 127.0.0.1:8081; + fastcgi_pass 127.0.0.1:%%PORT_1%%; } location /preread { - fastcgi_pass 127.0.0.1:8082; + fastcgi_pass 127.0.0.1:%%PORT_2%%; } location /error_page { - fastcgi_pass 127.0.0.1:8081; + fastcgi_pass 127.0.0.1:%%PORT_1%%; error_page 404 /404; fastcgi_intercept_errors on; } @@ -76,7 +76,7 @@ http { EOF $t->run_daemon(\&fastcgi_daemon); -$t->run()->waitforsocket('127.0.0.1:8081'); +$t->run()->waitforsocket('127.0.0.1:' . port(1)); ############################################################################### @@ -103,7 +103,7 @@ like(http_get_body('/', '0123456789' x 1 # interactive tests -my $s = get_body('/preread', 8082); +my $s = get_body('/preread', port(2)); ok($s, 'no preread'); SKIP: { @@ -116,7 +116,7 @@ like($s->{http_end}(), qr/200 OK/, 'no p } -$s = get_body('/preread', 8082, '01234'); +$s = get_body('/preread', port(2), '01234'); ok($s, 'preread'); SKIP: { @@ -129,7 +129,7 @@ like($s->{http_end}(), qr/200 OK/, 'prer } -$s = get_body('/preread', 8082, '01234', many => 1); +$s = get_body('/preread', port(2), '01234', many => 1); ok($s, 'chunks'); SKIP: { @@ -386,7 +386,7 @@ sub log2c { Test::Nginx::log_core('||', ############################################################################### sub fastcgi_daemon { - my $socket = FCGI::OpenSocket('127.0.0.1:8081', 5); + my $socket = FCGI::OpenSocket('127.0.0.1:' . port(1), 5); my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV, $socket); @@ -408,7 +408,7 @@ sub fastcgi_daemon { } print <<EOF; -Location: http://127.0.0.1:8080/redirect +Location: http://localhost/redirect Content-Type: text/html X-Body: $body