|
@@ -49,7 +49,8 @@ groups() ->
|
|
|
connect_with_invalid_user,
|
|
|
connect_with_invalid_password,
|
|
|
connect_with_ssl,
|
|
|
- connect_with_client_cert
|
|
|
+ connect_with_client_cert,
|
|
|
+ connect_to_closed_port
|
|
|
| ?MAPS_TESTS
|
|
|
]},
|
|
|
{types, [parallel], [
|
|
@@ -266,6 +267,19 @@ connect_map(Config) ->
|
|
|
ok.
|
|
|
-endif.
|
|
|
|
|
|
+connect_to_closed_port(Config) ->
|
|
|
+ {Host, Port} = epgsql_ct:connection_data(Config),
|
|
|
+ Module = ?config(module, Config),
|
|
|
+ Trap = process_flag(trap_exit, true),
|
|
|
+ ?assertEqual({error, econnrefused},
|
|
|
+ Module:connect(
|
|
|
+ Host,
|
|
|
+ "epgsql_test",
|
|
|
+ "epgsql_test",
|
|
|
+ [{port, Port + 1}, {database, "epgsql_test_db1"}])),
|
|
|
+ ?assertMatch({'EXIT', _, econnrefused}, receive Stop -> Stop end),
|
|
|
+ process_flag(trap_exit, Trap).
|
|
|
+
|
|
|
prepared_query(Config) ->
|
|
|
Module = ?config(module, Config),
|
|
|
epgsql_ct:with_connection(Config, fun(C) ->
|