From 1e9134eaac9df9743e28e5eb5913d76fa556a52b Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Mon, 24 Oct 2016 15:34:33 +0200 Subject: ssh: Reduce the renegotiation limit in test with OpenSSH client in ssh_to_openssh_SUITE:erlang_server_openssh_client_renegotiate/1 The reason is that it seems that on some small machines we get an out-of-memory exception if the limit is to high. This is probably because a chunk of data larger than the limit is piped from a file into the OpenSSH runing in a shell in a port. --- lib/ssh/test/ssh_to_openssh_SUITE.erl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/ssh/test/ssh_to_openssh_SUITE.erl b/lib/ssh/test/ssh_to_openssh_SUITE.erl index f481e9c1ce..34d65ddbfd 100644 --- a/lib/ssh/test/ssh_to_openssh_SUITE.erl +++ b/lib/ssh/test/ssh_to_openssh_SUITE.erl @@ -399,18 +399,26 @@ erlang_server_openssh_client_renegotiate(Config) -> ct:sleep(500), + RenegLimitK = 3, DataFile = filename:join(PrivDir, "renegotiate_openssh_client.data"), - Data = lists:duplicate(32000, $a), + Data = lists:duplicate(trunc(1.1*RenegLimitK*1024), $a), ok = file:write_file(DataFile, Data), Cmd = "ssh -p " ++ integer_to_list(Port) ++ " -o UserKnownHostsFile=" ++ KnownHosts ++ - " -o RekeyLimit=20K" ++ + " -o RekeyLimit=" ++ integer_to_list(RenegLimitK) ++"K" ++ " " ++ Host ++ " < " ++ DataFile, OpenSsh = ssh_test_lib:open_port({spawn, Cmd}), Expect = fun({data,R}) -> - try lists:prefix(binary_to_list(R), Data) + try + NonAlphaChars = [C || C<-lists:seq(1,255), + not lists:member(C,lists:seq($a,$z)), + not lists:member(C,lists:seq($A,$Z)) + ], + Lines = string:tokens(binary_to_list(R), NonAlphaChars), + lists:any(fun(L) -> lists:prefix(L, Data) end, + Lines) catch _:_ -> false end; -- cgit v1.2.3