comparison fastcgi_body2.t @ 974:882267679006

Tests: simplified parallel modifications in tests. Mail tests were simplified in c227348453db.
author Andrey Zelenkov <zelenkov@nginx.com>
date Tue, 12 Jul 2016 17:39:03 +0300
parents e9064d691790
children 1a820a5a32ae
comparison
equal deleted inserted replaced
973:7d7aef8b9f3a 974:882267679006
40 40
41 http { 41 http {
42 %%TEST_GLOBALS_HTTP%% 42 %%TEST_GLOBALS_HTTP%%
43 43
44 upstream u { 44 upstream u {
45 server 127.0.0.1:%%PORT_1%% max_fails=0; 45 server 127.0.0.1:8081 max_fails=0;
46 server 127.0.0.1:%%PORT_2%%; 46 server 127.0.0.1:8082;
47 } 47 }
48 48
49 server { 49 server {
50 listen 127.0.0.1:%%PORT_0%%; 50 listen 127.0.0.1:8080;
51 server_name localhost; 51 server_name localhost;
52 52
53 location / { 53 location / {
54 fastcgi_pass u; 54 fastcgi_pass u;
55 fastcgi_param REQUEST_URI $request_uri; 55 fastcgi_param REQUEST_URI $request_uri;
69 } 69 }
70 } 70 }
71 71
72 EOF 72 EOF
73 73
74 $t->run_daemon(\&fastcgi_daemon, port(1)); 74 $t->run_daemon(\&fastcgi_daemon, port(8081));
75 $t->run_daemon(\&fastcgi_daemon, port(2)); 75 $t->run_daemon(\&fastcgi_daemon, port(8082));
76 $t->run(); 76 $t->run();
77 77
78 $t->waitforsocket('127.0.0.1:' . port(1)); 78 $t->waitforsocket('127.0.0.1:' . port(8081));
79 $t->waitforsocket('127.0.0.1:' . port(2)); 79 $t->waitforsocket('127.0.0.1:' . port(8082));
80 80
81 ############################################################################### 81 ###############################################################################
82 82
83 like(http_get_length('/', 'x' x 102400), qr/X-Length: 102400/, 83 like(http_get_length('/', 'x' x 102400), qr/X-Length: 102400/,
84 'body length - in file'); 84 'body length - in file');
114 114
115 while( $request->Accept() >= 0 ) { 115 while( $request->Accept() >= 0 ) {
116 read(STDIN, my $body, $ENV{'CONTENT_LENGTH'}); 116 read(STDIN, my $body, $ENV{'CONTENT_LENGTH'});
117 my $len = length $body; 117 my $len = length $body;
118 118
119 sleep 3 if $port == port(1); 119 sleep 3 if $port == port(8081);
120 120
121 print <<EOF; 121 print <<EOF;
122 Location: http://localhost/redirect 122 Location: http://localhost/redirect
123 Content-Type: text/html 123 Content-Type: text/html
124 X-Length: $len 124 X-Length: $len