From 6032030a1248514d277f15e0c3d4bed3298f9f8a Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Mon, 21 Mar 2016 15:14:15 +0100 Subject: ssh: Make test case ssh_algorithms_SUITE report unexpected messages --- lib/ssh/test/ssh_algorithms_SUITE.erl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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. -- cgit v1.2.3