aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-10-09 14:55:13 +0200
committerBjörn Gustavsson <[email protected]>2012-10-31 14:27:16 +0100
commit42b20176c1ed7f819ec1b436bc6d1f8987269e48 (patch)
tree0d7242e439a96049d7225e74e372def3b9dbe4ea /lib/common_test/test
parent65590d374d83af7f7d64c19e7f911da3cd2e16cc (diff)
downloadotp-42b20176c1ed7f819ec1b436bc6d1f8987269e48.tar.gz
otp-42b20176c1ed7f819ec1b436bc6d1f8987269e48.tar.bz2
otp-42b20176c1ed7f819ec1b436bc6d1f8987269e48.zip
Add support for passing environment variables in master mode
Prototype-by: Magnus Lidén <[email protected]>
Diffstat (limited to 'lib/common_test/test')
-rw-r--r--lib/common_test/test/ct_master_SUITE.erl12
-rw-r--r--lib/common_test/test/ct_master_SUITE_data/master/master_SUITE.erl9
2 files changed, 16 insertions, 5 deletions
diff --git a/lib/common_test/test/ct_master_SUITE.erl b/lib/common_test/test/ct_master_SUITE.erl
index d46ba68af6..56a343a96f 100644
--- a/lib/common_test/test/ct_master_SUITE.erl
+++ b/lib/common_test/test/ct_master_SUITE.erl
@@ -147,13 +147,15 @@ make_spec(DataDir, FileName, NodeNames, Suites, Config) ->
CM = [{config,master,filename:join(DataDir,"master/config.txt")}],
+ Env = [{"THIS_MUST_BE_SET","yes"},
+ {"SO_MUST_THIS","value"}],
NS = lists:map(
fun(NodeName) ->
{init,NodeName,[
{node_start,[{startup_functions,[]},
- {monitor_master,true}]},
- {eval,{erlang,nodes,[]}}
- ]
+ {monitor_master,true},
+ {env,Env}]},
+ {eval,{erlang,nodes,[]}}]
}
end,
NodeNames),
@@ -223,4 +225,6 @@ events_to_check(_) ->
{?eh,tc_start,{master_SUITE,second_testcase}},
{?eh,tc_done,{master_SUITE,second_testcase,ok}},
{?eh,tc_start,{master_SUITE,third_testcase}},
- {?eh,tc_done,{master_SUITE,third_testcase,ok}}].
+ {?eh,tc_done,{master_SUITE,third_testcase,ok}},
+ {?eh,tc_start,{master_SUITE,env_vars}},
+ {?eh,tc_done,{master_SUITE,env_vars,ok}}].
diff --git a/lib/common_test/test/ct_master_SUITE_data/master/master_SUITE.erl b/lib/common_test/test/ct_master_SUITE_data/master/master_SUITE.erl
index 032d69ad9f..8a5009ad62 100644
--- a/lib/common_test/test/ct_master_SUITE_data/master/master_SUITE.erl
+++ b/lib/common_test/test/ct_master_SUITE_data/master/master_SUITE.erl
@@ -39,7 +39,8 @@ init_per_suite(Config) ->
end_per_suite(_) ->
ok.
-all() -> [first_testcase, second_testcase, third_testcase].
+all() -> [first_testcase, second_testcase, third_testcase,
+ env_vars].
init_per_testcase(_, Config) ->
Config.
@@ -56,3 +57,9 @@ second_testcase(_)->
third_testcase(_)->
A = 4,
A = 2*2.
+
+env_vars(_) ->
+ io:format("~p\n", [os:getenv()]),
+ "yes" = os:getenv("THIS_MUST_BE_SET"),
+ "value" = os:getenv("SO_MUST_THIS"),
+ ok.