aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/application_SUITE.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2011-11-16 11:18:17 +0100
committerSiri Hansen <[email protected]>2011-11-16 15:02:25 +0100
commit77ffc0d747f913c47d9e5305907a407d87883ba2 (patch)
treeee2234c9272fb84fbe8a443f36526ab45fa3d909 /lib/kernel/test/application_SUITE.erl
parent96fcb3f864f787fd3d74f20189eed7a1aba81cb4 (diff)
downloadotp-77ffc0d747f913c47d9e5305907a407d87883ba2.tar.gz
otp-77ffc0d747f913c47d9e5305907a407d87883ba2.tar.bz2
otp-77ffc0d747f913c47d9e5305907a407d87883ba2.zip
Add documentation and test for kernel env var shutdown_timeout
Diffstat (limited to 'lib/kernel/test/application_SUITE.erl')
-rw-r--r--lib/kernel/test/application_SUITE.erl30
1 files changed, 28 insertions, 2 deletions
diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl
index 2c5b8ccb66..f469a0af98 100644
--- a/lib/kernel/test/application_SUITE.erl
+++ b/lib/kernel/test/application_SUITE.erl
@@ -33,7 +33,7 @@
-export([config_change/1,
distr_changed_tc1/1, distr_changed_tc2/1,
- shutdown_func/1, do_shutdown/1]).
+ shutdown_func/1, do_shutdown/1, shutdown_timeout/1]).
-define(TESTCASE, testcase_name).
-define(testcase, ?config(?TESTCASE, Config)).
@@ -50,7 +50,7 @@ all() ->
load_use_cache, {group, reported_bugs}, start_phases,
script_start, nodedown_start, permit_false_start_local,
permit_false_start_dist, get_key,
- {group, distr_changed}, config_change, shutdown_func].
+ {group, distr_changed}, config_change, shutdown_func, shutdown_timeout].
groups() ->
[{reported_bugs, [],
@@ -1915,6 +1915,32 @@ do_shutdown(Reason) ->
+%%%-----------------------------------------------------------------
+%%% Tests the 'shutdown_timeout' kernel config parameter
+%%%-----------------------------------------------------------------
+shutdown_timeout(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Cp1} = start_node(?MODULE_STRING++"_shutdown_timeout"),
+ wait_for_ready_net(),
+ ok = rpc:call(Cp1, application, set_env, [kernel, shutdown_timeout, 1000]),
+ rpc:call(Cp1, code, add_path, [filename:join([DataDir,deadlock])]),
+ ok = rpc:call(Cp1, application, start, [sasl]),
+ ok = rpc:call(Cp1, application, start, [deadlock]),
+ rpc:call(Cp1, deadlock, restart_and_fail, []),
+
+ ok = net_kernel:monitor_nodes(true),
+ _ = rpc:call(Cp1, init, stop, []),
+ receive
+ {nodedown,Cp1} ->
+ ok
+ after 10000 ->
+ ct:fail("timeout 10 sec: node termination hangs")
+ end,
+ ok.
+
+
+
+
%%-----------------------------------------------------------------
%% Utility functions
%%-----------------------------------------------------------------