Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

now we honor environments TEST_NGINX_MYSQL_HOST and TEST_NGINX_POSTGR…

…ESQL_HOST.
  • Loading branch information...
commit 773662e50205fced2a56320a5f6519ab4f895c66 1 parent 3a576ce
@agentzh agentzh authored
View
73 t/000_init.t
@@ -7,15 +7,27 @@ repeat_each(1);
plan tests => repeat_each() * blocks();
+$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;
+$ENV{TEST_NGINX_POSTGRESQL_HOST} ||= '127.0.0.1';
+
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
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_
+our $http_config2 = <<'_EOC_';
+ upstream database {
+ postgres_server $TEST_NGINX_POSTGRESQL_HOST:$TEST_NGINX_POSTGRESQL_PORT
+ dbname=ngx_test user=ngx_test password=ngx_test;
+ }
+_EOC_
+
+
worker_connections(128);
no_shuffle();
run_tests();
@@ -128,3 +140,62 @@ GET /init
--- error_code: 200
--- timeout: 10
+
+
+=== TEST 8: cats - drop table
+--- http_config eval: $::http_config2
+--- config
+ location = /init {
+ postgres_pass database;
+ postgres_query "DROP TABLE cats";
+ error_page 500 = /ignore;
+ }
+
+ location /ignore { echo "ignore"; }
+--- request
+GET /init
+--- error_code: 200
+--- timeout: 10
+
+
+
+=== TEST 9: cats - create table
+--- http_config eval: $::http_config2
+--- config
+ location = /init {
+ postgres_pass database;
+ postgres_query "CREATE TABLE cats (id integer, name text)";
+ }
+--- request
+GET /init
+--- error_code: 200
+--- timeout: 10
+
+
+
+=== TEST 10: cats - insert value
+--- http_config eval: $::http_config2
+--- config
+ location = /init {
+ postgres_pass database;
+ postgres_query "INSERT INTO cats (id) VALUES (2)";
+ }
+--- request
+GET /init
+--- error_code: 200
+--- timeout: 10
+
+
+
+=== TEST 11: cats - insert value
+--- http_config eval: $::http_config2
+--- config
+ location = /init {
+ postgres_pass database;
+ postgres_query "INSERT INTO cats (id, name) VALUES (3, 'bob')";
+ }
+--- request
+GET /init
+--- error_code: 200
+--- timeout: 10
+
View
2  t/compact/buf.t
@@ -1,4 +1,4 @@
-# vi:filetype=perl
+# vi:filetype=
use lib 'lib';
use Test::Nginx::Socket;
View
3  t/compact/openresty.t
@@ -13,11 +13,12 @@ log_level('warn');
plan tests => repeat_each() * 3 * blocks();
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
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;
}
_EOC_
View
3  t/compact/sanity-stream.t
@@ -10,11 +10,12 @@ repeat_each(1);
plan tests => repeat_each() * 2 * blocks() + 2 * repeat_each() * 3;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
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;
}
_EOC_
View
5 t/compact/sanity.t
@@ -1,4 +1,4 @@
-# vi:filetype=perl
+# vi:filetype=
use lib 'lib';
use Test::Nginx::Socket;
@@ -10,11 +10,12 @@ repeat_each(1);
plan tests => repeat_each() * 2 * blocks() + 2 * repeat_each() * 3;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
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;
}
_EOC_
View
3  t/escape.t
@@ -7,11 +7,12 @@ repeat_each(2);
plan tests => repeat_each() * 2 * blocks();
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
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;
}
_EOC_
View
3  t/form.t
@@ -7,11 +7,12 @@ repeat_each(2);
plan tests => repeat_each() * 2 * blocks();
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
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;
}
_EOC_
View
3  t/openresty.t
@@ -13,11 +13,12 @@ log_level('warn');
plan tests => repeat_each() * 3 * blocks();
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
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;
}
_EOC_
View
7 t/pg.t
@@ -7,6 +7,7 @@ repeat_each(2);
plan tests => repeat_each() * (2 * blocks() + 1);
+$ENV{TEST_NGINX_POSTGRESQL_HOST} ||= '127.0.0.1';
$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;
no_long_string();
@@ -18,7 +19,7 @@ __DATA__
=== TEST 1: bool blob field (keepalive off)
--- http_config
upstream backend {
- postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
+ postgres_server $TEST_NGINX_POSTGRESQL_HOST:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
postgres_keepalive off;
}
@@ -62,7 +63,7 @@ GET /test
=== TEST 2: bool blob field (keepalive on)
--- http_config
upstream backend {
- postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
+ postgres_server $TEST_NGINX_POSTGRESQL_HOST:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
--- config
@@ -105,7 +106,7 @@ GET /test
=== TEST 3: sanity (github issue #2)
--- http_config
upstream backend {
- postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
+ postgres_server $TEST_NGINX_POSTGRESQL_HOST:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
--- config
View
3  t/property.t
@@ -7,11 +7,12 @@ repeat_each(2);
plan tests => repeat_each() * 2 * blocks();
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
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;
}
_EOC_
View
3  t/sanity-stream.t
@@ -10,11 +10,12 @@ repeat_each(1);
plan tests => repeat_each() * 2 * blocks() + 2 * repeat_each() * 3;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
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;
}
_EOC_
View
5 t/sanity.t
@@ -10,11 +10,12 @@ repeat_each(1);
plan tests => repeat_each() * 2 * blocks() + 2 * repeat_each() * 3;
+$ENV{TEST_NGINX_MYSQL_HOST} ||= '127.0.0.1';
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
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;
}
_EOC_
@@ -328,7 +329,7 @@ GET /test
=== TEST 13: strings need to be escaped (forcing utf8)
--- 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
charset=utf8;
}
View
2  util/build.sh
@@ -36,7 +36,7 @@ cd nginx-$version/ || exit 1
if [[ "$BUILD_CLEAN" -eq 1 || ! -f Makefile || "$root/config" -nt Makefile || "$root/util/build.sh" -nt Makefile ]]; then
./configure --prefix=$target \
--with-cc-opt="-O1" \
- --with-ld-opt="-Wl,-rpath,/opt/drizzle/lib" \
+ --with-ld-opt="-Wl,-rpath,/opt/drizzle/lib:/opt/pg9/lib" \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
Please sign in to comment.
Something went wrong with that request. Please try again.