comparison fastcgi_merge_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 fa71c725d40a
children 882267679006
comparison
equal deleted inserted replaced
951:9361c7eddfc1 952:e9064d691790
44 fastcgi_cache_key stub; 44 fastcgi_cache_key stub;
45 45
46 fastcgi_param HTTP_X_BLAH "blah"; 46 fastcgi_param HTTP_X_BLAH "blah";
47 47
48 server { 48 server {
49 listen 127.0.0.1:8080; 49 listen 127.0.0.1:%%PORT_0%%;
50 server_name localhost; 50 server_name localhost;
51 51
52 fastcgi_cache NAME; 52 fastcgi_cache NAME;
53 53
54 location / { 54 location / {
55 fastcgi_pass 127.0.0.1:8081; 55 fastcgi_pass 127.0.0.1:%%PORT_1%%;
56 } 56 }
57 57
58 location /no/ { 58 location /no/ {
59 fastcgi_pass 127.0.0.1:8081; 59 fastcgi_pass 127.0.0.1:%%PORT_1%%;
60 fastcgi_cache off; 60 fastcgi_cache off;
61 } 61 }
62 62
63 location /custom/ { 63 location /custom/ {
64 fastcgi_pass 127.0.0.1:8081; 64 fastcgi_pass 127.0.0.1:%%PORT_1%%;
65 fastcgi_param HTTP_X_BLAH "custom"; 65 fastcgi_param HTTP_X_BLAH "custom";
66 } 66 }
67 } 67 }
68 } 68 }
69 69
70 EOF 70 EOF
71 71
72 $t->run_daemon(\&fastcgi_daemon); 72 $t->run_daemon(\&fastcgi_daemon);
73 $t->run()->waitforsocket('127.0.0.1:8081'); 73 $t->run()->waitforsocket('127.0.0.1:' . port(1));
74 74
75 ############################################################################### 75 ###############################################################################
76 76
77 like(http_get_ims('/'), qr/ims=;/, 77 like(http_get_ims('/'), qr/ims=;/,
78 'if-modified-since cleared with cache'); 78 'if-modified-since cleared with cache');
110 } 110 }
111 111
112 ############################################################################### 112 ###############################################################################
113 113
114 sub fastcgi_daemon { 114 sub fastcgi_daemon {
115 my $socket = FCGI::OpenSocket('127.0.0.1:8081', 5); 115 my $socket = FCGI::OpenSocket('127.0.0.1:' . port(1), 5);
116 my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV, 116 my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV,
117 $socket); 117 $socket);
118 118
119 my $count; 119 my $count;
120 while( $request->Accept() >= 0 ) { 120 while( $request->Accept() >= 0 ) {
123 my $ims = $ENV{HTTP_IF_MODIFIED_SINCE}; 123 my $ims = $ENV{HTTP_IF_MODIFIED_SINCE};
124 my $iums = $ENV{HTTP_IF_UNMODIFIED_SINCE}; 124 my $iums = $ENV{HTTP_IF_UNMODIFIED_SINCE};
125 my $blah = $ENV{HTTP_X_BLAH}; 125 my $blah = $ENV{HTTP_X_BLAH};
126 126
127 print <<EOF; 127 print <<EOF;
128 Location: http://127.0.0.1:8080/redirect 128 Location: http://localhost/redirect
129 Content-Type: text/html 129 Content-Type: text/html
130 130
131 ims=$ims;iums=$iums;blah=$blah; 131 ims=$ims;iums=$iums;blah=$blah;
132 EOF 132 EOF
133 } 133 }