Mercurial > hg > nginx-tests
diff slice.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 | 92375c379a0a |
children | 882267679006 |
line wrap: on
line diff
--- a/slice.t +++ b/slice.t @@ -44,7 +44,7 @@ http { fastcgi_cache_key $uri$is_args$args$slice_range; server { - listen 127.0.0.1:8080; + listen 127.0.0.1:%%PORT_0%%; server_name localhost; location / { } @@ -52,7 +52,7 @@ http { location /cache/ { slice 2; - proxy_pass http://127.0.0.1:8081/; + proxy_pass http://127.0.0.1:%%PORT_1%%/; proxy_cache NAME; @@ -66,7 +66,7 @@ http { location /fastcgi { slice 2; - fastcgi_pass 127.0.0.1:8082; + fastcgi_pass 127.0.0.1:%%PORT_2%%; fastcgi_cache NAME2; @@ -81,7 +81,7 @@ http { } server { - listen 127.0.0.1:8081; + listen 127.0.0.1:%%PORT_1%%; server_name localhost; location / { } @@ -228,7 +228,7 @@ SKIP: { skip 'win32', 5 if $^O eq 'MSWin32'; $t->run_daemon(\&fastcgi_daemon); - $t->waitforsocket('127.0.0.1:8082'); + $t->waitforsocket('127.0.0.1:' . port(2)); like(http_get('/fastcgi'), qr/200 OK.*MISS.*^012345678$/ms, 'fastcgi'); like(http_get('/fastcgi'), qr/200 OK.*HIT.*^012345678$/ms, @@ -258,7 +258,7 @@ EOF ############################################################################### sub fastcgi_daemon { - my $socket = FCGI::OpenSocket('127.0.0.1:8082', 5); + my $socket = FCGI::OpenSocket('127.0.0.1:' . port(2), 5); my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV, $socket);