comparison fastcgi_header_params.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 a9569f57da98
children 882267679006
comparison
equal deleted inserted replaced
951:9361c7eddfc1 952:e9064d691790
37 37
38 http { 38 http {
39 %%TEST_GLOBALS_HTTP%% 39 %%TEST_GLOBALS_HTTP%%
40 40
41 server { 41 server {
42 listen 127.0.0.1:8080; 42 listen 127.0.0.1:%%PORT_0%%;
43 server_name localhost; 43 server_name localhost;
44 44
45 location / { 45 location / {
46 fastcgi_pass 127.0.0.1:8081; 46 fastcgi_pass 127.0.0.1:%%PORT_1%%;
47 fastcgi_param HTTP_X_BLAH "blah"; 47 fastcgi_param HTTP_X_BLAH "blah";
48 } 48 }
49 } 49 }
50 } 50 }
51 51
52 EOF 52 EOF
53 53
54 $t->run_daemon(\&fastcgi_daemon); 54 $t->run_daemon(\&fastcgi_daemon);
55 $t->run()->waitforsocket('127.0.0.1:8081'); 55 $t->run()->waitforsocket('127.0.0.1:' . port(1));
56 56
57 ############################################################################### 57 ###############################################################################
58 58
59 like(http_get_headers('/'), qr/SEE-THIS/, 59 like(http_get_headers('/'), qr/SEE-THIS/,
60 'fastcgi request with many ignored headers'); 60 'fastcgi request with many ignored headers');
90 } 90 }
91 91
92 ############################################################################### 92 ###############################################################################
93 93
94 sub fastcgi_daemon { 94 sub fastcgi_daemon {
95 my $socket = FCGI::OpenSocket('127.0.0.1:8081', 5); 95 my $socket = FCGI::OpenSocket('127.0.0.1:' . port(1), 5);
96 my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV, 96 my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV,
97 $socket); 97 $socket);
98 98
99 my $count; 99 my $count;
100 while( $request->Accept() >= 0 ) { 100 while( $request->Accept() >= 0 ) {
101 $count++; 101 $count++;
102 102
103 print <<EOF; 103 print <<EOF;
104 Location: http://127.0.0.1:8080/redirect 104 Location: http://localhost/redirect
105 Content-Type: text/html 105 Content-Type: text/html
106 106
107 SEE-THIS 107 SEE-THIS
108 $count 108 $count
109 EOF 109 EOF