From d0a3ce8056342c7db8957a6879eb5ece287bbf75 Mon Sep 17 00:00:00 2001 From: Aapo Talvensaari Date: Thu, 17 Feb 2022 20:52:44 +0200 Subject: [PATCH] chore(deps) bump pgmoon from 1.13.0 to 1.14.0 ### Summary See: https://github.com/leafo/pgmoon/releases/tag/v1.14.0 ### Issues Resolved Fix #8259 --- kong-2.7.0-0.rockspec | 2 +- spec/02-integration/03-db/01-db_spec.lua | 172 +++++++++++++++-------- 2 files changed, 115 insertions(+), 59 deletions(-) diff --git a/kong-2.7.0-0.rockspec b/kong-2.7.0-0.rockspec index 92f96ca74266..0f307d517b83 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.13.0", + "pgmoon == 1.14.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 10d58fcd3840..10af4723125d 100644 --- a/spec/02-integration/03-db/01-db_spec.lua +++ b/spec/02-integration/03-db/01-db_spec.lua @@ -285,11 +285,13 @@ for _, strategy in helpers.each_strategy() do if strategy == "postgres" then assert.equal("nginx", db.connector:get_stored_connection().sock_type) - --elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer + 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) end - assert.is_false(db.connector:get_stored_connection().ssl) db:close() end) @@ -308,13 +310,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) - --elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - end + assert.equal("luasocket", db.connector:get_stored_connection().sock_type) + assert.is_false(db.connector:get_stored_connection().config.ssl) - assert.is_false(db.connector:get_stored_connection().ssl) + elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer + assert.is_false(db.connector:get_stored_connection().ssl) + end db:close() end) @@ -339,11 +341,12 @@ for _, strategy in helpers.each_strategy() do if strategy == "postgres" then assert.equal("nginx", 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().config.ssl) - assert.is_true(db.connector:get_stored_connection().ssl) + elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer + assert.is_true(db.connector:get_stored_connection().ssl) + end db:close() end) @@ -367,13 +370,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) - --elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer - end + assert.equal("luasocket", db.connector:get_stored_connection().sock_type) + assert.is_true(db.connector:get_stored_connection().config.ssl) - assert.is_true(db.connector:get_stored_connection().ssl) + elseif strategy == "cassandra" then + --TODO: cassandra forces luasocket on timer + assert.is_true(db.connector:get_stored_connection().ssl) + end db:close() end) @@ -398,7 +401,12 @@ 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) - assert.is_false(db.connector:get_stored_connection("read").ssl) + + 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 db:close() end) @@ -423,10 +431,20 @@ 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) - assert.is_false(db.connector:get_stored_connection("write").ssl) + + 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.equal("luasocket", db.connector:get_stored_connection().sock_type) - assert.is_false(db.connector:get_stored_connection().ssl) + + 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 db:close() end) @@ -451,13 +469,16 @@ 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) - --elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer + 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) end - assert.is_false(db.connector:get_stored_connection().ssl) assert.is_true(db:setkeepalive()) db:close() @@ -477,13 +498,15 @@ 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) - --elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer + 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) end - assert.is_false(db.connector:get_stored_connection().ssl) + assert.is_true(db:setkeepalive()) db:close() @@ -509,11 +532,13 @@ for _, strategy in helpers.each_strategy() do if strategy == "postgres" then assert.equal("nginx", db.connector:get_stored_connection().sock_type) - --elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer + 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) end - assert.is_true(db.connector:get_stored_connection().ssl) assert.is_true(db:setkeepalive()) db:close() @@ -538,13 +563,15 @@ 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) - --elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer + 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) end - assert.is_true(db.connector:get_stored_connection().ssl) + assert.is_true(db:setkeepalive()) db:close() @@ -599,8 +626,14 @@ 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) - assert.is_false(db.connector:get_stored_connection("read").ssl) - assert.is_false(db.connector:get_stored_connection("write").ssl) + 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_true(db:setkeepalive()) @@ -634,7 +667,11 @@ 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")) - assert.is_false(db.connector:get_stored_connection("write").ssl) + 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_true(db:setkeepalive()) @@ -666,11 +703,14 @@ for _, strategy in helpers.each_strategy() do if strategy == "postgres" then assert.equal("nginx", db.connector:get_stored_connection().sock_type) - --elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer + 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) end - assert.is_false(db.connector:get_stored_connection().ssl) + assert.is_true(db:close()) end) @@ -689,11 +729,14 @@ for _, strategy in helpers.each_strategy() do if strategy == "postgres" then assert.equal("luasocket", db.connector:get_stored_connection().sock_type) - --elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer + 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) end - assert.is_false(db.connector:get_stored_connection().ssl) + assert.is_true(db:close()) end) @@ -717,11 +760,13 @@ for _, strategy in helpers.each_strategy() do if strategy == "postgres" then assert.equal("nginx", db.connector:get_stored_connection().sock_type) - --elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer + 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) end - assert.is_true(db.connector:get_stored_connection().ssl) assert.is_true(db:close()) end) @@ -744,13 +789,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) - --elseif strategy == "cassandra" then - --TODO: cassandra forces luasocket on timer + 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) end - assert.is_true(db.connector:get_stored_connection().ssl) assert.is_true(db:close()) end) @@ -803,8 +849,14 @@ 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) - assert.is_false(db.connector:get_stored_connection("read").ssl) - assert.is_false(db.connector:get_stored_connection("write").ssl) + 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_true(db:close()) @@ -837,7 +889,11 @@ 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")) - assert.is_false(db.connector:get_stored_connection("write").ssl) + 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_true(db:close())