comparison h2_proxy_cache.t @ 1462:fe886814b25a

Tests: removed HTTP/2 proxy cache TODO tests for empty DATA frame. RFC7540 doesn't forbid sending of an empty DATA frame at the end of a stream.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 09 Apr 2019 18:52:53 +0300
parents 86e6287707ee
children 2be630357aa7
comparison
equal deleted inserted replaced
1461:7959e58429d0 1462:fe886814b25a
21 ############################################################################### 21 ###############################################################################
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 cache/)->plan(12) 26 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy cache/)->plan(9)
27 ->write_file_expand('nginx.conf', <<'EOF'); 27 ->write_file_expand('nginx.conf', <<'EOF');
28 28
29 %%TEST_GLOBALS%% 29 %%TEST_GLOBALS%%
30 30
31 daemon off; 31 daemon off;
128 128
129 $frames = $s->read(all => [{ sid => $sid, fin => 1 }], wait => 0.2); 129 $frames = $s->read(all => [{ sid => $sid, fin => 1 }], wait => 0.2);
130 push @$frames, $_ for @{$s->read(all => [{ sid => $sid }], wait => 0.2)}; 130 push @$frames, $_ for @{$s->read(all => [{ sid => $sid }], wait => 0.2)};
131 ok(!grep ({ $_->{type} eq "DATA" } @$frames), 'proxy cache HEAD - no body'); 131 ok(!grep ({ $_->{type} eq "DATA" } @$frames), 'proxy cache HEAD - no body');
132 132
133 # proxy cache - expect no stray empty DATA frame
134
135 TODO: {
136 local $TODO = 'not yet';
137
138 $s = Test::Nginx::HTTP2->new();
139 $sid = $s->new_stream({ path => '/cache/t.html?2' });
140
141 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
142 my @data = grep ({ $_->{type} eq "DATA" } @$frames);
143 is(@data, 1, 'proxy cache write - data frames');
144 is(join(' ', map { $_->{data} } @data), 'SEE-THIS', 'proxy cache write - data');
145 is(join(' ', map { $_->{flags} } @data), '1', 'proxy cache write - flags');
146
147 }
148
149 # HEAD on empty cache with proxy_buffering off 133 # HEAD on empty cache with proxy_buffering off
150 134
151 $s = Test::Nginx::HTTP2->new(); 135 $s = Test::Nginx::HTTP2->new();
152 $sid = $s->new_stream( 136 $sid = $s->new_stream(
153 { path => '/proxy_buffering_off/t.html?1', method => 'HEAD' }); 137 { path => '/proxy_buffering_off/t.html?1', method => 'HEAD' });