Mercurial > hg > nginx-tests
comparison spdy.t @ 376:ab2d8abea393
Tests: skip proxy cache conditional test if we didn't get etag.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 24 Feb 2014 12:52:35 +0400 |
parents | ac804fd1eb56 |
children | ba95a443ff1f |
comparison
equal
deleted
inserted
replaced
375:5fdde9f755c9 | 376:ab2d8abea393 |
---|---|
241 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | 241 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
242 | 242 |
243 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | 243 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; |
244 is($frame->{headers}->{':status'}, '200 OK', 'proxy cache unconditional'); | 244 is($frame->{headers}->{':status'}, '200 OK', 'proxy cache unconditional'); |
245 | 245 |
246 my $ims = $frame->{headers}->{'etag'}; | 246 my $etag = $frame->{headers}->{'etag'}; |
247 | |
248 SKIP: { | |
249 skip 'no etag', 1 unless defined $etag; | |
247 | 250 |
248 $sid2 = spdy_stream($sess, { path => '/proxy/t2.html', | 251 $sid2 = spdy_stream($sess, { path => '/proxy/t2.html', |
249 headers => { "if-none-match" => $ims } | 252 headers => { "if-none-match" => $etag } |
250 }); | 253 }); |
251 $frames = spdy_read($sess, all => [{ sid => $sid2, fin => 1 }]); | 254 $frames = spdy_read($sess, all => [{ sid => $sid2, fin => 1 }]); |
252 | 255 |
253 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | 256 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; |
254 is($frame->{headers}->{':status'}, 304, 'proxy cache conditional'); | 257 is($frame->{headers}->{':status'}, 304, 'proxy cache conditional'); |
258 | |
259 } | |
255 | 260 |
256 # request body (uses proxied response) | 261 # request body (uses proxied response) |
257 | 262 |
258 $sess = new_session(); | 263 $sess = new_session(); |
259 $sid1 = spdy_stream($sess, { path => '/proxy/t2.html', body => 'TEST' }); | 264 $sid1 = spdy_stream($sess, { path => '/proxy/t2.html', body => 'TEST' }); |