From 19d5a0e59f9897361d18b3c8987561620a212f04 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 7 Dec 2010 14:43:25 +0100 Subject: Update cosFileTransfer tests to conform with common_test standard --- lib/cosFileTransfer/test/fileTransfer_SUITE.erl | 45 ++++++++++++++++--------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'lib/cosFileTransfer/test') diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl index f877e3ceda..b45cc65cd0 100644 --- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl +++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl @@ -30,7 +30,7 @@ %%--------------- 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 +70,11 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, +-export([all/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 +83,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 +94,28 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for the cosFileTransfer interfaces", ""]; -all(suite) -> {req, - [mnesia, orber], - {conf, init_all, cases(), finish_all}}. + +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, +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,12 +125,12 @@ 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) -> +init_per_suite(Config) -> orber:jump_start(), cosProperty:install(), cosProperty:start(), @@ -147,7 +160,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> ssl:stop(), crypto:stop(), cosFileTransferApp:stop(), -- cgit v1.2.3 From 83f932257470f5ae01fc61130e997fdea0562653 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 6 Dec 2010 16:48:31 +0100 Subject: Add ts_install_scb to suite/0 --- lib/cosFileTransfer/test/fileTransfer_SUITE.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/cosFileTransfer/test') diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl index b45cc65cd0..eb7a0a6723 100644 --- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl +++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl @@ -70,7 +70,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0, +-export([all/0,suite/0,groups/0, init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, @@ -94,6 +94,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> + [{suite_callbacks,[ts_install_scb]}]. all() -> cases(). -- cgit v1.2.3 From 9943617414fd89162fce181f91545e4f1ca2fc64 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:14:50 +0100 Subject: Fix formatting for cosFileTransfer --- lib/cosFileTransfer/test/fileTransfer_SUITE.erl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/cosFileTransfer/test') diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl index eb7a0a6723..3e27d7b83b 100644 --- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl +++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl @@ -25,8 +25,6 @@ -module(fileTransfer_SUITE). - - %%--------------- INCLUDES ----------------------------------- -include_lib("cosFileTransfer/src/cosFileTransferApp.hrl"). @@ -103,15 +101,15 @@ all() -> groups() -> []. - + init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - cases() -> [fts_ftp_dir_api, fts_ftp_file_api, fts_ftp_file_ssl_api, fts_native_dir_api, -- cgit v1.2.3 From 5fef403779c4894189abf6fd18e6c8e5d54064c5 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 7 Dec 2010 17:52:12 +0100 Subject: Update all test specs --- lib/cosFileTransfer/test/cosFileTransfer.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/cosFileTransfer/test') diff --git a/lib/cosFileTransfer/test/cosFileTransfer.spec b/lib/cosFileTransfer/test/cosFileTransfer.spec index 80fe919f2a..290b27d048 100644 --- a/lib/cosFileTransfer/test/cosFileTransfer.spec +++ b/lib/cosFileTransfer/test/cosFileTransfer.spec @@ -1 +1 @@ -{topcase, {dir, "../cosFileTransfer_test"}}. +{suites,"../cosFileTransfer_test", all}. -- cgit v1.2.3 From cfa01c9bd748df38750dc4841030e6520610538a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 12 Jan 2011 14:56:23 +0100 Subject: Update and add cover spec files to work with common_test --- lib/cosFileTransfer/test/Makefile | 3 ++- lib/cosFileTransfer/test/cosFileTransfer.cover | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 lib/cosFileTransfer/test/cosFileTransfer.cover (limited to 'lib/cosFileTransfer/test') diff --git a/lib/cosFileTransfer/test/Makefile b/lib/cosFileTransfer/test/Makefile index 60f72644bd..cb181bdb66 100644 --- a/lib/cosFileTransfer/test/Makefile +++ b/lib/cosFileTransfer/test/Makefile @@ -34,6 +34,7 @@ RELSYSDIR = $(RELEASE_PATH)/cosFileTransfer_test # Target Specs # ---------------------------------------------------- TEST_SPEC_FILE = cosFileTransfer.spec +COVER_FILE = cosFileTransfer.cover IDL_FILES = @@ -127,6 +128,6 @@ release_docs_spec: release_tests_spec: tests $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \ - $(ERL_FILES) $(RELSYSDIR) + $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR) $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) diff --git a/lib/cosFileTransfer/test/cosFileTransfer.cover b/lib/cosFileTransfer/test/cosFileTransfer.cover new file mode 100644 index 0000000000..063dd66990 --- /dev/null +++ b/lib/cosFileTransfer/test/cosFileTransfer.cover @@ -0,0 +1,2 @@ +{incl_app,cosFileTransfer,details}. + -- cgit v1.2.3 From 3d3251d2f371499e7af7b77335b4392f4ffaa465 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 24 Jan 2011 14:01:06 +0100 Subject: Update init_per_suite to skip all tests if crypto does not exist --- lib/cosFileTransfer/test/fileTransfer_SUITE.erl | 59 ++++++++++++++----------- 1 file changed, 32 insertions(+), 27 deletions(-) (limited to 'lib/cosFileTransfer/test') diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl index 3e27d7b83b..63eeb517bf 100644 --- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl +++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl @@ -131,33 +131,38 @@ end_per_testcase(_Case, Config) -> ok. init_per_suite(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") + 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. end_per_suite(Config) -> -- cgit v1.2.3 From 308d6638450f5ffc7f432302367e84bcd92ea683 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 9 Feb 2011 19:10:44 +0100 Subject: Rename Suite Callback to Common Test Hook --- lib/cosFileTransfer/test/fileTransfer_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/cosFileTransfer/test') diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl index 63eeb517bf..1e27139ed1 100644 --- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl +++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl @@ -93,7 +93,7 @@ %% Returns: %%----------------------------------------------------------------- suite() -> - [{suite_callbacks,[ts_install_scb]}]. + [{ct_hooks,[ts_install_cth]}]. all() -> cases(). -- cgit v1.2.3