# HG changeset patch # User Maxim Dounin # Date 1363888845 -14400 # Node ID 6cbcfb4ef7ee8a234eed93943bd2310db33580ce # Parent ccebd3168b5b730469e0ab34ba740a6781f5947e Tests: correct has() checks for upstream keepalive tests. diff --git a/fastcgi_keepalive.t b/fastcgi_keepalive.t --- a/fastcgi_keepalive.t +++ b/fastcgi_keepalive.t @@ -21,7 +21,8 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->write_file_expand('nginx.conf', <<'EOF')->plan(6); +my $t = Test::Nginx->new()->has(qw/http fastcgi upstream_keepalive/)->plan(6) + ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm --- a/lib/Test/Nginx.pm +++ b/lib/Test/Nginx.pm @@ -100,6 +100,10 @@ sub has_module($) { browser => '(?s)^(?!.*--without-http_browser_module)', upstream_ip_hash => '(?s)^(?!.*--without-http_upstream_ip_hash_module)', + upstream_least_conn + => '(?s)^(?!.*--without-http_upstream_least_conn_mod)', + upstream_keepalive + => '(?s)^(?!.*--without-http_upstream_keepalive_modu)', http => '(?s)^(?!.*--without-http(?!\S))', cache => '(?s)^(?!.*--without-http-cache)', pop3 => '(?s)^(?!.*--without-mail_pop3_module)', diff --git a/memcached_keepalive.t b/memcached_keepalive.t --- a/memcached_keepalive.t +++ b/memcached_keepalive.t @@ -24,7 +24,8 @@ select STDOUT; $| = 1; eval { require Cache::Memcached; }; plan(skip_all => 'Cache::Memcached not installed') if $@; -my $t = Test::Nginx->new()->has('rewrite')->has_daemon('memcached')->plan(16) +my $t = Test::Nginx->new()->has(qw/http memcached upstream_keepalive rewrite/) + ->has_daemon('memcached')->plan(16) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% diff --git a/memcached_keepalive_stale.t b/memcached_keepalive_stale.t --- a/memcached_keepalive_stale.t +++ b/memcached_keepalive_stale.t @@ -24,7 +24,8 @@ select STDOUT; $| = 1; eval { require Cache::Memcached; }; plan(skip_all => 'Cache::Memcached not installed') if $@; -my $t = Test::Nginx->new()->has('rewrite')->has_daemon('memcached')->plan(2) +my $t = Test::Nginx->new()->has(qw/http memcached upstream_keepalive rewrite/) + ->has_daemon('memcached')->plan(2) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% diff --git a/proxy_keepalive.t b/proxy_keepalive.t --- a/proxy_keepalive.t +++ b/proxy_keepalive.t @@ -24,8 +24,8 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy ssi rewrite/)->plan(50) - ->write_file_expand('nginx.conf', <<'EOF'); +my $t = Test::Nginx->new()->has(qw/http proxy upstream_keepalive ssi rewrite/) + ->plan(50)->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%%