aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2016-11-14 10:25:44 +0100
committerHans Nilsson <[email protected]>2016-11-14 13:54:22 +0100
commitcd52f028687974abf62059610bd01fc8f238ec4d (patch)
treea3fe669a7911003f60f0bb71c65b158a568037d0 /lib
parent7acfeb55655ed2a2f1ec2ec1ee4dbfc112fc4c54 (diff)
downloadotp-cd52f028687974abf62059610bd01fc8f238ec4d.tar.gz
otp-cd52f028687974abf62059610bd01fc8f238ec4d.tar.bz2
otp-cd52f028687974abf62059610bd01fc8f238ec4d.zip
ssh: interrupted_send test suite handle 'close CHANID' msg
Diffstat (limited to 'lib')
-rw-r--r--lib/ssh/test/ssh_connection_SUITE.erl35
1 files changed, 21 insertions, 14 deletions
diff --git a/lib/ssh/test/ssh_connection_SUITE.erl b/lib/ssh/test/ssh_connection_SUITE.erl
index fc7ea81caf..2819a4dbd9 100644
--- a/lib/ssh/test/ssh_connection_SUITE.erl
+++ b/lib/ssh/test/ssh_connection_SUITE.erl
@@ -943,20 +943,12 @@ collect_data(ConnectionRef, ChannelId, EchoSize, Acc, Sum) ->
[?MODULE,?LINE,size(Data),Sum+size(Data),EchoSize-Sum]),
ssh_connection:adjust_window(ConnectionRef, ChannelId, size(Data)),
collect_data(ConnectionRef, ChannelId, EchoSize, [Data | Acc], Sum+size(Data));
- {ssh_cm, ConnectionRef, {eof, ChannelId}} ->
- try
- iolist_to_binary(lists:reverse(Acc))
- of
- Bin ->
- ct:log("~p:~p collect_data: received eof.~nGot in total ~p bytes, want ~p more",
- [?MODULE,?LINE,size(Bin),EchoSize,size(Bin)]),
- Bin
- catch
- C:E ->
- ct:log("~p:~p collect_data: received eof.~nAcc is strange...~nException=~p:~p~nAcc=~p",
- [?MODULE,?LINE,C,E,Acc]),
- {error,{C,E}}
- end;
+ {ssh_cm, ConnectionRef, Msg={eof, ChannelId}} ->
+ collect_data_report_end(Acc, Msg, EchoSize);
+
+ {ssh_cm, ConnectionRef, Msg={closed,ChannelId}} ->
+ collect_data_report_end(Acc, Msg, EchoSize);
+
Msg ->
ct:log("~p:~p collect_data: ***** unexpected message *****~n~p",[?MODULE,?LINE,Msg]),
collect_data(ConnectionRef, ChannelId, EchoSize, Acc, Sum)
@@ -966,6 +958,21 @@ collect_data(ConnectionRef, ChannelId, EchoSize, Acc, Sum) ->
collect_data(ConnectionRef, ChannelId, EchoSize, Acc, Sum)
end.
+collect_data_report_end(Acc, Msg, EchoSize) ->
+ try
+ iolist_to_binary(lists:reverse(Acc))
+ of
+ Bin ->
+ ct:log("~p:~p collect_data: received ~p.~nGot in total ~p bytes, want ~p more",
+ [?MODULE,?LINE,Msg,size(Bin),EchoSize,size(Bin)]),
+ Bin
+ catch
+ C:E ->
+ ct:log("~p:~p collect_data: received ~p.~nAcc is strange...~nException=~p:~p~nAcc=~p",
+ [?MODULE,?LINE,Msg,C,E,Acc]),
+ {error,{C,E}}
+ end.
+
%%%-------------------------------------------------------------------
%% This is taken from the ssh example code.
start_our_shell(_User, _Peer) ->