comparison scgi_gzip.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 gzip on; 45 gzip on;
46 scgi_pass 127.0.0.1:%%PORT_1%%; 46 scgi_pass 127.0.0.1:8081;
47 scgi_param SCGI 1; 47 scgi_param SCGI 1;
48 scgi_param REQUEST_URI $request_uri; 48 scgi_param REQUEST_URI $request_uri;
49 scgi_param HTTP_X_BLAH "blah"; 49 scgi_param HTTP_X_BLAH "blah";
50 } 50 }
51 } 51 }
52 } 52 }
53 53
54 EOF 54 EOF
55 55
56 $t->run_daemon(\&scgi_daemon); 56 $t->run_daemon(\&scgi_daemon);
57 $t->run()->waitforsocket('127.0.0.1:' . port(1)); 57 $t->run()->waitforsocket('127.0.0.1:' . port(8081));
58 58
59 ############################################################################### 59 ###############################################################################
60 60
61 like(http_gzip_request('/'), qr/Content-Encoding: gzip/, 'scgi request'); 61 like(http_gzip_request('/'), qr/Content-Encoding: gzip/, 'scgi request');
62 62
63 ############################################################################### 63 ###############################################################################
64 64
65 sub scgi_daemon { 65 sub scgi_daemon {
66 my $server = IO::Socket::INET->new( 66 my $server = IO::Socket::INET->new(
67 Proto => 'tcp', 67 Proto => 'tcp',
68 LocalHost => '127.0.0.1:' . port(1), 68 LocalHost => '127.0.0.1:' . port(8081),
69 Listen => 5, 69 Listen => 5,
70 Reuse => 1 70 Reuse => 1
71 ) 71 )
72 or die "Can't create listening socket: $!\n"; 72 or die "Can't create listening socket: $!\n";
73 73