aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-01-16 11:43:15 +0100
committerIngela Anderton Andin <[email protected]>2012-01-16 11:43:15 +0100
commitf8815dc88bd86d6508d2a3dad031ea939fb2b443 (patch)
tree6db7476dddc9a21566d144ee722b676d938646ff /lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
parent27d478f37930d147aaac62a1353e071ca17fbbcc (diff)
parentb89c0042c4839ae8ebb231640f3e66ee52de3aa7 (diff)
downloadotp-f8815dc88bd86d6508d2a3dad031ea939fb2b443.tar.gz
otp-f8815dc88bd86d6508d2a3dad031ea939fb2b443.tar.bz2
otp-f8815dc88bd86d6508d2a3dad031ea939fb2b443.zip
Merge branch 'ia/ssh/test-maint' into maint
* ia/ssh/test-maint: Remove generation of new test keys, use checked in test keys Improve test case structure so that test should pass on all platforms Exec test case should ignore stderr messages Do not run ssh_to_openssh_SUITE if there is no oppenssh server running
Diffstat (limited to 'lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl')
-rw-r--r--lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl26
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl b/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
index 2209af05d5..c63ad7de73 100644
--- a/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
+++ b/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -48,13 +48,14 @@ init_per_suite(Config) ->
case catch crypto:start() of
ok ->
DataDir = ?config(data_dir, Config),
+ UserDir = ?config(priv_dir, Config),
FileAlt = filename:join(DataDir, "ssh_sftpd_file_alt.erl"),
c:c(FileAlt),
FileName = filename:join(DataDir, "test.txt"),
{ok, FileInfo} = file:read_file_info(FileName),
ok = file:write_file_info(FileName,
FileInfo#file_info{mode = 8#400}),
- ssh_test_lib:make_dsa_files(Config),
+ ssh_test_lib:setup_dsa(DataDir, UserDir),
Config;
_Else ->
{skip,"Could not start ssh!"}
@@ -66,7 +67,9 @@ init_per_suite(Config) ->
%% A list of key/value pairs, holding the test case configuration.
%% Description: Cleanup after the whole suite
%%--------------------------------------------------------------------
-end_per_suite(_Config) ->
+end_per_suite(Config) ->
+ UserDir = ?config(priv_dir, Config),
+ ssh_test_lib:clean_dsa(UserDir),
crypto:stop(),
ok.
@@ -85,7 +88,7 @@ end_per_suite(_Config) ->
%%--------------------------------------------------------------------
init_per_testcase(TestCase, Config) ->
ssh:start(),
- DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
Options =
case atom_to_list(TestCase) of
@@ -95,8 +98,7 @@ init_per_testcase(TestCase, Config) ->
ssh_sftpd_file_alt}]),
[{user_passwords,[{?USER, ?PASSWD}]},
{pwdfun, fun(_,_) -> true end},
- {system_dir, DataDir},
- {user_dir, DataDir},
+ {system_dir, PrivDir},
{subsystems, [Spec]}];
"root_dir" ->
Privdir = ?config(priv_dir, Config),
@@ -105,23 +107,20 @@ init_per_testcase(TestCase, Config) ->
Spec = ssh_sftpd:subsystem_spec([{root,Root}]),
[{user_passwords,[{?USER, ?PASSWD}]},
{pwdfun, fun(_,_) -> true end},
- {system_dir, DataDir},
- {user_dir, DataDir},
+ {system_dir, PrivDir},
{subsystems, [Spec]}];
"list_dir_limited" ->
Spec =
ssh_sftpd:subsystem_spec([{max_files,1}]),
[{user_passwords,[{?USER, ?PASSWD}]},
{pwdfun, fun(_,_) -> true end},
- {system_dir, DataDir},
- {user_dir, DataDir},
+ {system_dir, PrivDir},
{subsystems, [Spec]}];
_ ->
[{user_passwords,[{?USER, ?PASSWD}]},
{pwdfun, fun(_,_) -> true end},
- {user_dir, DataDir},
- {system_dir, DataDir}]
+ {system_dir, PrivDir}]
end,
{Sftpd, Host, _Port} = ssh_test_lib:daemon(any, ?SSHD_PORT, Options),
@@ -131,8 +130,7 @@ init_per_testcase(TestCase, Config) ->
[{silently_accept_hosts, true},
{user, ?USER}, {password, ?PASSWD},
{pwdfun, fun(_,_) -> true end},
- {system_dir, DataDir},
- {user_dir, DataDir},
+ {user_dir, PrivDir},
{timeout, 30000}]),
TmpConfig = lists:keydelete(sftp, 1, Config),
NewConfig = lists:keydelete(sftpd, 1, TmpConfig),