aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/application_SUITE.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2014-04-11 17:24:24 +0200
committerSiri Hansen <[email protected]>2014-04-11 17:29:33 +0200
commitef6a9b9b7f7a7c829f524d3f51448d3501c36652 (patch)
tree1d0d478f28f2684a057dc3f02167aac9ea4d0227 /lib/kernel/test/application_SUITE.erl
parentbee0ea4125e8b47478b77904bee06f8f38bbab42 (diff)
downloadotp-ef6a9b9b7f7a7c829f524d3f51448d3501c36652.tar.gz
otp-ef6a9b9b7f7a7c829f524d3f51448d3501c36652.tar.bz2
otp-ef6a9b9b7f7a7c829f524d3f51448d3501c36652.zip
Store expanded config in application_controller:change_application_data
If the Config given to application_controller:change_application_data included other config files, it was only expanded for already existing (loaded) applications. If an upgrade added a new application which had config data in an included config file, the new application did not get correct config data. This is now changed so config data will be expanded for all applications.
Diffstat (limited to 'lib/kernel/test/application_SUITE.erl')
-rw-r--r--lib/kernel/test/application_SUITE.erl20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl
index c6cbd1a0ef..036e238c85 100644
--- a/lib/kernel/test/application_SUITE.erl
+++ b/lib/kernel/test/application_SUITE.erl
@@ -1949,14 +1949,22 @@ config_change(Conf) when is_list(Conf) ->
%% Find out application data from boot script
Boot = filename:join([code:root_dir(), "bin", "start.boot"]),
{ok, Bin} = file:read_file(Boot),
- Appls = get_appls(binary_to_term(Bin)),
+ Appls0 = get_appls(binary_to_term(Bin)),
+
+ %% And add app1 in order to test OTP-11864 - included config files
+ %% not read for new (not already loaded) applications
+ Appls = [app1() | Appls0],
%% Simulate contents of "sys.config"
Config = [{stdlib, [{par1,sys},{par2,sys}]},
"t1",
"t2.config",
filename:join([DataDir, "subdir", "t3"]),
- {stdlib, [{par6,sys}]}],
+ {stdlib, [{par6,sys}]},
+ "t4.config"],
+
+ %% Check that app1 is not loaded
+ false = lists:keymember(app1,1,application:loaded_applications()),
%% Order application_controller to update configuration
ok = application_controller:change_application_data(Appls,
@@ -1971,6 +1979,13 @@ config_change(Conf) when is_list(Conf) ->
{value, {par5,t3}} = lists:keysearch(par5, 1, Env),
{value, {par6,sys}} = lists:keysearch(par6, 1, Env),
+ %% Check that app1 parameters are correctly set after loading
+ [] = application:get_all_env(app1),
+ application:load(app1()),
+ App1Env = application:get_all_env(app1),
+ {value, {par1,t4}} = lists:keysearch(par1, 1, App1Env),
+ application:unload(app1),
+
ok = file:set_cwd(CWD).
%% This function is stolen from SASL module release_handler, OTP R10B
@@ -1989,6 +2004,7 @@ get_appls([_ | T], Res) ->
get_appls([], Res) ->
Res.
+
persistent_env(suite) ->
[];
persistent_env(doc) ->