aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/kernel_config_SUITE.erl
diff options
context:
space:
mode:
authorJosé Valim <[email protected]>2019-01-09 12:24:17 +0100
committerJosé Valim <[email protected]>2019-03-04 14:06:21 +0100
commitc3391bb822f0516975b293bc220e1a44cdb8bc0c (patch)
tree4d60c19010aa59d71d0e667d31c604f8c07bcf12 /lib/kernel/test/kernel_config_SUITE.erl
parentcc12aeb0ce4a9444aba199f6d145ef525de268a9 (diff)
downloadotp-c3391bb822f0516975b293bc220e1a44cdb8bc0c.tar.gz
otp-c3391bb822f0516975b293bc220e1a44cdb8bc0c.tar.bz2
otp-c3391bb822f0516975b293bc220e1a44cdb8bc0c.zip
Add start_distribution to kernel environment
Sometimes you may want to start Erlang without any of its distribution services. This commit adds an environment configuration that allows so. Because the servers we don't start here are a subset of the servers not started on minimal mode, we do have a guarantee that the system can still operate as the system operates without those apps on minimal mode.
Diffstat (limited to 'lib/kernel/test/kernel_config_SUITE.erl')
-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.