Skip to content

Commit

Permalink
Tests: removed TODO and try_run() checks for legacy versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
pluknet committed Aug 25, 2023
1 parent 26f802b commit 6b5ec1d
Show file tree
Hide file tree
Showing 29 changed files with 9 additions and 192 deletions.
10 changes: 0 additions & 10 deletions body_chunked.t
Original file line number Diff line number Diff line change
Expand Up @@ -178,22 +178,12 @@ like(http_transfer_encoding("chunked\nTransfer-Encoding: chunked"),
like(http_transfer_encoding('chunked, identity'), qr/501 Not Implemented/,
'transfer encoding list');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.1');

like(http_transfer_encoding("chunked\nContent-Length: 5"), qr/400 Bad/,
'transfer encoding with content-length');

}

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.2');

like(http_transfer_encoding("chunked", "1.0"), qr/400 Bad/,
'transfer encoding in HTTP/1.0 requests');

}

###############################################################################

sub read_body_file {
Expand Down
5 changes: 0 additions & 5 deletions dav.t
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ like($r, qr/201 Created.*(Content-Length|\x0d\0a0\x0d\x0a)/ms,
is(-s $t->testdir() . '/file', 10,
'put file extra data size');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.0');

$r = http(<<EOF . '0123456789');
PUT /file%20sp HTTP/1.1
Host: localhost
Expand All @@ -121,8 +118,6 @@ EOF

like($r, qr!Location: /file%20sp\x0d?$!ms, 'put file escaped');

}

# 201 replies contain body, response should indicate it's empty

$r = http(<<EOF);
Expand Down
5 changes: 0 additions & 5 deletions grpc.t
Original file line number Diff line number Diff line change
Expand Up @@ -503,17 +503,12 @@ $frames = $f->{field_bad}(n => "n\nn");
($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
is($frame->{headers}{':status'}, 502, 'invalid header name ctl');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.1');

$f->{http_start}('/');
$f->{data}('Hello');
$frames = $f->{field_bad}(n => "n n");
($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
is($frame->{headers}{':status'}, 502, 'invalid header name space');

}

$f->{http_start}('/');
$f->{data}('Hello');
$frames = $f->{field_bad}(v => "v\nv");
Expand Down
5 changes: 0 additions & 5 deletions h2.t
Original file line number Diff line number Diff line change
Expand Up @@ -304,18 +304,13 @@ is($frame, undef, 'HEAD - no body');

# CONNECT

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.1');

$s = Test::Nginx::HTTP2->new();
$sid = $s->new_stream({ method => 'CONNECT' });
$frames = $s->read(all => [{ sid => $sid, fin => 1 }]);

($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
is($frame->{headers}->{':status'}, 405, 'CONNECT - not allowed');

}

# TRACE

$s = Test::Nginx::HTTP2->new();
Expand Down
25 changes: 0 additions & 25 deletions h2_absolute_redirect.t
Original file line number Diff line number Diff line change
Expand Up @@ -121,32 +121,22 @@ like(get('on', '/dir'), qr!Location: http://on:$p/dir/\x0d?$!m, 'directory');
like(get('on', '/i/dir'), qr!Location: http://on:$p/i/dir/\x0d?$!m,
'directory alias');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.0');

like(get('on', '/dir%20sp'), qr!Location: http://on:$p/dir%20sp/\x0d?$!m,
'directory escaped');
like(get('on', '/dir%20sp?a=b'),
qr!Location: http://on:$p/dir%20sp/\?a=b\x0d?$!m,
'directory escaped args');

}

like(get('on', '/auto'), qr!Location: http://on:$p/auto/\x0d?$!m, 'auto');
like(get('on', '/auto?a=b'), qr!Location: http://on:$p/auto/\?a=b\x0d?$!m,
'auto args');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.0');

like(get('on', '/auto%20sp'), qr!Location: http://on:$p/auto%20sp/\x0d?$!m,
'auto escaped');
like(get('on', '/auto%20sp?a=b'),
qr!Location: http://on:$p/auto%20sp/\?a=b\x0d?$!m,
'auto escaped args');

}

like(get('on', '/return301'), qr!Location: http://on:$p/redirect\x0d?$!m,
'return');

Expand All @@ -163,30 +153,20 @@ like(get('host', '/return301/port'), qr!Location: http://host/redirect\x0d?$!m,
like(get('off', '/dir'), qr!Location: /dir/\x0d?$!m, 'off directory');
like(get('off', '/i/dir'), qr!Location: /i/dir/\x0d?$!m, 'off directory alias');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.0');

like(get('off', '/dir%20sp'), qr!Location: /dir%20sp/\x0d?$!m,
'off directory escaped');
like(get('off', '/dir%20sp?a=b'), qr!Location: /dir%20sp/\?a=b\x0d?$!m,
'off directory escaped args');

}

like(get('off', '/auto'), qr!Location: /auto/\x0d?$!m, 'off auto');
like(get('off', '/auto?a=b'), qr!Location: /auto/\?a=b\x0d?$!m,
'off auto args');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.0');

like(get('off', '/auto%20sp'), qr!Location: /auto%20sp/\x0d?$!m,
'auto escaped');
like(get('off', '/auto%20sp?a=b'), qr!Location: /auto%20sp/\?a=b\x0d?$!m,
'auto escaped args');

}

like(get('off', '/return301'), qr!Location: /redirect\x0d?$!m, 'off return');

# per RFC 3986, these characters are not allowed unescaped:
Expand All @@ -196,17 +176,12 @@ like(get('off', '/return301'), qr!Location: /redirect\x0d?$!m, 'off return');
SKIP: {
skip 'win32', 1 if $^O eq 'MSWin32';

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.1');

like(get('off', '/auto%20%22%23%25%3C%3E%3F%5C%5E%60%7B%7C%7D'),
qr!Location: /auto%20%22%23%25%3C%3E%3F%5C%5E%60%7B%7C%7D/\x0d?$!m,
'auto escaped strict');

}

}

###############################################################################

sub get {
Expand Down
5 changes: 0 additions & 5 deletions h2_headers.t
Original file line number Diff line number Diff line change
Expand Up @@ -1090,17 +1090,12 @@ $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
is($frame->{headers}->{':status'}, 400, 'invalid path');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.1');

$sid = $s->new_stream({ path => "/t1.html\x02" });
$frames = $s->read(all => [{ sid => $sid, fin => 1 }]);

($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
is($frame->{headers}->{':status'}, 400, 'invalid path control');

}

# ngx_http_v2_parse_int() error handling

# NGX_ERROR
Expand Down
1 change: 0 additions & 1 deletion h2_request_body_extra.t
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ http {
EOF

plan(skip_all => 'not yet') unless $t->has_version('1.21.2');
$t->plan(50);

# suppress deprecation warning
Expand Down
5 changes: 0 additions & 5 deletions h2_ssl.t
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,10 @@ skip 'OpenSSL too old', 1
if $t->has_module('OpenSSL')
and not $t->has_feature('openssl:1.1.0');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.4');

ok(!get_ssl_socket(['unknown']), 'alpn rejected');

}

}

like(http_get('/', socket => get_ssl_socket(['http/1.1'])),
qr/200 OK/, 'alpn to HTTP/1.1 fallback');

Expand Down
25 changes: 0 additions & 25 deletions http_absolute_redirect.t
Original file line number Diff line number Diff line change
Expand Up @@ -116,32 +116,22 @@ like(get('on', '/dir'), qr!Location: http://on:$p/dir/\x0d?$!m, 'directory');
like(get('on', '/i/dir'), qr!Location: http://on:$p/i/dir/\x0d?$!m,
'directory alias');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.0');

like(get('on', '/dir%20sp'), qr!Location: http://on:$p/dir%20sp/\x0d?$!m,
'directory escaped');
like(get('on', '/dir%20sp?a=b'),
qr!Location: http://on:$p/dir%20sp/\?a=b\x0d?$!m,
'directory escaped args');

}

like(get('on', '/auto'), qr!Location: http://on:$p/auto/\x0d?$!m, 'auto');
like(get('on', '/auto?a=b'), qr!Location: http://on:$p/auto/\?a=b\x0d?$!m,
'auto args');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.0');

like(get('on', '/auto%20sp'), qr!Location: http://on:$p/auto%20sp/\x0d?$!m,
'auto escaped');
like(get('on', '/auto%20sp?a=b'),
qr!Location: http://on:$p/auto%20sp/\?a=b\x0d?$!m,
'auto escaped args');

}

like(get('on', '/return301'), qr!Location: http://on:$p/redirect\x0d?$!m,
'return');

Expand All @@ -158,30 +148,20 @@ like(get('host', '/return301/port'), qr!Location: http://host/redirect\x0d?$!m,
like(get('off', '/dir'), qr!Location: /dir/\x0d?$!m, 'off directory');
like(get('off', '/i/dir'), qr!Location: /i/dir/\x0d?$!m, 'off directory alias');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.0');

like(get('off', '/dir%20sp'), qr!Location: /dir%20sp/\x0d?$!m,
'off directory escaped');
like(get('off', '/dir%20sp?a=b'), qr!Location: /dir%20sp/\?a=b\x0d?$!m,
'off directory escaped args');

}

like(get('off', '/auto'), qr!Location: /auto/\x0d?$!m, 'off auto');
like(get('off', '/auto?a=b'), qr!Location: /auto/\?a=b\x0d?$!m,
'off auto args');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.0');

like(get('off', '/auto%20sp'), qr!Location: /auto%20sp/\x0d?$!m,
'auto escaped');
like(get('off', '/auto%20sp?a=b'), qr!Location: /auto%20sp/\?a=b\x0d?$!m,
'auto escaped args');

}

like(get('off', '/return301'), qr!Location: /redirect\x0d?$!m, 'off return');

# per RFC 3986, these characters are not allowed unescaped:
Expand All @@ -191,17 +171,12 @@ like(get('off', '/return301'), qr!Location: /redirect\x0d?$!m, 'off return');
SKIP: {
skip 'win32', 1 if $^O eq 'MSWin32';

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.1');

like(get('off', '/auto%20%22%23%25%3C%3E%3F%5C%5E%60%7B%7C%7D'),
qr!Location: /auto%20%22%23%25%3C%3E%3F%5C%5E%60%7B%7C%7D/\x0d?$!m,
'auto escaped strict');

}

}

###############################################################################

sub get {
Expand Down
6 changes: 0 additions & 6 deletions http_host.t
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,8 @@ is(http_host_header('123.40.56.78:9000:80'), '123.40.56.78',
'double port hack');

like(http_host_header("localhost\nHost: again", 1), qr/ 400 /, 'host repeat');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.1');

like(http_host_header("localhost\x02", 1), qr/ 400 /, 'control');

}

###############################################################################

sub http_host_header {
Expand Down
2 changes: 0 additions & 2 deletions http_keepalive_shutdown.t
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ $t->run();

###############################################################################

local $TODO = 'not yet' unless $t->has_version('1.21.6');

# signaling on graceful shutdown to client that keepalive connection is closing

my $s = http(<<EOF, start => 1);
Expand Down
5 changes: 0 additions & 5 deletions http_method.t
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ Connection: close
EOF

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.1');

like(http(<<EOF), qr/405 Not Allowed(?!.*200 OK)/s, 'connect');
CONNECT / HTTP/1.1
Host: localhost
Expand All @@ -72,6 +69,4 @@ Connection: close
EOF

}

###############################################################################
11 changes: 0 additions & 11 deletions http_uri.t
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,9 @@ like(http_get('http://localhost:8080?args'), qr!x / x.*y args y!ms,
like(http_get('http://localhost:8080?args#frag'), qr!x / x.*y args y!ms,
'port args and frag');

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.1');

like(http_get('/ /'), qr/400 Bad/, 'space');

}

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.1');

like(http_get("/\x02"), qr/400 Bad/, 'control');

}

like(http_get('/%02'), qr!x /\x02 x!, 'control escaped');

###############################################################################
5 changes: 0 additions & 5 deletions ignore_invalid_headers.t
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,10 @@ my $bad4 = 'GET / HTTP/1.0' . CRLF
my $bad5 = 'GET / HTTP/1.0' . CRLF
. "foo\x02: x-bar" . CRLF . CRLF;

TODO: {
local $TODO = 'not yet' unless $t->has_version('1.21.1');

like(http($bad3), qr/400 Bad/, 'colon first');
like(http($bad4), qr/400 Bad/, 'space');
like(http($bad5), qr/400 Bad/, 'control');

}

###############################################################################

sub get {
Expand Down
Loading

0 comments on commit 6b5ec1d

Please sign in to comment.