aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/heart_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-04-04 13:42:39 +0200
committerBjörn Gustavsson <[email protected]>2016-04-04 13:42:39 +0200
commit282f18834468ca36e0e56dc12ac637e8ea82e54a (patch)
treea3fedff82633920a4cb7a9f07edb582e52f2e5cf /lib/kernel/test/heart_SUITE.erl
parentd5ee10dd6ad9e7d78fe1e306ad53b78c15f9b7f2 (diff)
parent17f7dd7a414feb14fa20200299e9115e832ed164 (diff)
downloadotp-282f18834468ca36e0e56dc12ac637e8ea82e54a.tar.gz
otp-282f18834468ca36e0e56dc12ac637e8ea82e54a.tar.bz2
otp-282f18834468ca36e0e56dc12ac637e8ea82e54a.zip
Merge branch 'bjorn/cuddle-with-tests'
* bjorn/cuddle-with-tests: inet_SUITE: Handle pointtopoint devices in getifaddrs/1 file_SUITE: Increase timetrap for large_write/1 gen_fsm_SUITE: Make abnormal1/1 stop failing gen_fsm_SUITE: Use timer:sleep/1 instead of ct:sleep/1 inet_SUITE: Handle {error,enoent} in simple_netns_open inet_SUITE: Handle missing SCTP support in simple_netns/1 asn1_SUITE: Remove temporary files file_name_SUITE: Improve handling of missing permission for link creation file_name_SUITE: Remove useless put/2 to process dictionary file_name_SUITE: Handle the case that HOMEPATH may not be set code_SUITE: Skip on_load_embedded/1 if no symlinks gen_sctp_SUITE: Skip most SCTP test cases on Solaris before 5.12 heart_SUITE: Increase timeout in restart/1 heart_SUITE: Use unique node names init_SUITE: Quote pathname that may contain a space gen_tcp_misc_SUITE: Clean up send_timeout{_active}/1 Clean up the determination of the hostname
Diffstat (limited to 'lib/kernel/test/heart_SUITE.erl')
-rw-r--r--lib/kernel/test/heart_SUITE.erl31
1 files changed, 19 insertions, 12 deletions
diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl
index dd6348c610..6ce1ee54e5 100644
--- a/lib/kernel/test/heart_SUITE.erl
+++ b/lib/kernel/test/heart_SUITE.erl
@@ -37,6 +37,11 @@
-define(DEFAULT_TIMEOUT_SECS, 120).
+-define(UNIQ_NODE_NAME,
+ list_to_atom(?MODULE_STRING ++ "__" ++
+ atom_to_list(?FUNCTION_NAME) ++ "_" ++
+ integer_to_list(erlang:unique_integer([positive])))).
+
init_per_testcase(_Func, Config) ->
Config.
@@ -118,7 +123,7 @@ start_check(Type, Name, Envs) ->
{ok, Node}.
start(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
rpc:call(Node, init, reboot, []),
receive
{nodedown, Node} -> ok
@@ -143,12 +148,12 @@ start(Config) when is_list(Config) ->
%% Purpose:
%% Check that a node is up and running after a init:restart/0
restart(Config) when is_list(Config) ->
- {ok, Node} = start_check(loose, heart_test),
+ {ok, Node} = start_check(loose, ?UNIQ_NODE_NAME),
rpc:call(Node, init, restart, []),
receive
{nodedown, Node} ->
ok
- after 2000 ->
+ after 5000 ->
ct:fail(node_not_closed)
end,
timer:sleep(5000),
@@ -159,7 +164,7 @@ restart(Config) when is_list(Config) ->
%% Purpose:
%% Check that a node is up and running after a init:reboot/0
reboot(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
ok = rpc:call(Node, heart, set_cmd,
[atom_to_list(lib:progname()) ++
@@ -193,7 +198,8 @@ node_start_immediately_after_crash(Config) when is_list(Config) ->
node_start_immediately_after_crash_test(Config) when is_list(Config) ->
- {ok, Node} = start_check(loose, heart_test_imm, [{"ERL_CRASH_DUMP_SECONDS", "0"}]),
+ {ok, Node} = start_check(loose, ?UNIQ_NODE_NAME,
+ [{"ERL_CRASH_DUMP_SECONDS", "0"}]),
ok = rpc:call(Node, heart, set_cmd,
[atom_to_list(lib:progname()) ++
@@ -243,7 +249,8 @@ node_start_soon_after_crash(Config) when is_list(Config) ->
end.
node_start_soon_after_crash_test(Config) when is_list(Config) ->
- {ok, Node} = start_check(loose, heart_test_soon, [{"ERL_CRASH_DUMP_SECONDS", "10"}]),
+ {ok, Node} = start_check(loose, ?UNIQ_NODE_NAME,
+ [{"ERL_CRASH_DUMP_SECONDS", "10"}]),
ok = rpc:call(Node, heart, set_cmd,
[atom_to_list(lib:progname()) ++
@@ -286,7 +293,7 @@ node_check_up_down(Node, Tmo) ->
%% Only tests bad command, correct behaviour is tested in reboot/1.
set_cmd(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
Cmd = wrong_atom,
{error, {bad_cmd, Cmd}} = rpc:call(Node, heart, set_cmd, [Cmd]),
Cmd1 = lists:duplicate(2047, $a),
@@ -299,7 +306,7 @@ set_cmd(Config) when is_list(Config) ->
ok.
clear_cmd(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
ok = rpc:call(Node, heart, set_cmd,
[atom_to_list(lib:progname()) ++
" -noshell -heart " ++ name(Node) ++ "&"]),
@@ -337,7 +344,7 @@ clear_cmd(Config) when is_list(Config) ->
ok.
get_cmd(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
Cmd = "test",
ok = rpc:call(Node, heart, set_cmd, [Cmd]),
{ok, Cmd} = rpc:call(Node, heart, get_cmd, []),
@@ -345,7 +352,7 @@ get_cmd(Config) when is_list(Config) ->
ok.
callback_api(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
none = rpc:call(Node, heart, get_callback, []),
M0 = self(),
F0 = ok,
@@ -379,7 +386,7 @@ callback_api(Config) when is_list(Config) ->
ok.
options_api(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
none = rpc:call(Node, heart, get_options, []),
M0 = self(),
F0 = ok,
@@ -474,7 +481,7 @@ kill_pid(Config) when is_list(Config) ->
ok = do_kill_pid(Config).
do_kill_pid(_Config) ->
- Name = heart_test,
+ Name = ?UNIQ_NODE_NAME,
Env = [{"HEART_COMMAND", "nickeNyfikenFarEttJobb"}],
{ok,Node} = start_node_run(Name,Env,suicide_by_heart,[]),
ok = wait_for_node(Node,15),