aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/test/ssh_to_openssh_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ssh/test/ssh_to_openssh_SUITE.erl')
-rw-r--r--lib/ssh/test/ssh_to_openssh_SUITE.erl60
1 files changed, 38 insertions, 22 deletions
diff --git a/lib/ssh/test/ssh_to_openssh_SUITE.erl b/lib/ssh/test/ssh_to_openssh_SUITE.erl
index 99dc76e12d..8b5343cecc 100644
--- a/lib/ssh/test/ssh_to_openssh_SUITE.erl
+++ b/lib/ssh/test/ssh_to_openssh_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -49,7 +49,9 @@ groups() ->
erlang_client_openssh_server_setenv,
erlang_client_openssh_server_publickey_rsa,
erlang_client_openssh_server_publickey_dsa,
- erlang_client_openssh_server_password]},
+ erlang_client_openssh_server_password,
+ erlang_client_openssh_server_nonexistent_subsystem
+ ]},
{erlang_server, [], [erlang_server_openssh_client_exec,
erlang_server_openssh_client_exec_compressed,
erlang_server_openssh_client_pulic_key_dsa]}
@@ -99,8 +101,8 @@ end_per_testcase(_TestCase, _Config) ->
%% Test Cases --------------------------------------------------------
%%--------------------------------------------------------------------
-erlang_shell_client_openssh_server(doc) ->
- ["Test that ssh:shell/2 works"];
+erlang_shell_client_openssh_server() ->
+ [{doc, "Test that ssh:shell/2 works"}].
erlang_shell_client_openssh_server(Config) when is_list(Config) ->
process_flag(trap_exit, true),
@@ -126,8 +128,8 @@ erlang_shell_client_openssh_server(Config) when is_list(Config) ->
end.
%--------------------------------------------------------------------
-erlang_client_openssh_server_exec(doc) ->
- ["Test api function ssh_connection:exec"];
+erlang_client_openssh_server_exec() ->
+ [{doc, "Test api function ssh_connection:exec"}].
erlang_client_openssh_server_exec(Config) when is_list(Config) ->
ConnectionRef = ssh_test_lib:connect(?SSH_DEFAULT_PORT, [{silently_accept_hosts, true},
@@ -165,8 +167,8 @@ erlang_client_openssh_server_exec(Config) when is_list(Config) ->
end.
%%--------------------------------------------------------------------
-erlang_client_openssh_server_exec_compressed(doc) ->
- ["Test that compression option works"];
+erlang_client_openssh_server_exec_compressed() ->
+ [{doc, "Test that compression option works"}].
erlang_client_openssh_server_exec_compressed(Config) when is_list(Config) ->
ConnectionRef = ssh_test_lib:connect(?SSH_DEFAULT_PORT, [{silently_accept_hosts, true},
@@ -188,8 +190,8 @@ erlang_client_openssh_server_exec_compressed(Config) when is_list(Config) ->
end.
%%--------------------------------------------------------------------
-erlang_server_openssh_client_exec(doc) ->
- ["Test that exec command works."];
+erlang_server_openssh_client_exec() ->
+ [{doc, "Test that exec command works."}].
erlang_server_openssh_client_exec(Config) when is_list(Config) ->
SystemDir = ?config(data_dir, Config),
@@ -219,8 +221,8 @@ erlang_server_openssh_client_exec(Config) when is_list(Config) ->
ssh:stop_daemon(Pid).
%%--------------------------------------------------------------------
-erlang_server_openssh_client_exec_compressed(doc) ->
- ["Test that exec command works."];
+erlang_server_openssh_client_exec_compressed() ->
+ [{doc, "Test that exec command works."}].
erlang_server_openssh_client_exec_compressed(Config) when is_list(Config) ->
SystemDir = ?config(data_dir, Config),
@@ -247,8 +249,8 @@ erlang_server_openssh_client_exec_compressed(Config) when is_list(Config) ->
ssh:stop_daemon(Pid).
%%--------------------------------------------------------------------
-erlang_client_openssh_server_setenv(doc) ->
- ["Test api function ssh_connection:setenv"];
+erlang_client_openssh_server_setenv() ->
+ [{doc, "Test api function ssh_connection:setenv"}].
erlang_client_openssh_server_setenv(Config) when is_list(Config) ->
ConnectionRef =
@@ -290,8 +292,8 @@ erlang_client_openssh_server_setenv(Config) when is_list(Config) ->
%% setenv not meaningfull on erlang ssh daemon!
%%--------------------------------------------------------------------
-erlang_client_openssh_server_publickey_rsa(doc) ->
- ["Validate using rsa publickey."];
+erlang_client_openssh_server_publickey_rsa() ->
+ [{doc, "Validate using rsa publickey."}].
erlang_client_openssh_server_publickey_rsa(Config) when is_list(Config) ->
{ok,[[Home]]} = init:get_argument(home),
KeyFile = filename:join(Home, ".ssh/id_rsa"),
@@ -317,8 +319,8 @@ erlang_client_openssh_server_publickey_rsa(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
-erlang_client_openssh_server_publickey_dsa(doc) ->
- ["Validate using dsa publickey."];
+erlang_client_openssh_server_publickey_dsa() ->
+ [{doc, "Validate using dsa publickey."}].
erlang_client_openssh_server_publickey_dsa(Config) when is_list(Config) ->
{ok,[[Home]]} = init:get_argument(home),
KeyFile = filename:join(Home, ".ssh/id_dsa"),
@@ -342,8 +344,8 @@ erlang_client_openssh_server_publickey_dsa(Config) when is_list(Config) ->
{skip, "no ~/.ssh/id_dsa"}
end.
%%--------------------------------------------------------------------
-erlang_server_openssh_client_pulic_key_dsa(doc) ->
- ["Validate using dsa publickey."];
+erlang_server_openssh_client_pulic_key_dsa() ->
+ [{doc, "Validate using dsa publickey."}].
erlang_server_openssh_client_pulic_key_dsa(Config) when is_list(Config) ->
SystemDir = ?config(data_dir, Config),
PrivDir = ?config(priv_dir, Config),
@@ -369,8 +371,8 @@ erlang_server_openssh_client_pulic_key_dsa(Config) when is_list(Config) ->
ssh:stop_daemon(Pid).
%%--------------------------------------------------------------------
-erlang_client_openssh_server_password(doc) ->
- ["Test client password option"];
+erlang_client_openssh_server_password() ->
+ [{doc, "Test client password option"}].
erlang_client_openssh_server_password(Config) when is_list(Config) ->
%% to make sure we don't public-key-auth
UserDir = ?config(data_dir, Config),
@@ -402,6 +404,20 @@ erlang_client_openssh_server_password(Config) when is_list(Config) ->
end.
%%--------------------------------------------------------------------
+
+erlang_client_openssh_server_nonexistent_subsystem() ->
+ [{doc, "Test client password option"}].
+erlang_client_openssh_server_nonexistent_subsystem(Config) when is_list(Config) ->
+
+ ConnectionRef = ssh_test_lib:connect(?SSH_DEFAULT_PORT,
+ [{user_interaction, false},
+ silently_accept_hosts]),
+
+ {ok, ChannelId} = ssh_connection:session_channel(ConnectionRef, infinity),
+
+ failure = ssh_connection:subsystem(ConnectionRef, ChannelId, "foo", infinity).
+
+%%--------------------------------------------------------------------
%
%% Not possible to send password with openssh without user interaction
%%