Mercurial > hg > nginx-tests
diff fastcgi.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 | eca9b1d19021 |
children | 882267679006 |
line wrap: on
line diff
--- a/fastcgi.t +++ b/fastcgi.t @@ -39,15 +39,15 @@ http { %%TEST_GLOBALS_HTTP%% upstream u { - server 127.0.0.1:8081; + server 127.0.0.1:%%PORT_1%%; } server { - listen 127.0.0.1:8080; + listen 127.0.0.1:%%PORT_0%%; server_name localhost; location / { - fastcgi_pass 127.0.0.1:8081; + fastcgi_pass 127.0.0.1:%%PORT_1%%; fastcgi_param REQUEST_URI $request_uri; } @@ -61,7 +61,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)); ############################################################################### @@ -73,13 +73,14 @@ unlike(http_head('/'), qr/SEE-THIS/, 'no like(http_get('/stderr'), qr/SEE-THIS/, 'large stderr handled'); -like(http_get('/var?b=127.0.0.1:8081'), qr/SEE-THIS/, 'fastcgi with variables'); +like(http_get('/var?b=127.0.0.1:' . port(1)), qr/SEE-THIS/, + 'fastcgi with variables'); like(http_get('/var?b=u'), qr/SEE-THIS/, 'fastcgi with variables to upstream'); ############################################################################### 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); @@ -92,7 +93,7 @@ sub fastcgi_daemon { } print <<EOF; -Location: http://127.0.0.1:8080/redirect +Location: http://localhost/redirect Content-Type: text/html SEE-THIS