From: Marko Kreen Date: Wed, 3 Oct 2007 12:51:45 +0000 (+0000) Subject: more testing X-Git-Tag: pgbouncer_1_1~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb3f66e0abaabb3b91f6ea4f63c5b36ce2546bfc;p=pgbouncer more testing --- diff --git a/test/asynctest.c b/test/asynctest.c index 0d9d13c..ac3d169 100644 --- a/test/asynctest.c +++ b/test/asynctest.c @@ -282,11 +282,12 @@ int main(void) init_bulk_data(); for (i = 0; i < 50; i++) { - db = new_db("dbname=marko port=6000 host=127.0.0.1 password=kama"); + db = new_db("dbname=conntest port=6000 host=127.0.0.1 password=kama"); list_append(&db->head, &idle_list); } + if (1) for (i = 0; i < 50; i++) { - db = new_db("dbname=marko port=7000 host=127.0.0.1 password=kama"); + db = new_db("dbname=conntest port=7000 host=127.0.0.1 password=kama"); list_append(&db->head, &idle_list); } diff --git a/test/conntest.sh b/test/conntest.sh index 3a7024f..05572c6 100755 --- a/test/conntest.sh +++ b/test/conntest.sh @@ -41,10 +41,10 @@ port=7000 fw_reset while true; do - #fw_drop_port $port - #sleep 20 - #fw_reset - #sleep 20 + fw_drop_port $port + sleep 12 + fw_reset + sleep 12 fw_reject_port $port sleep 3 fw_reset diff --git a/test/ctest6000.ini b/test/ctest6000.ini new file mode 100644 index 0000000..744dfc1 --- /dev/null +++ b/test/ctest6000.ini @@ -0,0 +1,44 @@ +;; database name = connect string +[databases] + +; redirect bardb to bazdb on localhost +conntest = host=127.0.0.1 port=7000 dbname=conntest + +;; Configuation section +[pgbouncer] + +logfile = ctest6000.log +pidfile = ctest6000.pid + +listen_addr = 127.0.0.1 +listen_port = 6000 +unix_socket_dir = /tmp + +auth_type = md5 +auth_file = userlist.txt + +admin_users = marko +stats_users = stats + +pool_mode = transaction + +server_reset_query = reset all +server_check_query = select 1 +server_check_delay = 2 + +max_client_conn = 1000 +default_pool_size = 20 + +log_connections = 0 +log_disconnections = 0 +log_pooler_errors = 0 + +server_lifetime = 30 +server_idle_timeout = 3 +server_connect_timeout = 2 +server_login_retry = 5 +query_timeout = 5 + +client_idle_timeout = 10 +client_login_timeout = 50 + diff --git a/test/ctest7000.ini b/test/ctest7000.ini new file mode 100644 index 0000000..770f147 --- /dev/null +++ b/test/ctest7000.ini @@ -0,0 +1,44 @@ +;; database name = connect string +[databases] + +; redirect bardb to bazdb on localhost +conntest = host=127.0.0.1 port=5432 dbname=marko password=kama + +;; Configuation section +[pgbouncer] + +logfile = ctest7000.log +pidfile = ctest7000.pid + +listen_addr = 127.0.0.1 +listen_port = 7000 +unix_socket_dir = /tmp + +auth_type = md5 +auth_file = userlist.txt + +admin_users = marko +stats_users = stats + +pool_mode = transaction + +server_reset_query = reset all +server_check_query = select 1 +server_check_delay = 2 + +max_client_conn = 1000 +default_pool_size = 20 + +log_connections = 0 +log_disconnections = 0 +log_pooler_errors = 0 + +server_lifetime = 30 +server_idle_timeout = 3 +server_connect_timeout = 2 +server_login_retry = 5 +query_timeout = 5 + +client_idle_timeout = 10 +client_login_timeout = 50 + diff --git a/test/run-conntest.sh b/test/run-conntest.sh new file mode 100644 index 0000000..5d6e70f --- /dev/null +++ b/test/run-conntest.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +createdb conntest + +./pgbouncer -d ctest6000.ini +./pgbouncer -d ctest7000.ini + +./asynctest + +# now run conntest.sh on another console + diff --git a/test/userlist.txt b/test/userlist.txt index 166f46d..3c94397 100644 --- a/test/userlist.txt +++ b/test/userlist.txt @@ -1,3 +1,3 @@ -"marko" "asdasd" +"marko" "kama" "postgres" "asdasd" "pgbouncer" "fake"