aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/test/ssh_basic_SUITE.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-03-22 16:23:27 +0100
committerIngela Anderton Andin <[email protected]>2012-03-22 17:49:04 +0100
commita06cd043eab256539459d765a4856fc156ed96d4 (patch)
treea4e97035e5d9b1a8e3d4bae4df21e9aac61f1167 /lib/ssh/test/ssh_basic_SUITE.erl
parentb2b96f8b37143e760cfe6638c6c4b3bd34604e1f (diff)
downloadotp-a06cd043eab256539459d765a4856fc156ed96d4.tar.gz
otp-a06cd043eab256539459d765a4856fc156ed96d4.tar.bz2
otp-a06cd043eab256539459d765a4856fc156ed96d4.zip
ssh:close/1 will no longer crash if ssl manager already happens to have
been terminated. The function ssh_connection_manager:call now handles that exit reason may be shutdown.
Diffstat (limited to 'lib/ssh/test/ssh_basic_SUITE.erl')
-rw-r--r--lib/ssh/test/ssh_basic_SUITE.erl30
1 files changed, 29 insertions, 1 deletions
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index 012367a6df..d66214d415 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -110,7 +110,8 @@ all() ->
{group, rsa_pass_key},
{group, internal_error},
daemon_already_started,
- server_password_option, server_userpassword_option].
+ server_password_option, server_userpassword_option,
+ close].
groups() ->
[{dsa_key, [], [exec, exec_compressed, shell, known_hosts]},
@@ -507,7 +508,34 @@ internal_error(Config) when is_list(Config) ->
{user_dir, UserDir},
{user_interaction, false}]).
+%%--------------------------------------------------------------------
+close(doc) ->
+ ["Simulate that we try to close an already closed connection"];
+
+close(suite) ->
+ [];
+
+close(Config) when is_list(Config) ->
+ SystemDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+ UserDir = filename:join(PrivDir, nopubkey), % to make sure we don't use public-key-auth
+ file:make_dir(UserDir),
+
+ {_Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
+ {user_dir, UserDir},
+ {user_passwords, [{"vego", "morot"}]},
+ {failfun, fun ssh_test_lib:failfun/2}]),
+ {ok, CM} = ssh:connect(Host, Port, [{silently_accept_hosts, true},
+ {user_dir, UserDir},
+ {user, "vego"},
+ {password, "morot"},
+ {user_interaction, false}]),
+ exit(CM, {shutdown, normal}),
+ ok = ssh:close(CM).
+
+
+
%%--------------------------------------------------------------------
%% Internal functions
%%--------------------------------------------------------------------