MSPF-458: Fix ssl SUITE tests (#106)

* MSPF-458: Fix ssl SUITE tests

* MSPF-458: Remove extra newline
This commit is contained in:
Sergey Elin 2019-06-19 18:32:52 +03:00 committed by GitHub
parent a4921bde49
commit f0df3414cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,11 +90,13 @@ end_per_suite(C) ->
client_wo_cert_test(C) -> client_wo_cert_test(C) ->
SSLOptions = [{cacertfile, ?ca_cert(C)}], SSLOptions = [{cacertfile, ?ca_cert(C)}],
?assertException( try
error, get_weapon(?FUNCTION_NAME, <<"BFG">>, SSLOptions),
{woody_error, {internal, result_unexpected, <<"{tls_alert,\"handshake failure\"}">>}}, error(unreachable)
get_weapon(?FUNCTION_NAME, <<"BFG">>, SSLOptions) catch
). error:{woody_error, {internal, result_unexpected, Reason}} ->
{match, _} = re:run(Reason, <<"^{tls_alert,[\"\{]handshake[ _]failure.*$">>, [])
end.
-spec valid_client_cert_test(config()) -> _. -spec valid_client_cert_test(config()) -> _.
@ -106,11 +108,13 @@ valid_client_cert_test(C) ->
invalid_client_cert_test(C) -> invalid_client_cert_test(C) ->
SSLOptions = [{cacertfile, ?ca_cert(C)}, {certfile, ?invalid_client_cert(C)}], SSLOptions = [{cacertfile, ?ca_cert(C)}, {certfile, ?invalid_client_cert(C)}],
?assertException( try
error, get_weapon(?FUNCTION_NAME, <<"BFG">>, SSLOptions),
{woody_error, {internal, result_unexpected, <<"{tls_alert,\"unknown ca\"}">>}}, error(unreachable)
get_weapon(?FUNCTION_NAME, <<"BFG">>, SSLOptions) catch
). error:{woody_error, {internal, result_unexpected, Reason}} ->
{match, _} = re:run(Reason, <<"^{tls_alert,[\"\{]unknown[ _]ca.*$">>, [])
end.
%%% %%%
%%% woody_event_handler callback %%% woody_event_handler callback