diff --git a/kong-2.7.0-0.rockspec b/kong-2.7.0-0.rockspec index 0f307d517b83..92f96ca74266 100644 --- a/kong-2.7.0-0.rockspec +++ b/kong-2.7.0-0.rockspec @@ -23,7 +23,7 @@ dependencies = { "version == 1.0.1", "kong-lapis == 1.8.3.1", "lua-cassandra == 1.5.1", - "pgmoon == 1.14.0", + "pgmoon == 1.13.0", "luatz == 0.4", "lua_system_constants == 0.1.4", "lyaml == 6.2.7", diff --git a/spec/02-integration/03-db/01-db_spec.lua b/spec/02-integration/03-db/01-db_spec.lua index 10af4723125d..10d58fcd3840 100644 --- a/spec/02-integration/03-db/01-db_spec.lua +++ b/spec/02-integration/03-db/01-db_spec.lua @@ -285,13 +285,11 @@ for _, strategy in helpers.each_strategy() do if strategy == "postgres" then assert.equal("nginx", db.connector:get_stored_connection().sock_type) - assert.is_false(db.connector:get_stored_connection().config.ssl) - - elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - assert.is_false(db.connector:get_stored_connection().ssl) + --elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer end + assert.is_false(db.connector:get_stored_connection().ssl) db:close() end) @@ -310,14 +308,14 @@ for _, strategy in helpers.each_strategy() do assert.is_table(conn) if strategy == "postgres" then - assert.equal("luasocket", db.connector:get_stored_connection().sock_type) - assert.is_false(db.connector:get_stored_connection().config.ssl) - - elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - assert.is_false(db.connector:get_stored_connection().ssl) + assert.equal("luasocket", + db.connector:get_stored_connection().sock_type) + --elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer end + assert.is_false(db.connector:get_stored_connection().ssl) + db:close() end) @@ -341,13 +339,12 @@ for _, strategy in helpers.each_strategy() do if strategy == "postgres" then assert.equal("nginx", db.connector:get_stored_connection().sock_type) - assert.is_true(db.connector:get_stored_connection().config.ssl) - - elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - assert.is_true(db.connector:get_stored_connection().ssl) + --elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer end + assert.is_true(db.connector:get_stored_connection().ssl) + db:close() end) @@ -370,14 +367,14 @@ for _, strategy in helpers.each_strategy() do assert.is_table(conn) if strategy == "postgres" then - assert.equal("luasocket", db.connector:get_stored_connection().sock_type) - assert.is_true(db.connector:get_stored_connection().config.ssl) - - elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - assert.is_true(db.connector:get_stored_connection().ssl) + assert.equal("luasocket", + db.connector:get_stored_connection().sock_type) + --elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer end + assert.is_true(db.connector:get_stored_connection().ssl) + db:close() end) @@ -401,12 +398,7 @@ for _, strategy in helpers.each_strategy() do assert.is_nil(db.connector:get_stored_connection()) -- empty defaults to "write" assert.equal("nginx", db.connector:get_stored_connection("read").sock_type) - - if strategy == "postgres" then - assert.is_false(db.connector:get_stored_connection("read").config.ssl) - elseif strategy == "cassandra" then - assert.is_false(db.connector:get_stored_connection("read").ssl) - end + assert.is_false(db.connector:get_stored_connection("read").ssl) db:close() end) @@ -431,20 +423,10 @@ for _, strategy in helpers.each_strategy() do assert.is_nil(db.connector:get_stored_connection("read")) assert.equal("luasocket", db.connector:get_stored_connection("write").sock_type) - - if strategy == "portgres" then - assert.is_false(db.connector:get_stored_connection("write").config.ssl) - elseif strategy == "cassandra" then - assert.is_false(db.connector:get_stored_connection("write").ssl) - end + assert.is_false(db.connector:get_stored_connection("write").ssl) assert.equal("luasocket", db.connector:get_stored_connection().sock_type) - - if strategy == "portgres" then - assert.is_false(db.connector:get_stored_connection("write").config.ssl) - elseif strategy == "cassandra" then - assert.is_false(db.connector:get_stored_connection("write").ssl) - end + assert.is_false(db.connector:get_stored_connection().ssl) db:close() end) @@ -469,16 +451,13 @@ for _, strategy in helpers.each_strategy() do assert.is_nil(err) assert.is_table(conn) - if strategy == "postgres" then assert.equal("nginx", db.connector:get_stored_connection().sock_type) - assert.is_false(db.connector:get_stored_connection().config.ssl) - - elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - assert.is_false(db.connector:get_stored_connection().ssl) + --elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer end + assert.is_false(db.connector:get_stored_connection().ssl) assert.is_true(db:setkeepalive()) db:close() @@ -498,15 +477,13 @@ for _, strategy in helpers.each_strategy() do assert.is_table(conn) if strategy == "postgres" then - assert.equal("luasocket", db.connector:get_stored_connection().sock_type) - assert.is_false(db.connector:get_stored_connection().config.ssl) - - elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - assert.is_false(db.connector:get_stored_connection().ssl) + assert.equal("luasocket", + db.connector:get_stored_connection().sock_type) + --elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer end - + assert.is_false(db.connector:get_stored_connection().ssl) assert.is_true(db:setkeepalive()) db:close() @@ -532,13 +509,11 @@ for _, strategy in helpers.each_strategy() do if strategy == "postgres" then assert.equal("nginx", db.connector:get_stored_connection().sock_type) - assert.is_true(db.connector:get_stored_connection().config.ssl) - - elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - assert.is_true(db.connector:get_stored_connection().ssl) + --elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer end + assert.is_true(db.connector:get_stored_connection().ssl) assert.is_true(db:setkeepalive()) db:close() @@ -563,15 +538,13 @@ for _, strategy in helpers.each_strategy() do assert.is_table(conn) if strategy == "postgres" then - assert.equal("luasocket", db.connector:get_stored_connection().sock_type) - assert.is_true(db.connector:get_stored_connection().config.ssl) - - elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - assert.is_true(db.connector:get_stored_connection().ssl) + assert.equal("luasocket", + db.connector:get_stored_connection().sock_type) + --elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer end - + assert.is_true(db.connector:get_stored_connection().ssl) assert.is_true(db:setkeepalive()) db:close() @@ -626,14 +599,8 @@ for _, strategy in helpers.each_strategy() do assert.equal("nginx", db.connector:get_stored_connection("read").sock_type) assert.equal("nginx", db.connector:get_stored_connection("write").sock_type) - if strategy == "postgres" then - assert.is_false(db.connector:get_stored_connection("read").config.ssl) - assert.is_false(db.connector:get_stored_connection("write").config.ssl) - - elseif strategy == "cassandra" then - assert.is_false(db.connector:get_stored_connection("read").ssl) - assert.is_false(db.connector:get_stored_connection("write").ssl) - end + assert.is_false(db.connector:get_stored_connection("read").ssl) + assert.is_false(db.connector:get_stored_connection("write").ssl) assert.is_true(db:setkeepalive()) @@ -667,11 +634,7 @@ for _, strategy in helpers.each_strategy() do assert.equal("luasocket", db.connector:get_stored_connection("write").sock_type) assert.is_nil(db.connector:get_stored_connection("read")) - if strategy == "postgres" then - assert.is_false(db.connector:get_stored_connection("write").config.ssl) - elseif strategy == "cassandra" then - assert.is_false(db.connector:get_stored_connection("write").ssl) - end + assert.is_false(db.connector:get_stored_connection("write").ssl) assert.is_true(db:setkeepalive()) @@ -703,14 +666,11 @@ for _, strategy in helpers.each_strategy() do if strategy == "postgres" then assert.equal("nginx", db.connector:get_stored_connection().sock_type) - assert.is_false(db.connector:get_stored_connection().config.ssl) - - elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - assert.is_false(db.connector:get_stored_connection().ssl) + --elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer end - + assert.is_false(db.connector:get_stored_connection().ssl) assert.is_true(db:close()) end) @@ -729,14 +689,11 @@ for _, strategy in helpers.each_strategy() do if strategy == "postgres" then assert.equal("luasocket", db.connector:get_stored_connection().sock_type) - assert.is_false(db.connector:get_stored_connection().config.ssl) - - elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - assert.is_false(db.connector:get_stored_connection().ssl) + --elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer end - + assert.is_false(db.connector:get_stored_connection().ssl) assert.is_true(db:close()) end) @@ -760,13 +717,11 @@ for _, strategy in helpers.each_strategy() do if strategy == "postgres" then assert.equal("nginx", db.connector:get_stored_connection().sock_type) - assert.is_true(db.connector:get_stored_connection().config.ssl) - - elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - assert.is_true(db.connector:get_stored_connection().ssl) + --elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer end + assert.is_true(db.connector:get_stored_connection().ssl) assert.is_true(db:close()) end) @@ -789,14 +744,13 @@ for _, strategy in helpers.each_strategy() do assert.is_table(conn) if strategy == "postgres" then - assert.equal("luasocket", db.connector:get_stored_connection().sock_type) - assert.is_true(db.connector:get_stored_connection().config.ssl) - - elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - assert.is_true(db.connector:get_stored_connection().ssl) + assert.equal("luasocket", + db.connector:get_stored_connection().sock_type) + --elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer end + assert.is_true(db.connector:get_stored_connection().ssl) assert.is_true(db:close()) end) @@ -849,14 +803,8 @@ for _, strategy in helpers.each_strategy() do assert.equal("nginx", db.connector:get_stored_connection("read").sock_type) assert.equal("nginx", db.connector:get_stored_connection("write").sock_type) - if strategy == "postgres" then - assert.is_false(db.connector:get_stored_connection("read").config.ssl) - assert.is_false(db.connector:get_stored_connection("write").config.ssl) - - elseif strategy == "cassandra" then - assert.is_false(db.connector:get_stored_connection("read").ssl) - assert.is_false(db.connector:get_stored_connection("write").ssl) - end + assert.is_false(db.connector:get_stored_connection("read").ssl) + assert.is_false(db.connector:get_stored_connection("write").ssl) assert.is_true(db:close()) @@ -889,11 +837,7 @@ for _, strategy in helpers.each_strategy() do assert.equal("luasocket", db.connector:get_stored_connection("write").sock_type) assert.is_nil(db.connector:get_stored_connection("read")) - if strategy == "postgres" then - assert.is_false(db.connector:get_stored_connection("write").config.ssl) - elseif strategy == "cassandra" then - assert.is_false(db.connector:get_stored_connection("write").ssl) - end + assert.is_false(db.connector:get_stored_connection("write").ssl) assert.is_true(db:close())