aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ftp/test/ftp_SUITE.erl
diff options
context:
space:
mode:
authorPéter Dimitrov <[email protected]>2018-03-07 09:19:25 +0100
committerPéter Dimitrov <[email protected]>2018-03-28 10:19:38 +0200
commit118dc092313b7eae9dd4084bb354cec644823ab2 (patch)
tree7ada2ebf5d0c7c0e1ac7151734558d487b600c4d /lib/ftp/test/ftp_SUITE.erl
parent4fc92e109803c69aa0ff0bba11b05ff9ce119f05 (diff)
downloadotp-118dc092313b7eae9dd4084bb354cec644823ab2.tar.gz
otp-118dc092313b7eae9dd4084bb354cec644823ab2.tar.bz2
otp-118dc092313b7eae9dd4084bb354cec644823ab2.zip
ftp: Refactor ftp tests
- Add appup file - Update vsftpd configuration file with stronger cipher suites - Remove unused functions from ftp_test_lib - Improve certificate generation Change-Id: I941e922d7532a3f2a05662aff621a175b630d3b5
Diffstat (limited to 'lib/ftp/test/ftp_SUITE.erl')
-rw-r--r--lib/ftp/test/ftp_SUITE.erl25
1 files changed, 2 insertions, 23 deletions
diff --git a/lib/ftp/test/ftp_SUITE.erl b/lib/ftp/test/ftp_SUITE.erl
index c1cdd13adb..3d4331f866 100644
--- a/lib/ftp/test/ftp_SUITE.erl
+++ b/lib/ftp/test/ftp_SUITE.erl
@@ -18,16 +18,10 @@
%% %CopyrightEnd%
%%
%%
-
-%%
-%% ct:run("../inets_test", ftp_SUITE).
-%%
-
-module(ftp_SUITE).
-include_lib("kernel/include/file.hrl").
-include_lib("common_test/include/ct.hrl").
--include("inets_test_lib.hrl").
%% Note: This directive should only be used in test suites.
-compile(export_all).
@@ -189,7 +183,8 @@ init_per_suite(Config) ->
{ok,Data} ->
TstDir = filename:join(proplists:get_value(priv_dir,Config), "test"),
file:make_dir(TstDir),
- make_cert_files(dsa, rsa, "server-", proplists:get_value(data_dir,Config)),
+ %% make_cert_files(dsa, rsa, "server-", proplists:get_value(data_dir,Config)),
+ ftp_test_lib:make_cert_files(proplists:get_value(data_dir,Config)),
start_ftpd([{test_dir,TstDir},
{ftpd_data,Data}
| Config])
@@ -930,22 +925,6 @@ error_ehost(_Config) ->
%% Internal functions -----------------------------------------------
%%--------------------------------------------------------------------
-make_cert_files(Alg1, Alg2, Prefix, Dir) ->
- CaInfo = {CaCert,_} = erl_make_certs:make_cert([{key,Alg1}]),
- {Cert,CertKey} = erl_make_certs:make_cert([{key,Alg2},{issuer,CaInfo}]),
- CaCertFile = filename:join(Dir, Prefix++"cacerts.pem"),
- CertFile = filename:join(Dir, Prefix++"cert.pem"),
- KeyFile = filename:join(Dir, Prefix++"key.pem"),
- der_to_pem(CaCertFile, [{'Certificate', CaCert, not_encrypted}]),
- der_to_pem(CertFile, [{'Certificate', Cert, not_encrypted}]),
- der_to_pem(KeyFile, [CertKey]),
- ok.
-
-der_to_pem(File, Entries) ->
- PemBin = public_key:pem_encode(Entries),
- file:write_file(File, PemBin).
-
-%%--------------------------------------------------------------------
chk_file(Path=[C|_], ExpectedContents, Config) when 0<C,C=<255 ->
chk_file([Path], ExpectedContents, Config);