aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2011-10-17 15:47:05 +0200
committerSiri Hansen <[email protected]>2011-11-17 16:47:29 +0100
commit1e344f34bf9f3fcc0a75b2980ab79e60d4cd71fc (patch)
tree721ee2c512fbf922316f6ea1d069f46dae38ec76 /lib/sasl
parentd221b34133a8da8d62bdc57ebb724f86d7cd2fc0 (diff)
downloadotp-1e344f34bf9f3fcc0a75b2980ab79e60d4cd71fc.tar.gz
otp-1e344f34bf9f3fcc0a75b2980ab79e60d4cd71fc.tar.bz2
otp-1e344f34bf9f3fcc0a75b2980ab79e60d4cd71fc.zip
Wait for two restarts in upgrade_restart test
This is an attempt to correct a failing test case. It the test fails on having restarted only once, we give it another try to see if the second restart will happen.
Diffstat (limited to 'lib/sasl')
-rw-r--r--lib/sasl/test/installer.erl20
-rw-r--r--lib/sasl/test/release_handler_SUITE.erl13
2 files changed, 27 insertions, 6 deletions
diff --git a/lib/sasl/test/installer.erl b/lib/sasl/test/installer.erl
index d77b0e8538..6942ec21ea 100644
--- a/lib/sasl/test/installer.erl
+++ b/lib/sasl/test/installer.erl
@@ -44,6 +44,7 @@
-export([upgrade_restart_1a/1]).
-export([upgrade_restart_2/1]).
-export([upgrade_restart_2a/1]).
+-export([upgrade_restart_2b/1]).
-export([upgrade_restart_3/1]).
-export([client1_1/4]).
-export([client2/3]).
@@ -403,7 +404,20 @@ upgrade_restart_2(TestNode) ->
?print(["upgrade_restart_2 start"]),
%% Check that the node has been restarted once more after the tmp release
+ case init:script_id() of
+ {"SASL-test","P2B"} ->
+ upgrade_restart_2a(TestNode);
+ {"SASL-test","__new_emulator__P1G"} ->
+ %% catched the node too early - give it another try
+ {wait,whereis(init)}
+ end.
+
+upgrade_restart_2a(TestNode) ->
+ ?print(["upgrade_restart_2a start"]),
+
+ %% This time we must be there, else something is definitely wrong
{"SASL-test","P2B"} = init:script_id(),
+
?check_release_states([permanent,current]),
?check_running_app(a,"1.1"),
@@ -412,11 +426,11 @@ upgrade_restart_2(TestNode) ->
ok.
-upgrade_restart_2a(TestNode) ->
- ?print(["upgrade_restart_2a start"]),
+upgrade_restart_2b(TestNode) ->
+ ?print(["upgrade_restart_2b start"]),
{ok,"P1G",[old_emu,rm_appl]} = release_handler:install_release("P1G"),
- ?print(["upgrade_restart_2a P1G installed"]),
+ ?print(["upgrade_restart_2b P1G installed"]),
ok.
upgrade_restart_3(TestNode) ->
diff --git a/lib/sasl/test/release_handler_SUITE.erl b/lib/sasl/test/release_handler_SUITE.erl
index c2930b1039..958f6bbfc9 100644
--- a/lib/sasl/test/release_handler_SUITE.erl
+++ b/lib/sasl/test/release_handler_SUITE.erl
@@ -375,11 +375,18 @@ upgrade_restart(Conf) when is_list(Conf) ->
wait_nodes_up([{TestNode,TestNodeInit1}],"upgrade_restart_1",[a]),
%% install P1G
+ case rpc_inst(TestNode, upgrade_restart_2, []) of
+ ok ->
+ ok;
+ {wait,TestNodeInit2a} ->
+ %% We catched the node too early - it was supposed to
+ %% restart twice, so let's wait for one more restart.
+ wait_nodes_up([{TestNode,TestNodeInit2a}],"upgrade_restart_2a",[])
+ end,
TestNodeInit2 = rpc:call(TestNode,erlang,whereis,[init]),
- ok = rpc_inst(TestNode, upgrade_restart_2, []),
stop_cover(TestNode),
- ok = rpc_inst(TestNode, upgrade_restart_2a, []),
- wait_nodes_up([{TestNode,TestNodeInit2}],"upgrade_restart_2",[]),
+ ok = rpc_inst(TestNode, upgrade_restart_2b, []),
+ wait_nodes_up([{TestNode,TestNodeInit2}],"upgrade_restart_2b",[]),
%% Check that P1G is going again
ok = rpc_inst(TestNode, upgrade_restart_3, []),