diff options
author | Hans Nilsson <[email protected]> | 2016-03-29 14:43:13 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2016-03-29 14:43:13 +0200 |
commit | 9be7db7401d3e107f6f63cb02117d1ffa1db1311 (patch) | |
tree | 0ddaf235a0f59e19bc17e3d68946c1207b93ef30 /lib/ssh/test/ssh_algorithms_SUITE.erl | |
parent | 430e7a61fde2c19bc1e5258e943de3db42123942 (diff) | |
parent | bedbc46b08fc58c1c907e58c3443a4b0831f7aba (diff) | |
download | otp-9be7db7401d3e107f6f63cb02117d1ffa1db1311.tar.gz otp-9be7db7401d3e107f6f63cb02117d1ffa1db1311.tar.bz2 otp-9be7db7401d3e107f6f63cb02117d1ffa1db1311.zip |
Merge branch 'hans/ssh/cuddle_tests'
Diffstat (limited to 'lib/ssh/test/ssh_algorithms_SUITE.erl')
-rw-r--r-- | lib/ssh/test/ssh_algorithms_SUITE.erl | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/ssh/test/ssh_algorithms_SUITE.erl b/lib/ssh/test/ssh_algorithms_SUITE.erl index 256c8c8da3..2dc228a3cf 100644 --- a/lib/ssh/test/ssh_algorithms_SUITE.erl +++ b/lib/ssh/test/ssh_algorithms_SUITE.erl @@ -28,7 +28,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --define(TIMEOUT, 50000). +-define(TIMEOUT, 10000). %%-------------------------------------------------------------------- %% Common Test interface functions ----------------------------------- @@ -192,7 +192,7 @@ simple_exec_groups_no_match_too_large(Config) -> %%-------------------------------------------------------------------- %% Testing all default groups -simple_exec_groups() -> [{timetrap,{seconds,90}}]. +simple_exec_groups() -> [{timetrap,{seconds,180}}]. simple_exec_groups(Config) -> Sizes = interpolate( public_key:dh_gex_group_sizes() ), @@ -221,8 +221,6 @@ interpolate(Is) -> %%-------------------------------------------------------------------- %% Use the ssh client of the OS to connect -sshc_simple_exec() -> [{timetrap,{seconds,90}}]. - sshc_simple_exec(Config) -> PrivDir = ?config(priv_dir, Config), KnownHosts = filename:join(PrivDir, "known_hosts"), @@ -233,12 +231,21 @@ 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",[Other]), + rcv_expected(SshPort, Expect) + after ?TIMEOUT -> + catch port_close(SshPort), ct:fail("Did not receive answer") end. |