Mercurial > hg > nginx-tests
comparison scgi_body.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 | d4a0232425ee |
children |
comparison
equal
deleted
inserted
replaced
973:7d7aef8b9f3a | 974:882267679006 |
---|---|
36 | 36 |
37 http { | 37 http { |
38 %%TEST_GLOBALS_HTTP%% | 38 %%TEST_GLOBALS_HTTP%% |
39 | 39 |
40 server { | 40 server { |
41 listen 127.0.0.1:%%PORT_0%%; | 41 listen 127.0.0.1:8080; |
42 server_name localhost; | 42 server_name localhost; |
43 | 43 |
44 location / { | 44 location / { |
45 scgi_pass 127.0.0.1:%%PORT_1%%; | 45 scgi_pass 127.0.0.1:8081; |
46 scgi_param SCGI 1; | 46 scgi_param SCGI 1; |
47 scgi_param REQUEST_URI $request_uri; | 47 scgi_param REQUEST_URI $request_uri; |
48 } | 48 } |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 EOF | 52 EOF |
53 | 53 |
54 $t->run_daemon(\&scgi_daemon); | 54 $t->run_daemon(\&scgi_daemon); |
55 $t->run()->waitforsocket('127.0.0.1:' . port(1)); | 55 $t->run()->waitforsocket('127.0.0.1:' . port(8081)); |
56 | 56 |
57 ############################################################################### | 57 ############################################################################### |
58 | 58 |
59 | 59 |
60 like(http_get('/'), qr/X-Body: /, 'scgi no body'); | 60 like(http_get('/'), qr/X-Body: /, 'scgi no body'); |
102 ############################################################################### | 102 ############################################################################### |
103 | 103 |
104 sub scgi_daemon { | 104 sub scgi_daemon { |
105 my $server = IO::Socket::INET->new( | 105 my $server = IO::Socket::INET->new( |
106 Proto => 'tcp', | 106 Proto => 'tcp', |
107 LocalHost => '127.0.0.1:' . port(1), | 107 LocalHost => '127.0.0.1:' . port(8081), |
108 Listen => 5, | 108 Listen => 5, |
109 Reuse => 1 | 109 Reuse => 1 |
110 ) | 110 ) |
111 or die "Can't create listening socket: $!\n"; | 111 or die "Can't create listening socket: $!\n"; |
112 | 112 |