diff options
author | Siri Hansen <[email protected]> | 2014-04-07 14:09:33 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2014-04-09 16:58:40 +0200 |
commit | dc48952a651aaea4682848e674f7ad30e441146d (patch) | |
tree | 26ea01e15a311ff21e73b323675a4daba250abc3 | |
parent | 14de5f76687ec5b45e53ca1fa22885429ed3b875 (diff) | |
download | otp-dc48952a651aaea4682848e674f7ad30e441146d.tar.gz otp-dc48952a651aaea4682848e674f7ad30e441146d.tar.bz2 otp-dc48952a651aaea4682848e674f7ad30e441146d.zip |
Skip test when needed applications are missing
On some test hosts a lot of applications are skipped from the erlang
installation in order to make test go faster.
systools_SUITE:app_start_type_relup uses a few applications which
therefore might not exist. This commit make sure the test is skipped
(instead of fail) if some of the needed applications are missing.
-rw-r--r-- | lib/sasl/test/systools_SUITE.erl | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/lib/sasl/test/systools_SUITE.erl b/lib/sasl/test/systools_SUITE.erl index 1d3a71e94e..49a4303e0b 100644 --- a/lib/sasl/test/systools_SUITE.erl +++ b/lib/sasl/test/systools_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2012-2013. All Rights Reserved. +%% Copyright Ericsson AB 2012-2014. 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 @@ -1615,9 +1615,19 @@ no_sasl_relup(Config) when is_list(Config) -> %% make_relup: Check that application start type is used in relup app_start_type_relup(Config) when is_list(Config) -> + %% This might fail if some applications are not available, if so + %% skip the test case. + try create_script(latest_app_start_type2,Config) of + {Dir2,Name2} -> + app_start_type_relup(Dir2,Name2,Config) + catch throw:{error,Reason} -> + {skip,Reason} + end. + +app_start_type_relup(Dir2,Name2,Config) -> PrivDir = ?config(priv_dir, Config), {Dir1,Name1} = create_script(latest_app_start_type1,Config), - {Dir2,Name2} = create_script(latest_app_start_type2,Config), + Release1 = filename:join(Dir1,Name1), Release2 = filename:join(Dir2,Name2), @@ -2242,9 +2252,13 @@ app_vsns(AppVsns) -> [{App,app_vsn(App,Vsn)} || {App,Vsn} <- AppVsns] ++ [{App,app_vsn(App,Vsn),Type} || {App,Vsn,Type} <- AppVsns]. app_vsn(App,current) -> - application:load(App), - {ok,Vsn} = application:get_key(App,vsn), - Vsn; + case application:load(App) of + Ok when Ok==ok; Ok=={error,{already_loaded,App}} -> + {ok,Vsn} = application:get_key(App,vsn), + Vsn; + Error -> + throw(Error) + end; app_vsn(_App,Vsn) -> Vsn. |