comparison fastcgi_split.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
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%%; 45 server 127.0.0.1:8081;
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;
58 } 58 }
59 } 59 }
60 60
61 EOF 61 EOF
62 62
63 $t->run_daemon(\&fastcgi_daemon, port(1)); 63 $t->run_daemon(\&fastcgi_daemon, port(8081));
64 $t->run_daemon(\&fastcgi_daemon, port(2)); 64 $t->run_daemon(\&fastcgi_daemon, port(8082));
65 65
66 $t->run(); 66 $t->run();
67 67
68 $t->waitforsocket('127.0.0.1:' . port(1)); 68 $t->waitforsocket('127.0.0.1:' . port(8081));
69 $t->waitforsocket('127.0.0.1:' . port(2)); 69 $t->waitforsocket('127.0.0.1:' . port(8082));
70 70
71 ############################################################################### 71 ###############################################################################
72 72
73 like(http_get('/'), qr/^Good: header/ms, 'fastcgi next upstream'); 73 like(http_get('/'), qr/^Good: header/ms, 'fastcgi next upstream');
74 74
82 82
83 my $count; 83 my $count;
84 while( $request->Accept() >= 0 ) { 84 while( $request->Accept() >= 0 ) {
85 $count++; 85 $count++;
86 86
87 if ($port == port(1)) { 87 if ($port == port(8081)) {
88 print 'BAD'; 88 print 'BAD';
89 } 89 }
90 if ($port == port(2)) { 90 if ($port == port(8082)) {
91 print 'Good: header' . CRLF . CRLF; 91 print 'Good: header' . CRLF . CRLF;
92 } 92 }
93 } 93 }
94 94
95 FCGI::CloseSocket($socket); 95 FCGI::CloseSocket($socket);