diff options
author | Siri Hansen <[email protected]> | 2011-10-13 11:53:51 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2011-11-17 16:47:28 +0100 |
commit | be04ed7beceeb4bcf5db7807e86df87e28c9f4b9 (patch) | |
tree | 3c5feabbfb50156cfc6e8025d9c20dd786fb9cd0 /lib/sasl/test/systools_rc_SUITE.erl | |
parent | 1dec251ad333045847b75b8ee75d4bff4237108e (diff) | |
download | otp-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/systools_rc_SUITE.erl')
-rw-r--r-- | lib/sasl/test/systools_rc_SUITE.erl | 92 |
1 files changed, 88 insertions, 4 deletions
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. |