Mercurial > hg > nginx-tests
comparison spdy.t @ 568:907e89fba9c3
Tests: removed TODO and try_run() checks for legacy versions.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Sun, 03 May 2015 12:45:09 +0300 |
parents | 42810c40ebb8 |
children | 2cd00179f4b2 |
comparison
equal
deleted
inserted
replaced
567:22bade4c7e12 | 568:907e89fba9c3 |
---|---|
218 | 218 |
219 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | 219 ($frame) = grep { $_->{type} eq "DATA" } @$frames; |
220 is($frame->{length}, 10, 'DATA length range'); | 220 is($frame->{length}, 10, 'DATA length range'); |
221 is($frame->{data}, '002XXXX000', 'DATA payload range'); | 221 is($frame->{data}, '002XXXX000', 'DATA payload range'); |
222 | 222 |
223 TODO: { | |
224 local $TODO = 'not yet' unless $t->has_version('1.7.4'); | |
225 | |
226 # request header with multiple values | 223 # request header with multiple values |
227 | 224 |
228 $sess = new_session(); | 225 $sess = new_session(); |
229 $sid1 = spdy_stream($sess, { path => '/cookie', | 226 $sid1 = spdy_stream($sess, { path => '/cookie', |
230 headers => { "cookie" => "val1\0val2" } | 227 headers => { "cookie" => "val1\0val2" } |
243 | 240 |
244 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | 241 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; |
245 is($frame->{headers}->{'x-cookie'}, 'val1; val2', | 242 is($frame->{headers}->{'x-cookie'}, 'val1; val2', |
246 'multiple request header values - proxied'); | 243 'multiple request header values - proxied'); |
247 | 244 |
248 } | |
249 | |
250 # response header with multiple values | 245 # response header with multiple values |
251 | 246 |
252 $sess = new_session(); | 247 $sess = new_session(); |
253 $sid1 = spdy_stream($sess, { path => '/set-cookie' }); | 248 $sid1 = spdy_stream($sess, { path => '/set-cookie' }); |
254 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | 249 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
257 is($frame->{headers}->{'set-cookie'}, "val1\0val2", | 252 is($frame->{headers}->{'set-cookie'}, "val1\0val2", |
258 'response header with multiple values'); | 253 'response header with multiple values'); |
259 | 254 |
260 # response header with multiple values - no empty values inside | 255 # response header with multiple values - no empty values inside |
261 | 256 |
262 TODO: { | |
263 local $TODO = 'not yet' unless $t->has_version('1.7.8'); | |
264 | |
265 $sess = new_session(); | 257 $sess = new_session(); |
266 $sid1 = spdy_stream($sess, { path => '/header/inside' }); | 258 $sid1 = spdy_stream($sess, { path => '/header/inside' }); |
267 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | 259 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
268 | 260 |
269 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | 261 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; |
278 $sid1 = spdy_stream($sess, { path => '/header/last' }); | 270 $sid1 = spdy_stream($sess, { path => '/header/last' }); |
279 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | 271 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
280 | 272 |
281 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | 273 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; |
282 is($frame->{headers}->{'x-foo'}, "val1\0val2", 'no empty header value last'); | 274 is($frame->{headers}->{'x-foo'}, "val1\0val2", 'no empty header value last'); |
283 | |
284 } | |
285 | 275 |
286 # $spdy | 276 # $spdy |
287 | 277 |
288 $sess = new_session(); | 278 $sess = new_session(); |
289 $sid1 = spdy_stream($sess, { path => '/spdy' }); | 279 $sid1 = spdy_stream($sess, { path => '/spdy' }); |
328 ok(!grep ({ $_->{type} eq "DATA" } @$frames), 'proxy cache HEAD - no body'); | 318 ok(!grep ({ $_->{type} eq "DATA" } @$frames), 'proxy cache HEAD - no body'); |
329 | 319 |
330 # ensure that HEAD-like requests, i.e., without response body, do not lead to | 320 # ensure that HEAD-like requests, i.e., without response body, do not lead to |
331 # client connection close due to cache filling up with upstream response body | 321 # client connection close due to cache filling up with upstream response body |
332 | 322 |
333 TODO: { | |
334 local $TODO = 'premature client connection close' | |
335 unless $t->has_version('1.7.3'); | |
336 | |
337 $sid2 = spdy_stream($sess, { path => '/' }); | 323 $sid2 = spdy_stream($sess, { path => '/' }); |
338 $frames = spdy_read($sess, all => [{ sid => $sid2, fin => 1 }]); | 324 $frames = spdy_read($sess, all => [{ sid => $sid2, fin => 1 }]); |
339 ok(grep ({ $_->{type} eq "SYN_REPLY" } @$frames), 'proxy cache headers only'); | 325 ok(grep ({ $_->{type} eq "SYN_REPLY" } @$frames), 'proxy cache headers only'); |
340 | |
341 } | |
342 | 326 |
343 # HEAD on empty cache with proxy_buffering off | 327 # HEAD on empty cache with proxy_buffering off |
344 | 328 |
345 $sess = new_session(); | 329 $sess = new_session(); |
346 $sid1 = spdy_stream($sess, | 330 $sid1 = spdy_stream($sess, |