Skip to content

Commit

Permalink
added a test script.
Browse files Browse the repository at this point in the history
  • Loading branch information
agentzh committed Feb 23, 2011
1 parent 081f424 commit 40cfca7
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions t/status.t
@@ -0,0 +1,54 @@
# vi:filetype=

use lib 'lib';
use Test::Nginx::Socket;

#repeat_each(2);

plan tests => repeat_each() * 2 * blocks() + 2 * repeat_each() * 6;

$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;

our $http_config = <<'_EOC_';
upstream backend {
drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test;
drizzle_keepalive max=10 overflow=reject mode=single;
}
upstream backend2 {
drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test;
#drizzle_keepalive max=10 overflow=ignore mode=single;
}
_EOC_

worker_connections(128);

no_long_string();
#no_diff();

run_tests();

__DATA__
=== TEST 1: sanity
--- http_config eval: $::http_config
--- config
location /status {
drizzle_status;
}
--- request
GET /status
--- response_body
upstream backend
active connections: 0
max connections allowed: 10
overflow: reject
upstream backend2
active connections: 0
max connections allowed: 0
overflow: ignore
--- ONLY

0 comments on commit 40cfca7

Please sign in to comment.