diff options
author | Hans Nilsson <[email protected]> | 2014-12-05 11:04:08 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2014-12-17 10:24:34 +0100 |
commit | c60f63c717eb488abfe9afacf6e1b6461e521aae (patch) | |
tree | 4f2daf106d7b3b4f16b41c87dadd36b53e73035a /lib/eldap/test/eldap_basic_SUITE.erl | |
parent | bb1894e25ce539e3d2417008f3f714a8a09ed045 (diff) | |
download | otp-c60f63c717eb488abfe9afacf6e1b6461e521aae.tar.gz otp-c60f63c717eb488abfe9afacf6e1b6461e521aae.tar.bz2 otp-c60f63c717eb488abfe9afacf6e1b6461e521aae.zip |
eldap: Adds ssl to connections test suite
Diffstat (limited to 'lib/eldap/test/eldap_basic_SUITE.erl')
-rw-r--r-- | lib/eldap/test/eldap_basic_SUITE.erl | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/lib/eldap/test/eldap_basic_SUITE.erl b/lib/eldap/test/eldap_basic_SUITE.erl index 0ffb98c113..93d83d1f4e 100644 --- a/lib/eldap/test/eldap_basic_SUITE.erl +++ b/lib/eldap/test/eldap_basic_SUITE.erl @@ -64,33 +64,16 @@ groups() -> ]. init_per_suite(Config) -> - SSL_started = - try ssl:start() - of - ok -> true; - {error,{already_started,ssl}} -> true - catch - Error:Reason -> - ct:comment("ssl failed to start"), - ct:log("init_per_suite failed to start ssl Error=~p Reason=~p", [Error, Reason]), - false - end, - - case SSL_started of - true -> make_certs:all("/dev/null", - filename:join(?config(data_dir,Config), "certs")); - false -> ok - end, - + SSL_available = init_ssl_certs_et_al(Config), LDAP_server = find_first_server(false, [{config,eldap_server}, {config,ldap_server}, {"localhost",9876}]), LDAPS_server = - case SSL_started of + case SSL_available of true -> find_first_server(true, [{config,ldaps_server}, {"localhost",9877}]); false -> undefined end, - [{ssl_available, SSL_started}, + [{ssl_available, SSL_available}, {ldap_server, LDAP_server}, {ldaps_server, LDAPS_server} | Config]. @@ -635,3 +618,31 @@ supported_extension(OID, Config) -> _Ok = eldap:close(H), false end. + +%%%---------------------------------------------------------------- +init_ssl_certs_et_al(Config) -> + try ssl:start() + of + R when R==ok ; R=={error,{already_started,ssl}} -> + try make_certs:all("/dev/null", + filename:join(?config(data_dir,Config), "certs")) + of + {ok,_} -> true; + Other -> + ct:comment("make_certs failed"), + ct:log("make_certs failed ~p", [Other]), + false + catch + C:E -> + ct:comment("make_certs crashed"), + ct:log("make_certs failed ~p:~p", [C,E]), + false + end; + _ -> + false + catch + Error:Reason -> + ct:comment("ssl failed to start"), + ct:log("init_per_suite failed to start ssl Error=~p Reason=~p", [Error, Reason]), + false + end. |