comparison spdy.t @ 397:847ea345becb

Tests: removed TODO and try_run() checks for legacy versions.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 05 May 2014 11:46:01 +0400
parents f42de3a9fd74
children 5c25acbc870a
comparison
equal deleted inserted replaced
396:5eb0df61f371 397:847ea345becb
33 }; 33 };
34 plan(skip_all => 'Compress::Raw::Zlib not installed') if $@; 34 plan(skip_all => 'Compress::Raw::Zlib not installed') if $@;
35 plan(skip_all => 'win32') if $^O eq 'MSWin32'; 35 plan(skip_all => 'win32') if $^O eq 'MSWin32';
36 36
37 my $t = Test::Nginx->new()->has(qw/http proxy cache limit_conn rewrite spdy/); 37 my $t = Test::Nginx->new()->has(qw/http proxy cache limit_conn rewrite spdy/);
38
39 plan(skip_all => 'no SPDY/3.1') unless $t->has_version('1.5.10');
40 38
41 $t->plan(72)->write_file_expand('nginx.conf', <<'EOF'); 39 $t->plan(72)->write_file_expand('nginx.conf', <<'EOF');
42 40
43 %%TEST_GLOBALS%% 41 %%TEST_GLOBALS%%
44 42
387 ($frame) = grep { $_->{type} eq "DATA" } @$frames; 385 ($frame) = grep { $_->{type} eq "DATA" } @$frames;
388 is($frame->{data}, 7, 'priority 7'); 386 is($frame->{data}, 7, 'priority 7');
389 387
390 # stream muliplexing + priority 388 # stream muliplexing + priority
391 389
392 TODO: {
393 local $TODO = 'reversed priority' unless $t->has_version('1.5.11');
394
395 $sess = new_session(); 390 $sess = new_session();
396 $sid1 = spdy_stream($sess, { path => '/t1.html', prio => 7 }); 391 $sid1 = spdy_stream($sess, { path => '/t1.html', prio => 7 });
397 $sid2 = spdy_stream($sess, { path => '/t2.html', prio => 0 }); 392 $sid2 = spdy_stream($sess, { path => '/t2.html', prio => 0 });
398 spdy_read($sess); 393 spdy_read($sess);
399 394
425 { sid => $sid2, fin => 1 } 420 { sid => $sid2, fin => 1 }
426 ]); 421 ]);
427 422
428 @data = grep { $_->{type} eq "DATA" } @$frames; 423 @data = grep { $_->{type} eq "DATA" } @$frames;
429 is(join (' ', map { $_->{sid} } @data), "$sid1 $sid2", 'multiple priority 2'); 424 is(join (' ', map { $_->{sid} } @data), "$sid1 $sid2", 'multiple priority 2');
430
431 }
432 425
433 # limit_conn 426 # limit_conn
434 427
435 $sess = new_session(); 428 $sess = new_session();
436 spdy_settings($sess, 7 => 1); 429 spdy_settings($sess, 7 => 1);
518 511
519 } 512 }
520 513
521 # awkward protocol version 514 # awkward protocol version
522 515
523 TODO: {
524 local $TODO = 'not yet' unless $t->has_version('1.5.11');
525
526 $sess = new_session(); 516 $sess = new_session();
527 $sid1 = spdy_stream($sess, { path => '/s', version => 'HTTP/1.10' }); 517 $sid1 = spdy_stream($sess, { path => '/s', version => 'HTTP/1.10' });
528 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); 518 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]);
529 519
530 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; 520 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames;
531 is($frame->{headers}->{':status'}, 200, 'awkward version'); 521 is($frame->{headers}->{':status'}, 200, 'awkward version');
532
533 }
534 522
535 # missing mandatory request header 523 # missing mandatory request header
536 524
537 $sess = new_session(); 525 $sess = new_session();
538 $sid1 = spdy_stream($sess, { path => '/s', version => '' }); 526 $sid1 = spdy_stream($sess, { path => '/s', version => '' });