diff options
author | Hans Nilsson <[email protected]> | 2016-10-14 10:14:08 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2016-10-14 10:14:08 +0200 |
commit | df8c6690a86d087d8de324276b2266bc5918c779 (patch) | |
tree | 9f4212bfb907d69ad0aae9969ee02d12562ea4fb /lib/ssh/test/ssh_protocol_SUITE.erl | |
parent | 28d84f10b99906d44d4bb842f17ecc4472cb3d92 (diff) | |
parent | c1c2149818396bdefe9eff995184f8864f18fca3 (diff) | |
download | otp-df8c6690a86d087d8de324276b2266bc5918c779.tar.gz otp-df8c6690a86d087d8de324276b2266bc5918c779.tar.bz2 otp-df8c6690a86d087d8de324276b2266bc5918c779.zip |
Merge branch 'maint-19' into maint
Diffstat (limited to 'lib/ssh/test/ssh_protocol_SUITE.erl')
-rw-r--r-- | lib/ssh/test/ssh_protocol_SUITE.erl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/ssh/test/ssh_protocol_SUITE.erl b/lib/ssh/test/ssh_protocol_SUITE.erl index 4fac1f718a..93d0bc2eb0 100644 --- a/lib/ssh/test/ssh_protocol_SUITE.erl +++ b/lib/ssh/test/ssh_protocol_SUITE.erl @@ -48,6 +48,7 @@ suite() -> all() -> [{group,tool_tests}, + client_info_line, {group,kex}, {group,service_requests}, {group,authentication}, @@ -575,6 +576,36 @@ client_handles_keyboard_interactive_0_pwds(Config) -> ). + +%%%-------------------------------------------------------------------- +client_info_line(_Config) -> + %% A client must not send an info-line. If it does, the server should handle + %% handle this gracefully + {ok,Pid} = ssh_eqc_event_handler:add_report_handler(), + {_, _, Port} = ssh_test_lib:daemon([]), + + %% Fake client: + {ok,S} = gen_tcp:connect("localhost",Port,[]), + gen_tcp:send(S,"An illegal info-string\r\n"), + gen_tcp:close(S), + + %% wait for server to react: + timer:sleep(1000), + + %% check if a badmatch was received: + {ok, Reports} = ssh_eqc_event_handler:get_reports(Pid), + case lists:any(fun({error_report,_,{_,supervisor_report,L}}) when is_list(L) -> + lists:member({reason,{badmatch,{error,closed}}}, L); + (_) -> + false + end, Reports) of + true -> + ct:fail("Bad error report on info_line from client"); + false -> + ok + end. + + %%%================================================================ %%%==== Internal functions ======================================== %%%================================================================ |