comparison proxy_request_buffering_ssl.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 68a6678abae2
children 882267679006
comparison
equal deleted inserted replaced
951:9361c7eddfc1 952:e9064d691790
38 38
39 http { 39 http {
40 %%TEST_GLOBALS_HTTP%% 40 %%TEST_GLOBALS_HTTP%%
41 41
42 server { 42 server {
43 listen 127.0.0.1:8080; 43 listen 127.0.0.1:%%PORT_0%%;
44 server_name localhost; 44 server_name localhost;
45 45
46 client_header_buffer_size 1k; 46 client_header_buffer_size 1k;
47 proxy_request_buffering off; 47 proxy_request_buffering off;
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 https://127.0.0.1:8081; 52 proxy_pass https://127.0.0.1:%%PORT_1%%;
53 } 53 }
54 location /single { 54 location /single {
55 client_body_in_single_buffer on; 55 client_body_in_single_buffer on;
56 add_header X-Body "$request_body"; 56 add_header X-Body "$request_body";
57 proxy_pass https://127.0.0.1:8081; 57 proxy_pass https://127.0.0.1:%%PORT_1%%;
58 } 58 }
59 location /discard { 59 location /discard {
60 return 200 "TEST\n"; 60 return 200 "TEST\n";
61 } 61 }
62 location /preread { 62 location /preread {
63 proxy_pass https://127.0.0.1:8081; 63 proxy_pass https://127.0.0.1:%%PORT_1%%;
64 } 64 }
65 location /error_page { 65 location /error_page {
66 proxy_pass https://127.0.0.1:8081/404; 66 proxy_pass https://127.0.0.1:%%PORT_1%%/404;
67 error_page 404 /404; 67 error_page 404 /404;
68 proxy_intercept_errors on; 68 proxy_intercept_errors on;
69 } 69 }
70 location /404 { 70 location /404 {
71 return 200 "$request_body\n"; 71 return 200 "$request_body\n";
72 } 72 }
73 } 73 }
74 74
75 server { 75 server {
76 listen 127.0.0.1:8081 ssl; 76 listen 127.0.0.1:%%PORT_1%% ssl;
77 server_name localhost; 77 server_name localhost;
78 78
79 ssl_certificate_key localhost.key; 79 ssl_certificate_key localhost.key;
80 ssl_certificate localhost.crt; 80 ssl_certificate localhost.crt;
81 81
82 location /preread { 82 location /preread {
83 client_body_buffer_size 2k; 83 client_body_buffer_size 2k;
84 add_header X-Body "$request_body"; 84 add_header X-Body "$request_body";
85 proxy_pass http://127.0.0.1:8082/; 85 proxy_pass http://127.0.0.1:%%PORT_2%%/;
86 proxy_request_buffering off; 86 proxy_request_buffering off;
87 } 87 }
88 88
89 location / { 89 location / {
90 proxy_pass http://127.0.0.1:8080/discard; 90 proxy_pass http://127.0.0.1:%%PORT_0%%/discard;
91 } 91 }
92 location /404 { } 92 location /404 { }
93 } 93 }
94 } 94 }
95 95
145 '0123456789', 'foobar'), qr/(TEST.*){4}/ms, 145 '0123456789', 'foobar'), qr/(TEST.*){4}/ms,
146 'body discard 2'); 146 'body discard 2');
147 147
148 # interactive tests 148 # interactive tests
149 149
150 my $s = get_body('/preread', 8082, 10); 150 my $s = get_body('/preread', port(2), 10);
151 ok($s, 'no preread'); 151 ok($s, 'no preread');
152 152
153 SKIP: { 153 SKIP: {
154 skip 'no preread failed', 3 unless $s; 154 skip 'no preread failed', 3 unless $s;
155 155
158 158
159 like($s->{http_end}(), qr/200 OK/, 'no preread - response'); 159 like($s->{http_end}(), qr/200 OK/, 'no preread - response');
160 160
161 } 161 }
162 162
163 $s = get_body('/preread', 8082, 15, '01234'); 163 $s = get_body('/preread', port(2), 15, '01234');
164 ok($s, 'preread'); 164 ok($s, 'preread');
165 165
166 SKIP: { 166 SKIP: {
167 skip 'preread failed', 3 unless $s; 167 skip 'preread failed', 3 unless $s;
168 168