comparison h2_request_body.t @ 1020:196d33c2bb45

Tests: removed TODO and try_run() checks for legacy versions. Also removed now unused spdy.t and shmem prerequisite.
author Andrey Zelenkov <zelenkov@nginx.com>
date Wed, 31 Aug 2016 18:21:07 +0300
parents 882267679006
children efccab043dd3
comparison
equal deleted inserted replaced
1019:41139d6f8b7b 1020:196d33c2bb45
22 22
23 select STDERR; $| = 1; 23 select STDERR; $| = 1;
24 select STDOUT; $| = 1; 24 select STDOUT; $| = 1;
25 25
26 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy/)->plan(42); 26 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy/)->plan(42);
27
28 $t->todo_alerts() unless $t->has_version('1.9.14');
29 27
30 $t->write_file_expand('nginx.conf', <<'EOF'); 28 $t->write_file_expand('nginx.conf', <<'EOF');
31 29
32 %%TEST_GLOBALS%% 30 %%TEST_GLOBALS%%
33 31
139 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]); 137 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
140 138
141 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; 139 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
142 is($frame->{headers}->{':status'}, 200, 'request body - empty'); 140 is($frame->{headers}->{':status'}, 200, 'request body - empty');
143 is($frame->{headers}->{'x-length'}, 0, 'request body - empty size'); 141 is($frame->{headers}->{'x-length'}, 0, 'request body - empty size');
144
145 TODO: {
146 local $TODO = 'not yet' unless $t->has_version('1.9.14');
147
148 ok($frame->{headers}{'x-body-file'}, 'request body - empty body file'); 142 ok($frame->{headers}{'x-body-file'}, 'request body - empty body file');
149
150 }
151
152 TODO: {
153 todo_skip 'empty body file', 1 unless $frame->{headers}{'x-body-file'};
154
155 is(read_body_file($frame->{headers}{'x-body-file'}), '', 143 is(read_body_file($frame->{headers}{'x-body-file'}), '',
156 'request body - empty content'); 144 'request body - empty content');
157
158 }
159 145
160 # it is expected to avoid adding Content-Length for requests without body 146 # it is expected to avoid adding Content-Length for requests without body
161 147
162 $s = Test::Nginx::HTTP2->new(); 148 $s = Test::Nginx::HTTP2->new();
163 $sid = $s->new_stream({ path => '/proxy2/' }); 149 $sid = $s->new_stream({ path => '/proxy2/' });