diff options
author | Ingela Anderton Andin <[email protected]> | 2013-11-18 10:34:04 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2013-12-02 09:50:27 +0100 |
commit | bae8fb577c0c3d2f5a3db31a34e584c8d7ccab6e (patch) | |
tree | 1188bc6a808d3f7adf19aaa721576631009dd58d /lib/ssl/test/ssl_certificate_verify_SUITE.erl | |
parent | c9a45539359d71aa0c68c9ca45b8015dd0e1b9cd (diff) | |
download | otp-bae8fb577c0c3d2f5a3db31a34e584c8d7ccab6e.tar.gz otp-bae8fb577c0c3d2f5a3db31a34e584c8d7ccab6e.tar.bz2 otp-bae8fb577c0c3d2f5a3db31a34e584c8d7ccab6e.zip |
ssl: Test case enhancement
Make sure that test cases does not fail due to timing circumstances,
use selective receive even if it means we can not use test library functions
in some cases. TCP does not have delivery guarantee to application layer,
so sometimes a error message {error, Msg} or {error, closed} can be acceptable.
Diffstat (limited to 'lib/ssl/test/ssl_certificate_verify_SUITE.erl')
-rw-r--r-- | lib/ssl/test/ssl_certificate_verify_SUITE.erl | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/ssl/test/ssl_certificate_verify_SUITE.erl b/lib/ssl/test/ssl_certificate_verify_SUITE.erl index f76c55f670..14047c6e9c 100644 --- a/lib/ssl/test/ssl_certificate_verify_SUITE.erl +++ b/lib/ssl/test/ssl_certificate_verify_SUITE.erl @@ -250,10 +250,15 @@ server_require_peer_cert_fail(Config) when is_list(Config) -> {host, Hostname}, {from, self()}, {options, [{active, false} | BadClientOpts]}]), - - ssl_test_lib:check_result(Server, {error, {tls_alert, "handshake failure"}}, - Client, {error, {tls_alert, "handshake failure"}}). - + receive + {Server, {error, {tls_alert, "handshake failure"}}} -> + receive + {Client, {error, {tls_alert, "handshake failure"}}} -> + ok; + {Client, {error, closed}} -> + ok + end + end. %%-------------------------------------------------------------------- verify_fun_always_run_client() -> @@ -827,9 +832,16 @@ unknown_server_ca_fail(Config) when is_list(Config) -> [{verify, verify_peer}, {verify_fun, FunAndState} | ClientOpts]}]), + receive + {Server, {error, {tls_alert, "unknown ca"}}} -> + receive + {Client, {error, {tls_alert, "unknown ca"}}} -> + ok; + {Client, {error, closed}} -> + ok + end + end. - ssl_test_lib:check_result(Server, {error, {tls_alert, "unknown ca"}}, - Client, {error, {tls_alert, "unknown ca"}}). %%-------------------------------------------------------------------- unknown_server_ca_accept_verify_none() -> |