aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2014-12-17 10:51:44 +0100
committerHans Nilsson <[email protected]>2014-12-17 11:56:33 +0100
commit5779cb36ffd1b3d5d3f9eeb51f740fde80a45129 (patch)
tree52609b39b9396900f69f718673024849fbdf8473
parent076c58c56d1970fe07e59d14e4dd7dd47496ec7f (diff)
downloadotp-5779cb36ffd1b3d5d3f9eeb51f740fde80a45129.tar.gz
otp-5779cb36ffd1b3d5d3f9eeb51f740fde80a45129.tar.bz2
otp-5779cb36ffd1b3d5d3f9eeb51f740fde80a45129.zip
eldap: Test cases for a few return values (open, close)
-rw-r--r--lib/eldap/test/eldap_basic_SUITE.erl30
1 files changed, 29 insertions, 1 deletions
diff --git a/lib/eldap/test/eldap_basic_SUITE.erl b/lib/eldap/test/eldap_basic_SUITE.erl
index b6b618fcde..95f019bd55 100644
--- a/lib/eldap/test/eldap_basic_SUITE.erl
+++ b/lib/eldap/test/eldap_basic_SUITE.erl
@@ -33,6 +33,7 @@ all() ->
[app,
appup,
{group, encode_decode},
+ {group, return_values},
{group, v4_connections},
{group, v6_connections},
{group, plain_api},
@@ -70,7 +71,10 @@ groups() ->
modify_dn_delete_old,
modify_dn_keep_old]},
{v4_connections, [], connection_tests()},
- {v6_connections, [], connection_tests()}
+ {v6_connections, [], connection_tests()},
+ {return_values, [], [open_ret_val_success,
+ open_ret_val_error,
+ close_ret_val]}
].
connection_tests() ->
@@ -103,6 +107,14 @@ end_per_suite(_Config) ->
ssl:stop().
+init_per_group(return_values, Config) ->
+ case ?config(ldap_server,Config) of
+ undefined ->
+ {skip, "LDAP server not availble"};
+ {Host,Port} ->
+ ct:comment("ldap://~s:~p",[Host,Port]),
+ Config
+ end;
init_per_group(plain_api, Config0) ->
case ?config(ldap_server,Config0) of
undefined ->
@@ -253,6 +265,22 @@ appup(Config) when is_list(Config) ->
ok = test_server:appup_test(eldap).
%%%----------------------------------------------------------------
+open_ret_val_success(Config) ->
+ {Host,Port} = ?config(ldap_server,Config),
+ {ok,H} = eldap:open([Host], [{port,Port}]),
+ catch eldap:close(H).
+
+%%%----------------------------------------------------------------
+open_ret_val_error(_Config) ->
+ {error,_} = eldap:open(["nohost.example.com"], [{port,65535}]).
+
+%%%----------------------------------------------------------------
+close_ret_val(Config) ->
+ {Host,Port} = ?config(ldap_server,Config),
+ {ok,H} = eldap:open([Host], [{port,Port}]),
+ ok = eldap:close(H).
+
+%%%----------------------------------------------------------------
tcp_connection(Config) ->
Host = proplists:get_value(listen_host, Config),
Port = proplists:get_value(listen_port, Config),