diff options
author | Hans Nilsson <[email protected]> | 2014-10-09 12:34:24 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2014-10-09 12:34:24 +0200 |
commit | ebf50edd510a5beafa466741e10437f9ebad4408 (patch) | |
tree | 6a6433bbebf99647a8770ea8c9ba69cfde1d752b | |
parent | 1aa1a4f6173e9ef59ac0b6bb054368c141000062 (diff) | |
download | otp-ebf50edd510a5beafa466741e10437f9ebad4408.tar.gz otp-ebf50edd510a5beafa466741e10437f9ebad4408.tar.bz2 otp-ebf50edd510a5beafa466741e10437f9ebad4408.zip |
ssh: testcase
-rw-r--r-- | lib/ssh/test/ssh_connection_SUITE.erl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/ssh/test/ssh_connection_SUITE.erl b/lib/ssh/test/ssh_connection_SUITE.erl index d226e5ba03..3c537d719c 100644 --- a/lib/ssh/test/ssh_connection_SUITE.erl +++ b/lib/ssh/test/ssh_connection_SUITE.erl @@ -37,6 +37,7 @@ all() -> [ {group, openssh_payload}, + start_subsystem_on_closed_channel, interrupted_send, start_shell, start_shell_exec, @@ -241,6 +242,32 @@ send_after_exit(Config) when is_list(Config) -> end. %%-------------------------------------------------------------------- +start_subsystem_on_closed_channel(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), + SysDir = ?config(data_dir, Config), + {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SysDir}, + {user_dir, UserDir}, + {password, "morot"}, + {subsystems, [{"echo_n", {ssh_echo_server, [4000000]}}]}]), + + ConnectionRef = ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true}, + {user, "foo"}, + {password, "morot"}, + {user_interaction, false}, + {user_dir, UserDir}]), + + {ok, ChannelId} = ssh_connection:session_channel(ConnectionRef, infinity), + + ok = ssh_connection:close(ConnectionRef, ChannelId), + + failure = ssh_connection:subsystem(ConnectionRef, ChannelId, "echo_n", infinity), + + ssh:close(ConnectionRef), + ssh:stop_daemon(Pid). + +%%-------------------------------------------------------------------- interrupted_send() -> [{doc, "Use a subsystem that echos n char and then sends eof to cause a channel exit partway through a large send."}]. |