# HG changeset patch # User Valentin Bartenev # Date 1411588601 -14400 # Node ID 684278f7178373528bbe45b2ce4dab01e3a595d1 # Parent 43e05ac6c23cc9f71d0ed46a90db90a6a9e878f1 Tests: the "limit_zone" directive was removed. diff --git a/limit_conn.t b/limit_conn.t --- a/limit_conn.t +++ b/limit_conn.t @@ -25,7 +25,7 @@ select STDOUT; $| = 1; plan(skip_all => 'win32') if $^O eq 'MSWin32'; -my $t = Test::Nginx->new()->has(qw/http proxy limit_conn limit_req/)->plan(10); +my $t = Test::Nginx->new()->has(qw/http proxy limit_conn limit_req/)->plan(8); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -44,7 +44,6 @@ http { limit_conn_zone $binary_remote_addr zone=zone:1m; limit_conn_zone $binary_remote_addr zone=zone2:1m; limit_conn_zone $binary_remote_addr zone=custom:1m; - limit_zone legacy $binary_remote_addr 1m; server { listen 127.0.0.1:8081; @@ -82,19 +81,12 @@ http { limit_conn_status 501; limit_conn custom 1; } - - location /legacy { - proxy_pass http://127.0.0.1:8081/; - limit_conn legacy 1; - } } } EOF -open OLDERR, ">&", \*STDERR; close STDERR; $t->run(); -open STDERR, ">&", \*OLDERR; ############################################################################### @@ -121,14 +113,6 @@ like(`grep -F '[info]' ${\($t->testdir() qr/limiting connections by zone "custom"/s, 'limit_conn_log_level'); -# limit_zone - -$s = http_get('/legacy/w', start => 1); -like(http_get('/legacy'), qr/^HTTP\/1.. 503 /, 'legacy rejected'); - -$s->close; -unlike(http_get('/legacy'), qr/^HTTP\/.. 503 /, 'legacy passed'); - # limited after unlimited $s = http_get('/w', start => 1);