diff options
author | Fredrik Gustafsson <[email protected]> | 2012-11-16 15:07:02 +0100 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2012-11-16 15:07:02 +0100 |
commit | 67bb449ebc3e51a39c73b04eefb25feba6e1aa1e (patch) | |
tree | aa7752f9851ad87409542d206adb279598207841 /lib/ssh/test/ssh_basic_SUITE.erl | |
parent | 9278347678eea78419c0c310f767eaa1f4be4040 (diff) | |
parent | 49fef147845655e44f91cd4fdf4be92162e65710 (diff) | |
download | otp-67bb449ebc3e51a39c73b04eefb25feba6e1aa1e.tar.gz otp-67bb449ebc3e51a39c73b04eefb25feba6e1aa1e.tar.bz2 otp-67bb449ebc3e51a39c73b04eefb25feba6e1aa1e.zip |
Merge branch 'fredrik/ssh/timer-on-connect/OTP-10514'
* fredrik/ssh/timer-on-connect/OTP-10514:
New setup in testing idle_time
Use same connect as the rest of testcases
Fixed doc
Added testcase for idle timer
Not start the idle timer on connect
Doc about idle_time option to ssh:connect
Check cache on channel exec
handle no idle-timer on check cache
Option idle_time introduced, it will trigger the timer and if it is not given the timer_ref entry is infinity
Timeout after 1h of idle on connection, which exits the connection
Conflicts:
lib/ssh/src/ssh.erl
Diffstat (limited to 'lib/ssh/test/ssh_basic_SUITE.erl')
-rw-r--r-- | lib/ssh/test/ssh_basic_SUITE.erl | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl index 7a641c92c1..5fec7f0cd7 100644 --- a/lib/ssh/test/ssh_basic_SUITE.erl +++ b/lib/ssh/test/ssh_basic_SUITE.erl @@ -42,14 +42,15 @@ all() -> {group, dsa_pass_key}, {group, rsa_pass_key}, {group, internal_error}, + {group, idle_time}, daemon_already_started, server_password_option, server_userpassword_option, close]. groups() -> - [{dsa_key, [], [send, exec, exec_compressed, shell, known_hosts]}, - {rsa_key, [], [send, exec, exec_compressed, shell, known_hosts]}, + [{dsa_key, [], [send, exec, exec_compressed, shell, known_hosts, idle_time]}, + {rsa_key, [], [send, exec, exec_compressed, shell, known_hosts, idle_time]}, {dsa_pass_key, [], [pass_phrase]}, {rsa_pass_key, [], [pass_phrase]}, {internal_error, [], [internal_error]} @@ -234,7 +235,27 @@ 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_test_lib:connect(Host, Port, [{silently_accept_hosts, true}, + {user_dir, UserDir}, + {user_interaction, false}]), + {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) -> |