aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/test
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2012-11-05 12:40:02 +0100
committerFredrik Gustafsson <[email protected]>2012-11-05 12:40:02 +0100
commit6a17960f0610ebaa332cf7f2037d01df47f5f5d8 (patch)
tree86d2e20b99a8385131ebef8f575a5e92e95d380e /lib/ssh/test
parent104d902c2e325060ab66abc05a449194792dee7a (diff)
downloadotp-6a17960f0610ebaa332cf7f2037d01df47f5f5d8.tar.gz
otp-6a17960f0610ebaa332cf7f2037d01df47f5f5d8.tar.bz2
otp-6a17960f0610ebaa332cf7f2037d01df47f5f5d8.zip
Added testcase for idle timer
Diffstat (limited to 'lib/ssh/test')
-rw-r--r--lib/ssh/test/ssh_basic_SUITE.erl24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index 7a641c92c1..61b91e3a25 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -42,6 +42,7 @@ all() ->
{group, dsa_pass_key},
{group, rsa_pass_key},
{group, internal_error},
+ idle_time,
daemon_already_started,
server_password_option,
server_userpassword_option,
@@ -234,7 +235,28 @@ exec_compressed(Config) when is_list(Config) ->
ssh:stop_daemon(Pid).
%%--------------------------------------------------------------------
-
+idle_time(doc) ->
+ ["Idle timeout test"];
+idle_time(Config) ->
+ SystemDir = filename:join(?config(priv_dir, Config), system),
+ UserDir = ?config(priv_dir, Config),
+
+ {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
+ {user_dir, UserDir},
+ {failfun, fun ssh_test_lib:failfun/2}]),
+ ConnectionRef =
+ ssh:connect(Host, Port, [{silently_accept_hosts, true},
+ {user_dir, UserDir},
+ {user_interaction, false},
+ {idle_time, 3000}]),
+ {ok, Id} = ssh_connection:session_channel(ConnectionRef, 1000),
+ ssh_connection:close(ConnectionRef, Id),
+ receive
+ after 10000 ->
+ {error,channel_closed} = ssh_connection:session_channel(ConnectionRef, 1000)
+ end,
+ ssh:stop_daemon(Pid).
+%%--------------------------------------------------------------------
shell(doc) ->
["Test that ssh:shell/2 works"];
shell(Config) when is_list(Config) ->