aboutsummaryrefslogtreecommitdiffstats
path: root/erts/test/erlexec_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'erts/test/erlexec_SUITE.erl')
-rw-r--r--erts/test/erlexec_SUITE.erl32
1 files changed, 24 insertions, 8 deletions
diff --git a/erts/test/erlexec_SUITE.erl b/erts/test/erlexec_SUITE.erl
index 602dc5ce2e..952e6da4dc 100644
--- a/erts/test/erlexec_SUITE.erl
+++ b/erts/test/erlexec_SUITE.erl
@@ -30,7 +30,7 @@
-export([all/0, suite/0, init_per_testcase/2, end_per_testcase/2]).
-export([args_file/1, evil_args_file/1, env/1, args_file_env/1,
- otp_7461/1, otp_7461_remote/1, otp_8209/1,
+ otp_7461/1, otp_7461_remote/1, argument_separation/1,
zdbbl_dist_buf_busy_limit/1]).
-include_lib("common_test/include/ct.hrl").
@@ -51,21 +51,28 @@ suite() ->
all() ->
[args_file, evil_args_file, env, args_file_env,
- otp_7461, otp_8209, zdbbl_dist_buf_busy_limit].
+ otp_7461, argument_separation, zdbbl_dist_buf_busy_limit].
%% Test that plain first argument does not
-%% destroy -home switch [OTP-8209]
-otp_8209(Config) when is_list(Config) ->
+%% destroy -home switch [OTP-8209] or interact with environments
+argument_separation(Config) when is_list(Config) ->
{ok,[[PName]]} = init:get_argument(progname),
SNameS = "erlexec_test_01",
SName = list_to_atom(SNameS++"@"++
hd(tl(string:lexemes(atom_to_list(node()),"@")))),
- Cmd = PName ++ " dummy_param -sname "++SNameS++" -setcookie "++
- atom_to_list(erlang:get_cookie()),
- open_port({spawn,Cmd},[]),
+ Cmd = PName ++ " cmd_param -sname "++SNameS++" -setcookie "++
+ atom_to_list(erlang:get_cookie()) ++ " -cmd_test",
+ open_port({spawn,Cmd},[{env,[{"ERL_AFLAGS","-atest"},
+ {"ERL_FLAGS","env_param -test"},
+ {"ERL_ZFLAGS","zenv_param"}]}]),
pong = loop_ping(SName,40),
+ ct:log("emu_args: ~p",[rpc:call(SName,erlang,system_info,[emu_args])]),
{ok,[[_]]} = rpc:call(SName,init,get_argument,[home]),
- ["dummy_param"] = rpc:call(SName,init,get_plain_arguments,[]),
+ {ok,[[]]} = rpc:call(SName,init,get_argument,[atest]),
+ {ok,[[]]} = rpc:call(SName,init,get_argument,[cmd_test]),
+ {ok,[[]]} = rpc:call(SName,init,get_argument,[test]),
+ error = rpc:call(SName,init,get_argument,[unkown]),
+ ["cmd_param","env_param","zenv_param"] = rpc:call(SName,init,get_plain_arguments,[]),
ok = cleanup_nodes(),
ok.
@@ -85,6 +92,7 @@ cleanup_node(SNameS,N) ->
end.
loop_ping(_,0) ->
+ flush(),
pang;
loop_ping(Node,N) ->
case net_adm:ping(Node) of
@@ -98,6 +106,14 @@ loop_ping(Node,N) ->
pong
end.
+flush() ->
+ receive M ->
+ ct:pal("~p",[M]),
+ flush()
+ after 10 ->
+ ok
+ end.
+
args_file(Config) when is_list(Config) ->
AFN1 = privfile("1", Config),
AFN2 = privfile("2", Config),