diff options
author | Hans Nilsson <[email protected]> | 2016-10-31 10:21:56 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2016-10-31 10:24:50 +0100 |
commit | 1d6d13cc0ab1178d1603af90660963160817a03d (patch) | |
tree | e43ec4854f951d3ad2afef573dcc83be5ca97a96 /lib/ssh/test | |
parent | ba6202d58f56d1a2b71d1108b39d13d83505c085 (diff) | |
download | otp-1d6d13cc0ab1178d1603af90660963160817a03d.tar.gz otp-1d6d13cc0ab1178d1603af90660963160817a03d.tar.bz2 otp-1d6d13cc0ab1178d1603af90660963160817a03d.zip |
ssh: simplify test in ssh_to_openssh_SUITE
Diffstat (limited to 'lib/ssh/test')
-rw-r--r-- | lib/ssh/test/ssh_to_openssh_SUITE.erl | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/lib/ssh/test/ssh_to_openssh_SUITE.erl b/lib/ssh/test/ssh_to_openssh_SUITE.erl index b289327cbd..2fff097753 100644 --- a/lib/ssh/test/ssh_to_openssh_SUITE.erl +++ b/lib/ssh/test/ssh_to_openssh_SUITE.erl @@ -153,7 +153,7 @@ erlang_shell_client_openssh_server(Config) when is_list(Config) -> IO = ssh_test_lib:start_io_server(), Shell = ssh_test_lib:start_shell(?SSH_DEFAULT_PORT, IO), IO ! {input, self(), "echo Hej\n"}, - receive_hej(), + receive_data("Hej"), IO ! {input, self(), "exit\n"}, receive_logout(), receive_normal_exit(Shell). @@ -478,11 +478,11 @@ erlang_client_openssh_server_renegotiate(_Config) -> ct:fail("Error=~p",[Error]); {ok, Ref, ConnectionRef} -> IO ! {input, self(), "echo Hej\n"}, - receive_hej(), + receive_data("Hej"), Kex1 = ssh_test_lib:get_kex_init(ConnectionRef), ssh_connection_handler:renegotiate(ConnectionRef), IO ! {input, self(), "echo Hej\n"}, - receive_hej(), + receive_data("Hej"), Kex2 = ssh_test_lib:get_kex_init(ConnectionRef), IO ! {input, self(), "exit\n"}, receive_logout(), @@ -545,28 +545,6 @@ erlang_client_openssh_server_nonexistent_subsystem(Config) when is_list(Config) %%-------------------------------------------------------------------- %%% Internal functions ----------------------------------------------- %%-------------------------------------------------------------------- -receive_hej() -> - receive - <<"Hej", _binary>> = Hej -> - ct:log("Expected result: ~p~n", [Hej]); - <<"Hej\n", _binary>> = Hej -> - ct:log("Expected result: ~p~n", [Hej]); - <<"Hej\r\n", _/binary>> = Hej -> - ct:log("Expected result: ~p~n", [Hej]); - Info -> - Lines = binary:split(Info, [<<"\r\n">>], [global]), - case lists:member(<<"Hej">>, Lines) of - true -> - ct:log("Expected result found in lines: ~p~n", [Lines]), - ok; - false -> - ct:log("Extra info: ~p~n", [Info]), - receive_hej() - end - after - 30000 -> ct:fail("timeout ~p:~p",[?MODULE,?LINE]) - end. - receive_data(Data) -> receive Info when is_binary(Info) -> |