aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/test
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2016-10-24 15:34:33 +0200
committerHans Nilsson <[email protected]>2016-10-27 15:23:59 +0200
commit1e9134eaac9df9743e28e5eb5913d76fa556a52b (patch)
tree9920d0b2ac636ab94cb01b87aca7cd287a6052fa /lib/ssh/test
parent95dd51d198c05ee8e93afd4984a0b306bc1fcdc3 (diff)
downloadotp-1e9134eaac9df9743e28e5eb5913d76fa556a52b.tar.gz
otp-1e9134eaac9df9743e28e5eb5913d76fa556a52b.tar.bz2
otp-1e9134eaac9df9743e28e5eb5913d76fa556a52b.zip
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.
Diffstat (limited to 'lib/ssh/test')
-rw-r--r--lib/ssh/test/ssh_to_openssh_SUITE.erl14
1 files changed, 11 insertions, 3 deletions
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;