diff options
author | Hans Nilsson <hans@erlang.org> | 2019-09-19 12:04:29 +0200 |
---|---|---|
committer | Hans Nilsson <hans@erlang.org> | 2019-09-24 10:18:24 +0200 |
commit | 1e64ab533d0826410b832b37d9cd9d2542946cd8 (patch) | |
tree | 53c93acd9040c32e3b17d46a7d99f3e689c14082 /lib/ssh/test/ssh_test_lib.erl | |
parent | 2af1a1bfde5fac8ff38e0a86d7c516e0b6aa608f (diff) | |
download | erlang-1e64ab533d0826410b832b37d9cd9d2542946cd8.tar.gz |
ssh: Testcases for erlang ssh server for IO in exec (both stdin and stdout)
This is to test the fix of a bug
Diffstat (limited to 'lib/ssh/test/ssh_test_lib.erl')
-rw-r--r-- | lib/ssh/test/ssh_test_lib.erl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/ssh/test/ssh_test_lib.erl b/lib/ssh/test/ssh_test_lib.erl index 1129303414..9340aba473 100644 --- a/lib/ssh/test/ssh_test_lib.erl +++ b/lib/ssh/test/ssh_test_lib.erl @@ -293,12 +293,12 @@ rcv_lingering(Timeout) -> receive_exec_result(Msg) -> ct:log("Expect data! ~p", [Msg]), receive - {ssh_cm,_,{data,_,1, Data}} -> - ct:log("StdErr: ~p~n", [Data]), - receive_exec_result(Msg); Msg -> ct:log("1: Collected data ~p", [Msg]), expected; + {ssh_cm,_,{data,_,1, Data}} -> + ct:log("StdErr: ~p~n", [Data]), + receive_exec_result(Msg); Other -> ct:log("Other ~p", [Other]), {unexpected_msg, Other} @@ -306,6 +306,11 @@ receive_exec_result(Msg) -> 30000 -> ct:fail("timeout ~p:~p",[?MODULE,?LINE]) end. +receive_exec_result_or_fail(Msg) -> + case receive_exec_result(Msg) of + expected -> expected; + Other -> ct:fail(Other) + end. receive_exec_end(ConnectionRef, ChannelId) -> Eof = {ssh_cm, ConnectionRef, {eof, ChannelId}}, |