aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorRichard Carlsson <[email protected]>2015-12-02 17:27:11 +0100
committerSverker Eriksson <[email protected]>2016-05-20 18:41:23 +0200
commitab7bcce2778d04daec2276e568deba954c6f9b57 (patch)
treec97967b63c83cda43055ae36d167ecd4efebf714 /lib/kernel
parentbe353901879b3cccda7cd01947936cf1550dea04 (diff)
downloadotp-ab7bcce2778d04daec2276e568deba954c6f9b57.tar.gz
otp-ab7bcce2778d04daec2276e568deba954c6f9b57.tar.bz2
otp-ab7bcce2778d04daec2276e568deba954c6f9b57.zip
Add testcase for init:stop/1 status
Diffstat (limited to 'lib/kernel')
-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),