aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2019-03-08 11:46:32 +0100
committerGitHub <[email protected]>2019-03-08 11:46:32 +0100
commit08030f43f444d0839e8d992fed03dbba3c3f9de2 (patch)
tree3732b932c02091e042cacf7ac12ce6d1dbfeccfc /lib/kernel/test
parent79f6f0a9ffd78f11fbb3790402159259d4a9d21a (diff)
parentc3391bb822f0516975b293bc220e1a44cdb8bc0c (diff)
downloadotp-08030f43f444d0839e8d992fed03dbba3c3f9de2.tar.gz
otp-08030f43f444d0839e8d992fed03dbba3c3f9de2.tar.bz2
otp-08030f43f444d0839e8d992fed03dbba3c3f9de2.zip
Merge pull request #2088 from josevalim/jv-start-distribution
Add start_distribution to kernel environment OTP-15668
Diffstat (limited to 'lib/kernel/test')
-rw-r--r--lib/kernel/test/kernel_config_SUITE.erl21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/kernel/test/kernel_config_SUITE.erl b/lib/kernel/test/kernel_config_SUITE.erl
index 9207025a2c..57c44c2498 100644
--- a/lib/kernel/test/kernel_config_SUITE.erl
+++ b/lib/kernel/test/kernel_config_SUITE.erl
@@ -21,7 +21,8 @@
-include_lib("common_test/include/ct.hrl").
--export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, sync/1]).
+-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,
+ start_distribution_false/1, sync/1]).
-export([init_per_suite/1, end_per_suite/1]).
@@ -30,7 +31,7 @@ suite() ->
{timetrap,{minutes,2}}].
all() ->
- [sync].
+ [sync, start_distribution_false].
groups() ->
[].
@@ -59,12 +60,9 @@ from(H, [H | T]) -> T;
from(H, [_ | T]) -> from(H, T);
from(_, []) -> [].
-%%-----------------------------------------------------------------
-%% Test suite for sync_nodes. This is quite tricky.
-%%
+%% Test sync_nodes. This is quite tricky.
%% Should be started in a CC view with:
%% erl -sname XXX where XX not in [cp1, cp2]
-%%-----------------------------------------------------------------
sync(Conf) when is_list(Conf) ->
%% Write a config file
Dir = proplists:get_value(priv_dir,Conf),
@@ -106,9 +104,18 @@ wait_for_node(Node) ->
_Other -> wait_for_node(Node)
end.
-
stop_node(Node) ->
M = list_to_atom(lists:concat([Node,
[$@],
from($@,atom_to_list(node()))])),
rpc:cast(M, erlang, halt, []).
+
+start_distribution_false(Config) when is_list(Config) ->
+ %% When distribution is disabled, -sname/-name has no effect
+ Str = os:cmd(ct:get_progname()
+ ++ " -kernel start_distribution false"
+ ++ " -sname no_distribution"
+ ++ " -eval \"erlang:display(node())\""
+ ++ " -noshell -s erlang halt"),
+ "'nonode@nohost'" ++ _ = Str,
+ ok.