aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/test
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2016-03-21 15:14:15 +0100
committerHans Nilsson <[email protected]>2016-03-21 15:14:15 +0100
commit6032030a1248514d277f15e0c3d4bed3298f9f8a (patch)
tree7ac5c77f1e31bbe1900a5b3ff32ac75556e67223 /lib/ssh/test
parentfb5d35272993e26e64245726d306c833b2d163b8 (diff)
downloadotp-6032030a1248514d277f15e0c3d4bed3298f9f8a.tar.gz
otp-6032030a1248514d277f15e0c3d4bed3298f9f8a.tar.bz2
otp-6032030a1248514d277f15e0c3d4bed3298f9f8a.zip
ssh: Make test case ssh_algorithms_SUITE report unexpected messages
Diffstat (limited to 'lib/ssh/test')
-rw-r--r--lib/ssh/test/ssh_algorithms_SUITE.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/ssh/test/ssh_algorithms_SUITE.erl b/lib/ssh/test/ssh_algorithms_SUITE.erl
index 256c8c8da3..094c9d406d 100644
--- a/lib/ssh/test/ssh_algorithms_SUITE.erl
+++ b/lib/ssh/test/ssh_algorithms_SUITE.erl
@@ -233,11 +233,19 @@ sshc_simple_exec(Config) ->
ct:log("~p",[Cmd]),
SshPort = open_port({spawn, Cmd}, [binary]),
Expect = <<"2\n">>,
+ rcv_expected(SshPort, Expect).
+
+
+rcv_expected(SshPort, Expect) ->
receive
{SshPort, {data,Expect}} ->
ct:log("Got expected ~p from ~p",[Expect,SshPort]),
catch port_close(SshPort),
- ok
+ ok;
+ Other ->
+ ct:log("Got UNEXPECTED ~p",[Expect]),
+ rcv_expected(SshPort, Expect)
+
after ?TIMEOUT ->
ct:fail("Did not receive answer")
end.