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