comparison fastcgi_buffering.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 847ea345becb
children 882267679006
comparison
equal deleted inserted replaced
951:9361c7eddfc1 952:e9064d691790
39 39
40 http { 40 http {
41 %%TEST_GLOBALS_HTTP%% 41 %%TEST_GLOBALS_HTTP%%
42 42
43 server { 43 server {
44 listen 127.0.0.1:8080; 44 listen 127.0.0.1:%%PORT_0%%;
45 server_name localhost; 45 server_name localhost;
46 46
47 location / { 47 location / {
48 fastcgi_pass 127.0.0.1:8081; 48 fastcgi_pass 127.0.0.1:%%PORT_1%%;
49 fastcgi_param REQUEST_URI $request_uri; 49 fastcgi_param REQUEST_URI $request_uri;
50 fastcgi_buffering off; 50 fastcgi_buffering off;
51 } 51 }
52 52
53 location /inmemory.html { 53 location /inmemory.html {
62 '<!--#include virtual="/include$request_uri" set="x" -->' . 62 '<!--#include virtual="/include$request_uri" set="x" -->' .
63 'set: <!--#echo var="x" -->'); 63 'set: <!--#echo var="x" -->');
64 64
65 $t->run()->plan(2); 65 $t->run()->plan(2);
66 66
67 $t->run_daemon(\&fastcgi_daemon)->waitforsocket('127.0.0.1:8081'); 67 $t->run_daemon(\&fastcgi_daemon)->waitforsocket('127.0.0.1:' . port(1));
68 68
69 ############################################################################### 69 ###############################################################################
70 70
71 like(http_get('/'), qr/SEE-THIS/, 'fastcgi unbuffered'); 71 like(http_get('/'), qr/SEE-THIS/, 'fastcgi unbuffered');
72 like(http_get('/inmemory.html'), qr/set: SEE-THIS/, 'fastcgi inmemory'); 72 like(http_get('/inmemory.html'), qr/set: SEE-THIS/, 'fastcgi inmemory');
73 73
74 ############################################################################### 74 ###############################################################################
75 75
76 sub fastcgi_daemon { 76 sub fastcgi_daemon {
77 my $socket = FCGI::OpenSocket('127.0.0.1:8081', 5); 77 my $socket = FCGI::OpenSocket('127.0.0.1:' . port(1), 5);
78 my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV, 78 my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV,
79 $socket); 79 $socket);
80 80
81 my $count; 81 my $count;
82 while( $request->Accept() >= 0 ) { 82 while( $request->Accept() >= 0 ) {