aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/test
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2011-10-13 11:53:51 +0200
committerSiri Hansen <[email protected]>2011-11-17 16:47:28 +0100
commitbe04ed7beceeb4bcf5db7807e86df87e28c9f4b9 (patch)
tree3c5feabbfb50156cfc6e8025d9c20dd786fb9cd0 /lib/sasl/test
parent1dec251ad333045847b75b8ee75d4bff4237108e (diff)
downloadotp-be04ed7beceeb4bcf5db7807e86df87e28c9f4b9.tar.gz
otp-be04ed7beceeb4bcf5db7807e86df87e28c9f4b9.tar.bz2
otp-be04ed7beceeb4bcf5db7807e86df87e28c9f4b9.zip
Distinguish restart_new_emulator from restart_emulator in upgrade instructions
Earlier, there was only one valid instruction to restart the emulator in an appup/relup script, 'restart_new_emulator'. A new instuction, 'restart_emulator', is now added, and the meaning is as follows: 'restart_new_emulator' is mainly for the core applications (erts, kernel, stdlib and sasl), and it indicates that there is new core functionality in the release and the emulator needs to be restarted before executing the upgrade scripts. If this instruction exists, a temporary release will be created which consists of the new version erts, kernel, stdlib and sasl, and the old versions of all other applications. After restarting the emulator with this temporary release, the rest of the upgrade instructions are executed, including loading of new versions. 'restart_emulator' can be used by any application if a restart of the emulator is needed after the upgrade instructions have been executed. In this case, the emulator will be restarted with the new release (i.e. not a tempoarary one) after all other upgrade instructions for all applications have been excecuted.
Diffstat (limited to 'lib/sasl/test')
-rw-r--r--lib/sasl/test/systools_SUITE.erl12
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.appup2
-rw-r--r--lib/sasl/test/systools_rc_SUITE.erl92
3 files changed, 95 insertions, 11 deletions
diff --git a/lib/sasl/test/systools_SUITE.erl b/lib/sasl/test/systools_SUITE.erl
index 5b3abad219..4cf6aefea9 100644
--- a/lib/sasl/test/systools_SUITE.erl
+++ b/lib/sasl/test/systools_SUITE.erl
@@ -1157,7 +1157,7 @@ normal_relup(Config) when is_list(Config) ->
?line ok = file:set_cwd(LatestDir),
%% OTP-2561: Check that the option 'restart_emulator' generates a
- %% "restart_new_emulator" instruction.
+ %% "restart_emulator" instruction.
?line {ok, _ , _, []} =
systools:make_relup(LatestName, [LatestName1], [LatestName1],
[{path, P},restart_emulator,silent]),
@@ -1256,19 +1256,19 @@ check_relup_up_only(UpVsnL) ->
check_restart_emulator() ->
{ok, [{_V1, [{_, _, Up}], [{_, _, Dn}]}]} = file:consult(relup),
- restart_new_emulator = lists:last(Up),
- restart_new_emulator = lists:last(Dn),
+ restart_emulator = lists:last(Up),
+ restart_emulator = lists:last(Dn),
ok.
check_restart_emulator_up_only() ->
{ok, [{_V1, [{_, _, Up}], []}]} = file:consult(relup),
- restart_new_emulator = lists:last(Up),
+ restart_emulator = lists:last(Up),
ok.
check_restart_emulator_diff_erts() ->
{ok, [{_V1, [{_, _, Up}], [{_, _, Dn}]}]} = file:consult(relup),
[restart_new_emulator|_] = Up,
- restart_new_emulator = lists:last(Dn),
+ restart_emulator = lists:last(Dn),
ok.
%% make_relup
@@ -1444,7 +1444,7 @@ regexp_relup(Config) ->
%% Upgrade fe 2.1.1 -> 3.1
%% Shall match the second entry in fe-3.1 appup. Have added a
- %% restart_new_emulator instruction there to distinguish it from
+ %% restart_emulator instruction there to distinguish it from
%% the first entry...
?line {ok, _, _, []} =
systools:make_relup(LatestName, [LatestName1], [], [{path, P}, silent]),
diff --git a/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.appup b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.appup
index 53d54735e5..6b99c47e53 100644
--- a/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.appup
+++ b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.appup
@@ -15,7 +15,7 @@
[{update, fe1, soft, soft_purge, soft_purge, []},
{update, fe2, soft, soft_purge, soft_purge, [fe1]},
{update, fe3, {advanced, extra}, soft_purge, soft_purge,[fe1, fe2]},
- restart_new_emulator]}
+ restart_emulator]}
],
%% Downgrade to:
diff --git a/lib/sasl/test/systools_rc_SUITE.erl b/lib/sasl/test/systools_rc_SUITE.erl
index bb93f38fa7..2ab9e269f9 100644
--- a/lib/sasl/test/systools_rc_SUITE.erl
+++ b/lib/sasl/test/systools_rc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2011. 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
@@ -21,14 +21,15 @@
-include_lib("test_server/include/test_server.hrl").
-include_lib("sasl/src/systools.hrl").
-export([all/0,groups/0,init_per_group/2,end_per_group/2,
- syntax_check/1, translate/1, translate_app/1]).
+ syntax_check/1, translate/1, translate_app/1,
+ translate_emulator_restarts/1]).
%%-----------------------------------------------------------------
%% erl -compile systools_rc_SUITE @i ../src/ @i ../../test_server/include/
%% c(systools_rc_SUITE, [{i, "../src"}, {i, "../../test_server/include"}]).
%%-----------------------------------------------------------------
all() ->
- [syntax_check, translate, translate_app].
+ [syntax_check, translate, translate_app, translate_emulator_restarts].
groups() ->
[].
@@ -87,7 +88,8 @@ syntax_check(Config) when is_list(Config) ->
{sync_nodes, id1, {m, f, [a]}},
{sync_nodes, id2, [cp1, cp2]},
{apply, {m,f,[a]}},
- restart_new_emulator
+ restart_new_emulator,
+ restart_emulator
],
?line {ok, _} = systools_rc:translate_scripts([S2], Apps, []),
S3 = [{apply, {m, f, a}}],
@@ -486,3 +488,85 @@ io:format("X2=~p~n", [X2]),
{purge,[pelle,kalle]},
{apply,{application,unload,[pelle]}}] = X3,
?line ok.
+
+
+translate_emulator_restarts(_Config) ->
+ Apps =
+ [#application{name = test,
+ description = "TEST",
+ vsn = "1.0",
+ modules = [{foo,1},{bar,1},{baz,1}],
+ regs = [],
+ mod = {sasl, []}},
+ #application{name = test,
+ description = "TEST2",
+ vsn = "1.0",
+ modules = [{x,1},{y,1},{z,1}],
+ regs = [],
+ mod = {sasl, []}}],
+ %% restart_new_emulator
+ Up1 = [{update, foo, soft, soft_purge, soft_purge, []},restart_new_emulator],
+ ?line {ok, X1} = systools_rc:translate_scripts([Up1], Apps, []),
+ ?line [restart_new_emulator,
+ {load_object_code, {test,"1.0",[foo]}},
+ point_of_no_return,
+ {suspend,[foo]},
+ {load,{foo,soft_purge,soft_purge}},
+ {resume,[foo]}] = X1,
+
+ %% restart_emulator
+ Up2 = [{update, foo, soft, soft_purge, soft_purge, []},restart_emulator],
+ ?line {ok, X2} = systools_rc:translate_scripts([Up2], Apps, []),
+ ?line [{load_object_code, {test,"1.0",[foo]}},
+ point_of_no_return,
+ {suspend,[foo]},
+ {load,{foo,soft_purge,soft_purge}},
+ {resume,[foo]},
+ restart_emulator] = X2,
+
+ %% restart_emulator + restart_new_emulator
+ Up3 = [{update, foo, soft, soft_purge, soft_purge, []},
+ restart_emulator,
+ restart_new_emulator],
+ ?line {ok, X3} = systools_rc:translate_scripts([Up3], Apps, []),
+ ?line [restart_new_emulator,
+ {load_object_code, {test,"1.0",[foo]}},
+ point_of_no_return,
+ {suspend,[foo]},
+ {load,{foo,soft_purge,soft_purge}},
+ {resume,[foo]},
+ restart_emulator] = X3,
+
+ %% restart_emulator + restart_new_emulator
+ Up4a = [{update, foo, soft, soft_purge, soft_purge, []},
+ restart_emulator,
+ restart_new_emulator],
+ Up4b = [restart_new_emulator,
+ {update, x, soft, soft_purge, soft_purge, []},
+ restart_emulator,
+ restart_emulator],
+ ?line {ok, X4} = systools_rc:translate_scripts([Up4a,Up4b], Apps, []),
+ ?line [restart_new_emulator,
+ {load_object_code, {test,"1.0",[foo,x]}},
+ point_of_no_return,
+ {suspend,[foo]},
+ {load,{foo,soft_purge,soft_purge}},
+ {resume,[foo]},
+ {suspend,[x]},
+ {load,{x,soft_purge,soft_purge}},
+ {resume,[x]},
+ restart_emulator] = X4,
+
+ %% only restart_new_emulator
+ Up5 = [restart_new_emulator],
+ ?line {ok, X5} = systools_rc:translate_scripts([Up5], Apps, []),
+ ?line [restart_new_emulator,
+ point_of_no_return] = X5,
+
+ %% only restart_emulator
+ Up6 = [restart_emulator],
+ ?line {ok, X6} = systools_rc:translate_scripts([Up6], Apps, []),
+ ?line [point_of_no_return,
+ restart_emulator] = X6,
+
+ ok.