comparison fastcgi_merge_params2.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 # no fastcgi_param at all, cache switched on at server level 46 # no fastcgi_param at all, cache switched on at server level
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 } 63 }
64 64
65 EOF 65 EOF
66 66
67 $t->run_daemon(\&fastcgi_daemon); 67 $t->run_daemon(\&fastcgi_daemon);
68 $t->run()->waitforsocket('127.0.0.1:8081'); 68 $t->run()->waitforsocket('127.0.0.1:' . port(1));
69 69
70 ############################################################################### 70 ###############################################################################
71 71
72 like(http_get_ims('/'), qr/ims=;/, 72 like(http_get_ims('/'), qr/ims=;/,
73 'if-modified-since cleared with cache'); 73 'if-modified-since cleared with cache');
94 } 94 }
95 95
96 ############################################################################### 96 ###############################################################################
97 97
98 sub fastcgi_daemon { 98 sub fastcgi_daemon {
99 my $socket = FCGI::OpenSocket('127.0.0.1:8081', 5); 99 my $socket = FCGI::OpenSocket('127.0.0.1:' . port(1), 5);
100 my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV, 100 my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV,
101 $socket); 101 $socket);
102 102
103 my $count; 103 my $count;
104 while( $request->Accept() >= 0 ) { 104 while( $request->Accept() >= 0 ) {
107 my $ims = $ENV{HTTP_IF_MODIFIED_SINCE}; 107 my $ims = $ENV{HTTP_IF_MODIFIED_SINCE};
108 my $iums = $ENV{HTTP_IF_UNMODIFIED_SINCE}; 108 my $iums = $ENV{HTTP_IF_UNMODIFIED_SINCE};
109 my $blah = $ENV{HTTP_X_BLAH}; 109 my $blah = $ENV{HTTP_X_BLAH};
110 110
111 print <<EOF; 111 print <<EOF;
112 Location: http://127.0.0.1:8080/redirect 112 Location: http://localhost/redirect
113 Content-Type: text/html 113 Content-Type: text/html
114 114
115 ims=$ims;iums=$iums;blah=$blah; 115 ims=$ims;iums=$iums;blah=$blah;
116 EOF 116 EOF
117 } 117 }