Skip to content

Commit 0760b2d

Browse files
Tests: removed TODO and try_run() checks for legacy versions.
Also removed now unused spdy.t and shmem prerequisite.
1 parent b0b359a commit 0760b2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+64
-1430
lines changed

auth_request.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ select STDOUT; $| = 1;
2525

2626
my $t = Test::Nginx->new()
2727
->has(qw/http rewrite proxy cache fastcgi auth_basic auth_request/)
28-
->has(qw/shmem/)
2928
->plan(19);
3029

3130
$t->write_file_expand('nginx.conf', <<'EOF');

config_dump.t

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ select STDOUT; $| = 1;
2525

2626
my $t = Test::Nginx->new()->has(qw/http map/);
2727

28-
plan(skip_all => 'no config dump') unless $t->has_version('1.9.2');
29-
3028
$t->plan(10)->write_file_expand('nginx.conf', <<'EOF');
3129
3230
%%TEST_GLOBALS%%

fastcgi_body.t

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ like(http_get_length('/', ''), qr/X-Body: _eos\x0d?$/ms, 'fastcgi empty body');
5959
like(http_get_length('/', 'foobar'), qr/X-Body: foobar_eos\x0d?$/ms,
6060
'fastcgi body');
6161

62-
TODO: {
63-
local $TODO = 'not yet' unless $t->has_version('1.9.15');
64-
6562
like(http(<<EOF), qr/X-Body: foobar_eos\x0d?$/ms, 'fastcgi chunked');
6663
GET / HTTP/1.1
6764
Host: localhost
@@ -84,8 +81,6 @@ Transfer-Encoding: chunked
8481
8582
EOF
8683

87-
}
88-
8984
###############################################################################
9085

9186
sub http_get_length {

fastcgi_cache.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ eval { require FCGI; };
2525
plan(skip_all => 'FCGI not installed') if $@;
2626
plan(skip_all => 'win32') if $^O eq 'MSWin32';
2727

28-
my $t = Test::Nginx->new()->has(qw/http fastcgi cache shmem/)->plan(5)
28+
my $t = Test::Nginx->new()->has(qw/http fastcgi cache/)->plan(5)
2929
->write_file_expand('nginx.conf', <<'EOF');
3030
3131
%%TEST_GLOBALS%%

fastcgi_merge_params.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ eval { require FCGI; };
2525
plan(skip_all => 'FCGI not installed') if $@;
2626
plan(skip_all => 'win32') if $^O eq 'MSWin32';
2727

28-
my $t = Test::Nginx->new()->has(qw/http fastcgi cache shmem/)->plan(9)
28+
my $t = Test::Nginx->new()->has(qw/http fastcgi cache/)->plan(9)
2929
->write_file_expand('nginx.conf', <<'EOF');
3030
3131
%%TEST_GLOBALS%%

fastcgi_merge_params2.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ eval { require FCGI; };
2525
plan(skip_all => 'FCGI not installed') if $@;
2626
plan(skip_all => 'win32') if $^O eq 'MSWin32';
2727

28-
my $t = Test::Nginx->new()->has(qw/http fastcgi cache shmem/)->plan(4)
28+
my $t = Test::Nginx->new()->has(qw/http fastcgi cache/)->plan(4)
2929
->write_file_expand('nginx.conf', <<'EOF');
3030
3131
%%TEST_GLOBALS%%

h2.t

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,6 @@ is($frame->{headers}->{':status'}, 200, 'padding - next stream');
451451

452452
# padding followed by CONTINUATION
453453

454-
TODO: {
455-
local $TODO = 'not yet' unless $t->has_version('1.9.11');
456-
457454
$s = Test::Nginx::HTTP2->new();
458455
$sid = $s->new_stream({ padding => 42, continuation => [ 2, 4, 1, 5 ],
459456
headers => [
@@ -466,8 +463,6 @@ $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
466463
($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
467464
is($frame->{headers}->{':status'}, 200, 'padding - CONTINUATION');
468465

469-
}
470-
471466
# internal redirect
472467

473468
$s = Test::Nginx::HTTP2->new();
@@ -625,9 +620,6 @@ is($frame->{headers}->{'content-type'}, 'text/plain; charset=utf-8', 'charset');
625620
# partial request header frame received (field split),
626621
# the rest of frame is received after client header timeout
627622

628-
TODO: {
629-
local $TODO = 'not yet' unless $t->has_version('1.9.12');
630-
631623
$s = Test::Nginx::HTTP2->new(port(8087));
632624
$sid = $s->new_stream({ path => '/t2.html', split => [35],
633625
split_delay => 2.1 });
@@ -637,8 +629,6 @@ $frames = $s->read(all => [{ type => 'RST_STREAM' }]);
637629
ok($frame, 'client header timeout');
638630
is($frame->{code}, 1, 'client header timeout - protocol error');
639631

640-
}
641-
642632
$s->h2_ping('SEE-THIS');
643633
$frames = $s->read(all => [{ type => 'PING' }]);
644634

@@ -647,9 +637,6 @@ ok($frame, 'client header timeout - PING');
647637

648638
# partial request body data frame received, the rest is after body timeout
649639

650-
TODO: {
651-
local $TODO = 'not yet' unless $t->has_version('1.9.12');
652-
653640
$s = Test::Nginx::HTTP2->new(port(8087));
654641
$sid = $s->new_stream({ path => '/proxy/t2.html', body_more => 1 });
655642
$s->h2_body('TEST', { split => [10], split_delay => 2.1 });
@@ -659,15 +646,12 @@ $frames = $s->read(all => [{ type => 'RST_STREAM' }]);
659646
ok($frame, 'client body timeout');
660647
is($frame->{code}, 1, 'client body timeout - protocol error');
661648

662-
}
663-
664649
$s->h2_ping('SEE-THIS');
665650
$frames = $s->read(all => [{ type => 'PING' }]);
666651

667652
($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames;
668653
ok($frame, 'client body timeout - PING');
669654

670-
671655
# proxied request with logging pristine request header field (e.g., referer)
672656

673657
$s = Test::Nginx::HTTP2->new();

h2_headers.t

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,8 @@ $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
405405

406406
($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
407407
is($frame->{headers}->{'x-sent-foo'}, 'aaaaa', 'well known chars');
408-
409-
TODO: {
410-
local $TODO = 'not yet' unless $t->has_version('1.9.12');
411-
412408
unlike($s->{headers}, qr/aaaaa/, 'well known chars - huffman encoding');
413409

414-
}
415-
416410
# response header field with huffman encoding - complete table mod \0, CR, LF
417411
# first saturate with short-encoded characters (NB: implementation detail)
418412

@@ -429,14 +423,8 @@ $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
429423

430424
($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
431425
is($frame->{headers}->{'x-sent-foo'}, $field, 'all chars');
432-
433-
TODO: {
434-
local $TODO = 'not yet' unless $t->has_version('1.9.12');
435-
436426
unlike($s->{headers}, qr/abcde/, 'all chars - huffman encoding');
437427

438-
}
439-
440428
# 6.3. Dynamic Table Size Update
441429

442430
# remove some indexed headers from the dynamic table
@@ -657,9 +645,6 @@ cmp_ok($data[-1], '<=', 2**14, 'response header frames limited');
657645

658646
# response header frame sent in parts
659647

660-
TODO: {
661-
local $TODO = 'not yet' unless $t->has_version('1.9.7');
662-
663648
$s = Test::Nginx::HTTP2->new(port(8082));
664649
$s->h2_settings(0, 0x5 => 2**17);
665650

@@ -690,8 +675,6 @@ cmp_ok($lengths, '<=', 16384, 'response header split - max size');
690675
is(length join('', @{@$frames[-1]->{headers}->{'x-longheader'}}), 98304,
691676
'response header split - headers');
692677

693-
}
694-
695678
# max_field_size - header field name
696679

697680
$s = Test::Nginx::HTTP2->new(port(8084));
@@ -951,9 +934,6 @@ is($frame->{code}, 1, 'newline in request header - RST_STREAM code');
951934

952935
# invalid header name as seen with underscore should not lead to ignoring rest
953936

954-
TODO: {
955-
local $TODO = 'not yet' unless $t->has_version('1.9.7');
956-
957937
$s = Test::Nginx::HTTP2->new();
958938
$sid = $s->new_stream({ headers => [
959939
{ name => ':method', value => 'GET', mode => 0 },
@@ -967,8 +947,6 @@ $frames = $s->read(all => [{ type => 'HEADERS' }]);
967947
($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
968948
is($frame->{headers}->{'x-referer'}, 'see-this', 'after invalid header name');
969949

970-
}
971-
972950
# missing mandatory request header ':scheme'
973951

974952
TODO: {

h2_limit_req.t

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ select STDOUT; $| = 1;
2626
my $t = Test::Nginx->new()->has(qw/http http_v2 proxy rewrite limit_req/)
2727
->plan(7);
2828

29-
$t->todo_alerts() unless $t->has_version('1.9.14');
30-
3129
$t->write_file_expand('nginx.conf', <<'EOF');
3230
3331
%%TEST_GLOBALS%%
@@ -81,9 +79,6 @@ my ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
8179
is(read_body_file($frame->{headers}->{'x-body-file'}), 'TEST',
8280
'request body - limit req');
8381

84-
TODO: {
85-
local $TODO = 'not yet' unless $t->has_version('1.9.15');
86-
8782
$s = Test::Nginx::HTTP2->new();
8883
$sid = $s->new_stream({ path => '/proxy_limit_req/', body_more => 1 });
8984
select undef, undef, undef, 1.1;
@@ -94,8 +89,6 @@ $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
9489
is(read_body_file($frame->{headers}->{'x-body-file'}), 'TEST',
9590
'request body - limit req - limited');
9691

97-
}
98-
9992
# request body delayed in limit_req - with an empty DATA frame
10093
# "zero size buf in output" alerts seen
10194

@@ -114,7 +107,6 @@ $sid = $s->new_stream();
114107
my ($maxwin) = sort {$a <=> $b} $s->{streams}{$sid}, $s->{conn_window};
115108

116109
SKIP: {
117-
skip 'leaves coredump', 1 unless $t->has_version('1.9.7');
118110
skip 'not enough window', 1 if $maxwin < 5;
119111

120112
$s = Test::Nginx::HTTP2->new();
@@ -136,10 +128,6 @@ $s = Test::Nginx::HTTP2->new();
136128
SKIP: {
137129
skip 'not enough window', 1 if $maxwin < 4;
138130

139-
TODO: {
140-
todo_skip 'use-after-free', 1 unless $ENV{TEST_NGINX_UNSAFE}
141-
or $t->has_version('1.9.12');
142-
143131
$sid = $s->new_stream({ path => '/limit_req', body => 'TEST', split => [61],
144132
split_delay => 1.1 });
145133
$frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
@@ -149,8 +137,6 @@ is($frame->{headers}->{':status'}, '200', 'discard body - limit req - limited');
149137

150138
}
151139

152-
}
153-
154140
$sid = $s->new_stream({ path => '/' });
155141
$frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
156142

@@ -163,10 +149,6 @@ is($frame->{headers}->{':status'}, '200', 'discard body - limit req - next');
163149
SKIP: {
164150
skip 'not enough window', 1 if $maxwin < 4;
165151

166-
TODO: {
167-
todo_skip 'use-after-free', 1 unless $ENV{TEST_NGINX_UNSAFE}
168-
or $t->has_version('1.9.12');
169-
170152
$s = Test::Nginx::HTTP2->new();
171153
$sid = $s->new_stream({ path => '/limit_req', body => 'TEST', split => [61],
172154
abort => 1 });
@@ -178,8 +160,6 @@ pass('discard body - limit req - eof');
178160

179161
}
180162

181-
}
182-
183163
###############################################################################
184164

185165
sub read_body_file {

h2_proxy_ssl.t

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ select STDOUT; $| = 1;
2626
my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy/)
2727
->has_daemon('openssl')->plan(1);
2828

29-
$t->todo_alerts() unless $t->has_version('1.9.14');
30-
3129
$t->write_file_expand('nginx.conf', <<'EOF');
3230
3331
%%TEST_GLOBALS%%
@@ -83,9 +81,6 @@ $t->run();
8381
# request body with an empty DATA frame proxied to ssl backend
8482
# "zero size buf in output" alerts seen
8583

86-
TODO: {
87-
local $TODO = 'not yet' unless $t->has_version('1.9.14');
88-
8984
my $s = Test::Nginx::HTTP2->new();
9085
my $sid = $s->new_stream({ path => '/proxy_ssl/', body_more => 1 });
9186
$s->h2_body('');
@@ -94,6 +89,4 @@ my $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
9489
my ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
9590
is($frame->{headers}->{':status'}, 200, 'empty request body');
9691

97-
}
98-
9992
###############################################################################

0 commit comments

Comments
 (0)