aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/test/tls_api_SUITE.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2019-07-23 09:53:55 +0200
committerIngela Anderton Andin <[email protected]>2019-07-23 09:53:55 +0200
commite1b53a21573756bbfd469570b1a0352f6ee9e69c (patch)
tree0cf517fb9a3600bc0aebbb5bf672c5df294ead47 /lib/ssl/test/tls_api_SUITE.erl
parentbcffb7f5599efb62f13128e6feeb03a65cd9c11e (diff)
parente01231b85d641a9b993995ad711ad21591c8b780 (diff)
downloadotp-e1b53a21573756bbfd469570b1a0352f6ee9e69c.tar.gz
otp-e1b53a21573756bbfd469570b1a0352f6ee9e69c.tar.bz2
otp-e1b53a21573756bbfd469570b1a0352f6ee9e69c.zip
Merge branch 'ingela/ssl/continue-test-restructure' into maint
* ingela/ssl/continue-test-restructure: ssl: Move alert test to own suite ssl: Move der_input and rizzo tests
Diffstat (limited to 'lib/ssl/test/tls_api_SUITE.erl')
-rw-r--r--lib/ssl/test/tls_api_SUITE.erl26
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/ssl/test/tls_api_SUITE.erl b/lib/ssl/test/tls_api_SUITE.erl
index 18e17679ac..6a61e844c5 100644
--- a/lib/ssl/test/tls_api_SUITE.erl
+++ b/lib/ssl/test/tls_api_SUITE.erl
@@ -69,7 +69,8 @@ api_tests() ->
tls_tcp_error_propagation_in_active_mode,
peername,
sockname,
- tls_server_handshake_timeout
+ tls_server_handshake_timeout,
+ transport_close
].
init_per_suite(Config0) ->
@@ -575,6 +576,29 @@ tls_server_handshake_timeout(Config) ->
[] = supervisor:which_children(tls_connection_sup)
end
end.
+transport_close() ->
+ [{doc, "Test what happens if socket is closed on TCP level after a while of normal operation"}].
+transport_close(Config) when is_list(Config) ->
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
+ ServerOpts = ssl_test_lib:ssl_options(server_rsa_opts, Config),
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Server =
+ ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()},
+ {mfa, {ssl_test_lib, send_recv_result, []}},
+ {options, [{active, false} | ServerOpts]}]),
+ Port = ssl_test_lib:inet_port(Server),
+ {ok, TcpS} = rpc:call(ClientNode, gen_tcp, connect,
+ [Hostname,Port,[binary, {active, false}]]),
+ {ok, SslS} = rpc:call(ClientNode, ssl, connect,
+ [TcpS,[{active, false}|ClientOpts]]),
+
+ ct:log("Testcase ~p, Client ~p Server ~p ~n",
+ [self(), self(), Server]),
+ ok = ssl:send(SslS, "Hello world"),
+ {ok,<<"Hello world">>} = ssl:recv(SslS, 11),
+ gen_tcp:close(TcpS),
+ {error, _} = ssl:send(SslS, "Hello world").
%%--------------------------------------------------------------------
%% Internal functions ------------------------------------------------