diff options
author | Hans Nilsson <[email protected]> | 2016-03-21 15:14:15 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2016-03-21 15:14:15 +0100 |
commit | 6032030a1248514d277f15e0c3d4bed3298f9f8a (patch) | |
tree | 7ac5c77f1e31bbe1900a5b3ff32ac75556e67223 | |
parent | fb5d35272993e26e64245726d306c833b2d163b8 (diff) | |
download | otp-6032030a1248514d277f15e0c3d4bed3298f9f8a.tar.gz otp-6032030a1248514d277f15e0c3d4bed3298f9f8a.tar.bz2 otp-6032030a1248514d277f15e0c3d4bed3298f9f8a.zip |
ssh: Make test case ssh_algorithms_SUITE report unexpected messages
-rw-r--r-- | lib/ssh/test/ssh_algorithms_SUITE.erl | 10 |
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. |