aboutsummaryrefslogtreecommitdiffstats
path: root/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cosFileTransfer/test/fileTransfer_SUITE.erl')
-rw-r--r--lib/cosFileTransfer/test/fileTransfer_SUITE.erl112
1 files changed, 65 insertions, 47 deletions
diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
index f877e3ceda..e94c307ef8 100644
--- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
+++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2011. 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
@@ -25,12 +25,10 @@
-module(fileTransfer_SUITE).
-
-
%%--------------- INCLUDES -----------------------------------
-include_lib("cosFileTransfer/src/cosFileTransferApp.hrl").
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
%%--------------- DEFINES ------------------------------------
-define(default_timeout, ?t:minutes(20)).
@@ -70,10 +68,11 @@
%%-----------------------------------------------------------------
%% External exports
%%-----------------------------------------------------------------
--export([all/1,
+-export([all/0,suite/0,groups/0,
+ init_per_group/2,end_per_group/2,
cases/0,
- init_all/1,
- finish_all/1,
+ init_per_suite/1,
+ end_per_suite/1,
fileIterator_api/1,
fts_ftp_file_api/1,
fts_ftp_file_ssl_api/1,
@@ -82,7 +81,7 @@
fts_native_file_ssl_api/1,
fts_native_dir_api/1,
init_per_testcase/2,
- fin_per_testcase/2,
+ end_per_testcase/2,
install_data/2,
uninstall_data/1,
slave_sup/0,
@@ -93,16 +92,30 @@
%% Args:
%% Returns:
%%-----------------------------------------------------------------
-all(doc) -> ["API tests for the cosFileTransfer interfaces", ""];
-all(suite) -> {req,
- [mnesia, orber],
- {conf, init_all, cases(), finish_all}}.
-
-cases() ->
- [fts_ftp_dir_api, fts_ftp_file_api, fts_ftp_file_ssl_api,
- fts_native_dir_api, fts_native_file_api, fts_native_file_ssl_api,
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ cases().
+
+groups() ->
+ [].
+
+
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+
+cases() ->
+ [fts_ftp_dir_api, fts_ftp_file_api,
+ fts_ftp_file_ssl_api, fts_native_dir_api,
+ fts_native_file_api, fts_native_file_ssl_api,
fileIterator_api, app_test].
-
+
%%-----------------------------------------------------------------
%% Init and cleanup functions.
%%-----------------------------------------------------------------
@@ -112,42 +125,47 @@ init_per_testcase(_Case, Config) ->
[{watchdog, Dog}|Config].
-fin_per_testcase(_Case, Config) ->
+end_per_testcase(_Case, Config) ->
Dog = ?config(watchdog, Config),
test_server:timetrap_cancel(Dog),
ok.
-init_all(Config) ->
- orber:jump_start(),
- cosProperty:install(),
- cosProperty:start(),
- Dir = filename:join([code:lib_dir(ssl), "examples", "certs", "etc"]),
- %% Client
- cosFileTransferApp:configure(ssl_client_certfile,
- filename:join([Dir, "client", "cert.pem"])),
- cosFileTransferApp:configure(ssl_client_cacertfile,
- filename:join([Dir, "client", "cacerts.pem"])),
- cosFileTransferApp:configure(ssl_client_verify, 1),
- cosFileTransferApp:configure(ssl_client_depth, 0),
- %% Server
- cosFileTransferApp:configure(ssl_server_certfile,
- filename:join([Dir, "server", "cert.pem"])),
- cosFileTransferApp:configure(ssl_server_cacertfile,
- filename:join([Dir, "server", "cacerts.pem"])),
- cosFileTransferApp:configure(ssl_server_verify, 1),
- cosFileTransferApp:configure(ssl_server_depth, 0),
- crypto:start(),
- ssl:start(),
- cosFileTransferApp:install(),
- cosFileTransferApp:start(),
- if
- is_list(Config) ->
- Config;
- true ->
- exit("Config not a list")
+init_per_suite(Config) ->
+ case code:which(crypto) of
+ Res when is_atom(Res) ->
+ {skip,"Could not start crypto!"};
+ _Else ->
+ orber:jump_start(),
+ cosProperty:install(),
+ cosProperty:start(),
+ Dir = filename:join([code:lib_dir(ssl), "examples", "certs", "etc"]),
+ %% Client
+ cosFileTransferApp:configure(ssl_client_certfile,
+ filename:join([Dir, "client", "cert.pem"])),
+ cosFileTransferApp:configure(ssl_client_cacertfile,
+ filename:join([Dir, "client", "cacerts.pem"])),
+ cosFileTransferApp:configure(ssl_client_verify, 1),
+ cosFileTransferApp:configure(ssl_client_depth, 0),
+ %% Server
+ cosFileTransferApp:configure(ssl_server_certfile,
+ filename:join([Dir, "server", "cert.pem"])),
+ cosFileTransferApp:configure(ssl_server_cacertfile,
+ filename:join([Dir, "server", "cacerts.pem"])),
+ cosFileTransferApp:configure(ssl_server_verify, 1),
+ cosFileTransferApp:configure(ssl_server_depth, 0),
+ crypto:start(),
+ ssl:start(),
+ cosFileTransferApp:install(),
+ cosFileTransferApp:start(),
+ if
+ is_list(Config) ->
+ Config;
+ true ->
+ exit("Config not a list")
+ end
end.
-finish_all(Config) ->
+end_per_suite(Config) ->
ssl:stop(),
crypto:stop(),
cosFileTransferApp:stop(),