Mercurial > hg > nginx-tests
diff proxy_cache_range.t @ 500:b4d657ba1a62
Tests: tests for range requests below proxy_cache_min_uses.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 19 Nov 2014 19:45:33 +0300 |
parents | 847ea345becb |
children | 907e89fba9c3 |
line wrap: on
line diff
--- a/proxy_cache_range.t Tue Nov 18 20:48:43 2014 +0300 +++ b/proxy_cache_range.t Wed Nov 19 19:45:33 2014 +0300 @@ -23,7 +23,7 @@ plan(skip_all => 'win32') if $^O eq 'MSWin32'; -my $t = Test::Nginx->new()->has(qw/http proxy cache/)->plan(5) +my $t = Test::Nginx->new()->has(qw/http proxy cache/)->plan(7) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -48,6 +48,12 @@ proxy_cache NAME; proxy_cache_valid 200 1m; } + location /min_uses { + proxy_pass http://127.0.0.1:8081/; + proxy_cache NAME; + proxy_cache_valid 200 1m; + proxy_cache_min_uses 2; + } } server { @@ -81,6 +87,17 @@ like(http_get_range('/t.html?1', 'Range: bytes=0-2,4-'), qr/^SEE.*^THIS/ms, 'cached multipart range'); +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.7.8'); + +like(http_get_range('/min_uses/t.html?3', 'Range: bytes=4-'), + qr/^THIS/m, 'range below min_uses'); + +like(http_get_range('/min_uses/t.html?4', 'Range: bytes=0-2,4-'), + qr/^SEE.*^THIS/ms, 'multipart range below min_uses'); + +} + like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); ###############################################################################