comparison proxy_request_buffering_chunked.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
37 37
38 http { 38 http {
39 %%TEST_GLOBALS_HTTP%% 39 %%TEST_GLOBALS_HTTP%%
40 40
41 server { 41 server {
42 listen 127.0.0.1:%%PORT_0%%; 42 listen 127.0.0.1:8080;
43 server_name localhost; 43 server_name localhost;
44 44
45 client_header_buffer_size 1k; 45 client_header_buffer_size 1k;
46 proxy_request_buffering off; 46 proxy_request_buffering off;
47 proxy_http_version 1.1; 47 proxy_http_version 1.1;
48 48
49 location / { 49 location / {
50 client_body_buffer_size 2k; 50 client_body_buffer_size 2k;
51 add_header X-Body "$request_body"; 51 add_header X-Body "$request_body";
52 proxy_pass http://127.0.0.1:%%PORT_1%%; 52 proxy_pass http://127.0.0.1:8081;
53 } 53 }
54 location /small { 54 location /small {
55 client_body_in_file_only on; 55 client_body_in_file_only on;
56 proxy_pass http://127.0.0.1:%%PORT_0%%/; 56 proxy_pass http://127.0.0.1:8080/;
57 } 57 }
58 location /single { 58 location /single {
59 client_body_in_single_buffer on; 59 client_body_in_single_buffer on;
60 add_header X-Body "$request_body"; 60 add_header X-Body "$request_body";
61 proxy_pass http://127.0.0.1:%%PORT_1%%; 61 proxy_pass http://127.0.0.1:8081;
62 } 62 }
63 location /discard { 63 location /discard {
64 return 200 "TEST\n"; 64 return 200 "TEST\n";
65 } 65 }
66 location /preread { 66 location /preread {
67 proxy_pass http://127.0.0.1:%%PORT_2%%/; 67 proxy_pass http://127.0.0.1:8082/;
68 } 68 }
69 location /error_page { 69 location /error_page {
70 proxy_pass http://127.0.0.1:%%PORT_1%%/404; 70 proxy_pass http://127.0.0.1:8081/404;
71 error_page 404 /404; 71 error_page 404 /404;
72 proxy_intercept_errors on; 72 proxy_intercept_errors on;
73 } 73 }
74 location /404 { 74 location /404 {
75 return 200 "$request_body\n"; 75 return 200 "$request_body\n";
76 } 76 }
77 } 77 }
78 78
79 server { 79 server {
80 listen 127.0.0.1:%%PORT_1%%; 80 listen 127.0.0.1:8081;
81 server_name localhost; 81 server_name localhost;
82 82
83 location / { 83 location / {
84 proxy_pass http://127.0.0.1:%%PORT_0%%/discard; 84 proxy_pass http://127.0.0.1:8080/discard;
85 } 85 }
86 location /404 { } 86 location /404 { }
87 } 87 }
88 } 88 }
89 89
126 like(http_get_body('/small', '0123456789'), 126 like(http_get_body('/small', '0123456789'),
127 qr/X-Body: 0123456789\x0d?$/ms, 'small body in file only'); 127 qr/X-Body: 0123456789\x0d?$/ms, 'small body in file only');
128 128
129 # interactive tests 129 # interactive tests
130 130
131 my $s = get_body('/preread', port(2)); 131 my $s = get_body('/preread', port(8082));
132 ok($s, 'no preread'); 132 ok($s, 'no preread');
133 133
134 SKIP: { 134 SKIP: {
135 skip 'no preread failed', 3 unless $s; 135 skip 'no preread failed', 3 unless $s;
136 136
142 142
143 like($s->{http_end}(), qr/200 OK/, 'no preread - response'); 143 like($s->{http_end}(), qr/200 OK/, 'no preread - response');
144 144
145 } 145 }
146 146
147 $s = get_body('/preread', port(2), '01234'); 147 $s = get_body('/preread', port(8082), '01234');
148 ok($s, 'preread'); 148 ok($s, 'preread');
149 149
150 SKIP: { 150 SKIP: {
151 skip 'preread failed', 3 unless $s; 151 skip 'preread failed', 3 unless $s;
152 152
156 156
157 like($s->{http_end}(), qr/200 OK/, 'preread - response'); 157 like($s->{http_end}(), qr/200 OK/, 'preread - response');
158 158
159 } 159 }
160 160
161 $s = get_body('/preread', port(2), '01234', many => 1); 161 $s = get_body('/preread', port(8082), '01234', many => 1);
162 ok($s, 'chunks'); 162 ok($s, 'chunks');
163 163
164 SKIP: { 164 SKIP: {
165 skip 'chunks failed', 3 unless $s; 165 skip 'chunks failed', 3 unless $s;
166 166