Permalink
Browse files

introduced a TEST_NGINX_MYSQL_HOST variable in the test suite. now we…

… can test against a remote mysql directly (without a local tcp proxy).
  • Loading branch information...
1 parent b584915 commit cc6265c42888713f83c0425bad48ed2c206a3548 @agentzh agentzh committed Nov 8, 2011
Showing with 32 additions and 20 deletions.
  1. +2 −1 t/bugs.t
  2. +2 −1 t/charset/000_init.t
  3. +3 −2 t/charset/errors.t
  4. +3 −2 t/charset/keepalive.t
  5. +3 −2 t/charset/methods.t
  6. +3 −2 t/charset/sanity.t
  7. +2 −1 t/errors.t
  8. +2 −1 t/keepalive.t
  9. +3 −2 t/methods.t
  10. +2 −1 t/sanity.t
  11. +5 −4 t/status.t
  12. +2 −1 t/timeout.t
View
3 t/bugs.t
@@ -9,10 +9,11 @@ repeat_each(2);
plan tests => repeat_each() * blocks() + 2;
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
our $http_config = <<'_EOC_';
upstream foo {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_
View
3 t/charset/000_init.t
@@ -8,10 +8,11 @@ repeat_each(1);
plan tests => repeat_each() * blocks();
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
our $http_config = <<'_EOC_';
upstream database {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test
charset=utf8;
}
View
5 t/charset/errors.t
@@ -8,10 +8,11 @@ repeat_each(2);
plan tests => repeat_each() * blocks() + 4;
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
our $http_config = <<'_EOC_';
upstream foo {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test
charset=utf8;
}
@@ -166,7 +167,7 @@ little-endian systems only
--- http_config
upstream foo {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test
charset=blah-blah;
}
View
5 t/charset/keepalive.t
@@ -1,4 +1,4 @@
-# vi:filetype=perl
+# vi:filetype=
use lib 'lib';
use Test::Nginx::Socket;
@@ -8,10 +8,11 @@ repeat_each(2);
plan tests => repeat_each() * 2 * blocks() + 2 * repeat_each() * 6;
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
our $http_config = <<'_EOC_';
upstream backend {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test
charset=utf8;
drizzle_keepalive max=10 overflow=ignore mode=single;
View
5 t/charset/methods.t
@@ -1,4 +1,4 @@
-# vi:filetype=perl
+# vi:filetype=
use lib 'lib';
use Test::Nginx::Socket;
@@ -8,10 +8,11 @@ repeat_each(2);
plan tests => repeat_each() * (blocks() * 3 - 2 * 2);
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
our $http_config = <<'_EOC_';
upstream database {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test
charset=utf8;
}
View
5 t/charset/sanity.t
@@ -1,4 +1,4 @@
-# vi:filetype=perl
+# vi:filetype=
use lib 'lib';
use Test::Nginx::Socket;
@@ -9,10 +9,11 @@ repeat_each(2);
plan tests => repeat_each() * 2 * blocks() + 2 * repeat_each() * 6;
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
our $http_config = <<'_EOC_';
upstream backend {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test
charset=utf8;
#drizzle_keepalive max=10 overflow=ignore mode=single;
View
3 t/errors.t
@@ -8,10 +8,11 @@ repeat_each(2);
plan tests => repeat_each() * blocks() + 2;
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
our $http_config = <<'_EOC_';
upstream foo {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_
View
3 t/keepalive.t
@@ -8,10 +8,11 @@ repeat_each(2);
plan tests => repeat_each() * 2 * blocks() + 2 * repeat_each() * 6;
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
our $http_config = <<'_EOC_';
upstream backend {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test;
drizzle_keepalive max=10 overflow=ignore mode=single;
}
View
5 t/methods.t
@@ -1,4 +1,4 @@
-# vi:filetype=perl
+# vi:filetype=
use lib 'lib';
use Test::Nginx::Socket;
@@ -8,10 +8,11 @@ repeat_each(2);
plan tests => repeat_each() * 26;
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
our $http_config = <<'_EOC_';
upstream database {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_
View
3 t/sanity.t
@@ -8,10 +8,11 @@ repeat_each(2);
plan tests => repeat_each() * 2 * blocks() + 2 * repeat_each() * 6;
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
our $http_config = <<'_EOC_';
upstream backend {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test;
#drizzle_keepalive max=10 overflow=ignore mode=single;
}
View
9 t/status.t
@@ -8,17 +8,18 @@ use Test::Nginx::Socket;
plan tests => repeat_each() * 2 * blocks();
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
#master_on();
our $http_config = <<'_EOC_';
upstream backend {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$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
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test;
#drizzle_keepalive max=10 overflow=ignore mode=single;
}
@@ -29,12 +30,12 @@ _EOC_
our $http_config2 = <<'_EOC_';
upstream backend {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$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
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test;
drizzle_keepalive max=5 overflow=ignore mode=multi;
}
View
3 t/timeout.t
@@ -18,6 +18,7 @@ worker_connections(128);
#log_level('error');
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
no_diff();
@@ -131,7 +132,7 @@ X-Mysql-Tid:
=== TEST 6: serv_config send query timeout (sleep select)
--- http_config
upstream backend {
- drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
+ drizzle_server $TEST_NGINX_MYSQL_HOST:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test;
}

0 comments on commit cc6265c

Please sign in to comment.