aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2012-10-17 13:54:53 +0200
committerSiri Hansen <[email protected]>2012-10-30 11:18:41 +0100
commitf617b5b1f310dd37d606f3648246cc0851e12bef (patch)
tree175ef0cf9028280b9e95cc6f18389ca4a941bad0 /lib/test_server
parent2794f452c8197a9c242c7e3652481f4f4d6e3422 (diff)
downloadotp-f617b5b1f310dd37d606f3648246cc0851e12bef.tar.gz
otp-f617b5b1f310dd37d606f3648246cc0851e12bef.tar.bz2
otp-f617b5b1f310dd37d606f3648246cc0851e12bef.zip
[test_server] Start cover in test_server:wait_for_node
Without this change, there is no support in test_server for starting cover on a node started with option {wait,false}.
Diffstat (limited to 'lib/test_server')
-rw-r--r--lib/test_server/src/test_server.erl25
-rw-r--r--lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl14
2 files changed, 26 insertions, 13 deletions
diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl
index fc8fe1a9ce..330c4cc8a9 100644
--- a/lib/test_server/src/test_server.erl
+++ b/lib/test_server/src/test_server.erl
@@ -2612,7 +2612,30 @@ wait_for_node(Slave) ->
group_leader() ! {sync_apply,
self(),
{test_server_ctrl,wait_for_node,[Slave]}},
- receive {sync_result,R} -> R end.
+ Result = receive {sync_result,R} -> R end,
+ case Result of
+ ok ->
+ Cover = case is_cover() of
+ true ->
+ not is_shielded(Slave) andalso same_version(Slave);
+ false ->
+ false
+ end,
+
+ net_adm:ping(Slave),
+ case Cover of
+ true ->
+ MainCoverNode = cover:get_main_node(),
+ Sticky = unstick_all_sticky(MainCoverNode,Slave),
+ rpc:call(MainCoverNode,cover,start,[Slave]),
+ stick_all_sticky(Slave,Sticky);
+ _ ->
+ ok
+ end;
+ _ ->
+ ok
+ end,
+ Result.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl b/lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl
index ab25e4ad2f..fc2adcd651 100644
--- a/lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl
+++ b/lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -433,7 +433,7 @@ start_stop_node(Config) when is_list(Config) ->
?t:comment("WARNING: Node started with {wait,false}"
" is up faster than expected...");
false ->
- wait_for_node(Node4,0),
+ test_server:wait_for_node(Node4),
true = lists:member(Node4,nodes())
end,
@@ -450,16 +450,6 @@ start_stop_node(Config) when is_list(Config) ->
ok.
-
-wait_for_node(Node,Acc) ->
- case net_adm:ping(Node) of
- pang ->
- timer:sleep(100),
- wait_for_node(Node,Acc+100);
- pong ->
- Acc
- end.
-
cleanup_nodes_init(doc) -> ["Test that nodes are terminated when test case"
" is finished unless {cleanup,false} is given."];
cleanup_nodes_init(Config) when is_list(Config) ->