aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/test/httpc_SUITE.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-11-28 19:45:26 +0100
committerMicael Karlberg <[email protected]>2011-11-28 19:45:26 +0100
commitef692b0461b263a2025d289c31d8f491b53311e5 (patch)
treeeac37df59766a5810027999532c443b21ccb032c /lib/inets/test/httpc_SUITE.erl
parentb1b51d10ab3fe405f773d597c29a42040d53bb17 (diff)
downloadotp-ef692b0461b263a2025d289c31d8f491b53311e5.tar.gz
otp-ef692b0461b263a2025d289c31d8f491b53311e5.tar.bz2
otp-ef692b0461b263a2025d289c31d8f491b53311e5.zip
Add ssl (and crypto and public_key) ensure tests.
That is, for test cases that depend of a running ssl app, added tests that ssl is actually running (actually the key app here is crypto, since the simplest way to test if ssl works is by testing if crypto does...).
Diffstat (limited to 'lib/inets/test/httpc_SUITE.erl')
-rw-r--r--lib/inets/test/httpc_SUITE.erl36
1 files changed, 6 insertions, 30 deletions
diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl
index 2b580cd95d..6e69c9a469 100644
--- a/lib/inets/test/httpc_SUITE.erl
+++ b/lib/inets/test/httpc_SUITE.erl
@@ -145,14 +145,6 @@ groups() ->
].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
%%--------------------------------------------------------------------
%% Function: init_per_suite(Config) -> Config
%% Config - [tuple()]
@@ -226,9 +218,7 @@ init_per_testcase(initial_server_connect = Case, Config) ->
%% this test case does not work unless it does
try
begin
- ensure_started(crypto),
- ensure_started(public_key),
- ensure_started(ssl),
+ ?ENSURE_STARTED([crypto, public_key, ssl]),
inets:start(),
Config
end
@@ -267,10 +257,12 @@ init_per_testcase(Case, Timeout, Config) ->
NewConfig =
case atom_to_list(Case) of
[$s, $s, $l | _] ->
+ ?ENSURE_STARTED([crypto, public_key, ssl]),
init_per_testcase_ssl(ssl, PrivDir, SslConfFile,
[{watchdog, Dog} | TmpConfig]);
[$e, $s, $s, $l | _] ->
+ ?ENSURE_STARTED([crypto, public_key, ssl]),
init_per_testcase_ssl(essl, PrivDir, SslConfFile,
[{watchdog, Dog} | TmpConfig]);
@@ -282,7 +274,7 @@ init_per_testcase(Case, Timeout, Config) ->
inets:start(),
tsp("init_per_testcase -> "
"[proxy case] start crypto, public_key and ssl"),
- try ensure_started([crypto, public_key, ssl]) of
+ try ?ENSURE_STARTED([crypto, public_key, ssl]) of
ok ->
[{watchdog, Dog} | TmpConfig]
catch
@@ -335,8 +327,8 @@ init_per_testcase(Case, Timeout, Config) ->
end;
"ipv6_" ++ _Rest ->
- %% Ensure needed apps (crypto, public_key and ssl) started
- try ensure_started([crypto, public_key, ssl]) of
+ %% Ensure needed apps (crypto, public_key and ssl) are started
+ try ?ENSURE_STARTED([crypto, public_key, ssl]) of
ok ->
Profile = ipv6,
%% A stand-alone profile is represented by a pid()
@@ -3553,21 +3545,5 @@ dummy_ssl_server_hang_loop(_) ->
end.
-ensure_started([]) ->
- ok;
-ensure_started([App|Apps]) ->
- ensure_started(App),
- ensure_started(Apps);
-ensure_started(App) when is_atom(App) ->
- case (catch application:start(App)) of
- ok ->
- ok;
- {error, {already_started, _}} ->
- ok;
- Error ->
- throw({error, {failed_starting, App, Error}})
- end.
-
-
skip(Reason) ->
{skip, Reason}.