diff options
author | Ingela Anderton Andin <[email protected]> | 2012-09-26 12:18:53 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2012-09-26 12:18:53 +0200 |
commit | f4654ea1d941f0067be6a6b1b18ad365eff91017 (patch) | |
tree | d1c6de57aecc980d25c48d3eb7fb42ac3a21a3e0 /lib/ssh/test/ssh_basic_SUITE.erl | |
parent | 7a594dd7b4616176e774ed7e78267805d237d0a8 (diff) | |
parent | 425d8b7a53362d2c32a753d850bec14ebd57951a (diff) | |
download | otp-f4654ea1d941f0067be6a6b1b18ad365eff91017.tar.gz otp-f4654ea1d941f0067be6a6b1b18ad365eff91017.tar.bz2 otp-f4654ea1d941f0067be6a6b1b18ad365eff91017.zip |
Merge branch 'ia/ssh/empty-binary/OTP-9478'
* ia/ssh/empty-binary/OTP-9478:
ssh: Will not hang if you attempt to send empty binary
Diffstat (limited to 'lib/ssh/test/ssh_basic_SUITE.erl')
-rw-r--r-- | lib/ssh/test/ssh_basic_SUITE.erl | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl index 2ceaa9daa5..c224e5b800 100644 --- a/lib/ssh/test/ssh_basic_SUITE.erl +++ b/lib/ssh/test/ssh_basic_SUITE.erl @@ -110,12 +110,13 @@ 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]}, - {rsa_key, [], [exec, exec_compressed, shell, known_hosts]}, + [{dsa_key, [], [send, exec, exec_compressed, shell, known_hosts]}, + {rsa_key, [], [send, exec, exec_compressed, shell, known_hosts]}, {dsa_pass_key, [], [pass_phrase]}, {rsa_pass_key, [], [pass_phrase]}, {internal_error, [], [internal_error]} @@ -532,6 +533,31 @@ internal_error(Config) when is_list(Config) -> ssh:stop_daemon(Pid). %%-------------------------------------------------------------------- +send(doc) -> + ["Test ssh_connection:send/3"]; + +send(suite) -> + []; + +send(Config) when is_list(Config) -> + process_flag(trap_exit, true), + 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, ChannelId} = ssh_connection:session_channel(ConnectionRef, infinity), + ok = ssh_connection:send(ConnectionRef, ChannelId, <<"Data">>), + ok = ssh_connection:send(ConnectionRef, ChannelId, << >>), + ssh:stop_daemon(Pid). + + +%%-------------------------------------------------------------------- close(doc) -> ["Simulate that we try to close an already closed connection"]; |