diff options
author | Ingela Anderton Andin <[email protected]> | 2015-06-23 10:08:51 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2015-06-23 10:08:51 +0200 |
commit | 7cff27e14e051b6ee15f564335eb8e685e1639c1 (patch) | |
tree | b97f48f3482bd7f0651acdaab4eba69709a8c88f /lib/ssl/test/ssl_test_lib.erl | |
parent | c57c5c83acb3a21b52304bc53cbdf32e0dda3690 (diff) | |
parent | 566cbee917638f596c5d46bd0aff331a66f5c8d2 (diff) | |
download | otp-7cff27e14e051b6ee15f564335eb8e685e1639c1.tar.gz otp-7cff27e14e051b6ee15f564335eb8e685e1639c1.tar.bz2 otp-7cff27e14e051b6ee15f564335eb8e685e1639c1.zip |
Merge branch 'ia/ssl/modern-timetrap'
* ia/ssl/modern-timetrap:
ssl: Make init functions fail if make_certs:all fails
ssl: Avoid sleep
ssl: modernize timetrap handling
Diffstat (limited to 'lib/ssl/test/ssl_test_lib.erl')
-rw-r--r-- | lib/ssl/test/ssl_test_lib.erl | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl index 10be48fb2d..da744f7368 100644 --- a/lib/ssl/test/ssl_test_lib.erl +++ b/lib/ssl/test/ssl_test_lib.erl @@ -1150,15 +1150,17 @@ check_sane_openssl_version(Version) -> enough_openssl_crl_support("OpenSSL 0." ++ _) -> false; enough_openssl_crl_support(_) -> true. -wait_for_openssl_server() -> - receive - {Port, {data, Debug}} when is_port(Port) -> - ct:log("~p:~p~nopenssl ~s~n",[?MODULE,?LINE, Debug]), - %% openssl has started make sure - %% it will be in accept. Parsing - %% output is too error prone. (Even - %% more so than sleep!) - ct:sleep(?SLEEP) +wait_for_openssl_server(Port) -> + wait_for_openssl_server(Port, 10). +wait_for_openssl_server(_, 0) -> + exit(failed_to_connect_to_openssl); +wait_for_openssl_server(Port, N) -> + case gen_tcp:connect("localhost", Port, []) of + {ok, S} -> + gen_tcp:close(S); + _ -> + ct:sleep(?SLEEP), + wait_for_openssl_server(Port, N-1) end. version_flag(tlsv1) -> |