aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/init_SUITE.erl
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-05-27 15:27:19 +0200
committerSverker Eriksson <[email protected]>2016-05-27 15:27:19 +0200
commit23b38b4409d52eeb42d87202c49867295b066c47 (patch)
tree6aebd99b44200341c5a17f45ea1d2fbf42187773 /lib/kernel/test/init_SUITE.erl
parentaf9e26bc0cdbbd1a5a81e760501c307c3176fea0 (diff)
parent0f8fab10dad03273b75f205bd9fae746d2077829 (diff)
downloadotp-23b38b4409d52eeb42d87202c49867295b066c47.tar.gz
otp-23b38b4409d52eeb42d87202c49867295b066c47.tar.bz2
otp-23b38b4409d52eeb42d87202c49867295b066c47.zip
Merge branch 'richcarl/erts/fix-init-stop/PR-911/OTP-13630/OTP-13631'
Diffstat (limited to 'lib/kernel/test/init_SUITE.erl')
-rw-r--r--lib/kernel/test/init_SUITE.erl18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl
index e7b44a714c..a332e7966b 100644
--- a/lib/kernel/test/init_SUITE.erl
+++ b/lib/kernel/test/init_SUITE.erl
@@ -27,7 +27,7 @@
-export([get_arguments/1, get_argument/1, boot_var/1, restart/1,
many_restarts/0, many_restarts/1,
get_plain_arguments/1,
- reboot/1, stop/1, get_status/1, script_id/1]).
+ reboot/1, stop_status/1, stop/1, get_status/1, script_id/1]).
-export([boot1/1, boot2/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
@@ -48,7 +48,7 @@ suite() ->
all() ->
[get_arguments, get_argument, boot_var,
many_restarts,
- get_plain_arguments, restart, get_status, script_id,
+ get_plain_arguments, restart, stop_status, get_status, script_id,
{group, boot}].
groups() ->
@@ -465,6 +465,20 @@ reboot(Config) when is_list(Config) ->
%% ------------------------------------------------
%%
%% ------------------------------------------------
+stop_status(Config) when is_list(Config) ->
+ badarg = catch_stop([65,[66],67]), % flat strings only
+ badarg = catch_stop([65, 666, 67]), % only bytes in string
+ badarg = catch_stop(abort), % 'abort' not allowed
+ badarg = catch_stop(true), % other atoms not allowed
+ badarg = catch_stop(-1), % no negative statuses
+ ok.
+
+catch_stop(Status) ->
+ try init:stop(Status) catch error:badarg -> badarg end.
+
+%% ------------------------------------------------
+%%
+%% ------------------------------------------------
stop(Config) when is_list(Config) ->
Args = args(),
{ok, Node} = start_node(init_test, Args),