diff options
author | Siri Hansen <[email protected]> | 2014-02-11 13:52:34 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2014-02-24 11:41:10 +0100 |
commit | 41b4ec74fcbe8fedcc7b832ff7c6501e441292ac (patch) | |
tree | 5488eb0011bff003a24009a8917926c18ce71a43 /erts | |
parent | 0256f0e352021e56c3d130caed14a50d573939cb (diff) | |
download | otp-41b4ec74fcbe8fedcc7b832ff7c6501e441292ac.tar.gz otp-41b4ec74fcbe8fedcc7b832ff7c6501e441292ac.tar.bz2 otp-41b4ec74fcbe8fedcc7b832ff7c6501e441292ac.zip |
Allow config to point out old releases in upgrade_SUITE
This suite was earlier only possible to run on linux hosts in the OTP
test lab. Now a ct config file can be used to point out the two last
major releases, e.g. like this:
{otp_releases,[{r16,"/path/to/r16/bin/erl"},
{'17',"/path/to/17/bin/erl"}]}.
Until OTP 17.0 is really released, the entry named '17' may well be
left out, causing the test case upgrade_SUITE:minor to be skipped.
Diffstat (limited to 'erts')
-rw-r--r-- | erts/test/upgrade_SUITE.erl | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/erts/test/upgrade_SUITE.erl b/erts/test/upgrade_SUITE.erl index 9f15437772..690ee0bad0 100644 --- a/erts/test/upgrade_SUITE.erl +++ b/erts/test/upgrade_SUITE.erl @@ -86,18 +86,35 @@ major(Config) -> %% performs an upgrade from major release X to the current release. minor(Config) -> CurrentMajor = erlang:system_info(otp_release), - Current = list_to_atom(CurrentMajor++"_patched"), + Current = CurrentMajor++"_patched", upgrade_test(CurrentMajor,Current,Config). %%%----------------------------------------------------------------- upgrade_test(FromVsn,ToVsn,Config) -> - case test_server:is_release_available(FromVsn) of - true -> - upgrade_test1(FromVsn,ToVsn,Config); + OldRel = + case test_server:is_release_available(FromVsn) of + true -> + {release,FromVsn}; + false -> + case ct:get_config({otp_releases,list_to_atom(FromVsn)}) of + undefined -> + false; + Prog0 -> + case os:find_executable(Prog0) of + false -> + false; + Prog -> + {prog,Prog} + end + end + end, + case OldRel of false -> %% Note that priv_dir here is per test case! rm_rf(?config(priv_dir,Config)), - {skip, "no previous release available"} + {skip, "no previous release available"}; + _ -> + upgrade_test1(FromVsn,ToVsn,[{old_rel,OldRel}|Config]) end. upgrade_test1(FromVsn,ToVsn,Config) -> @@ -120,7 +137,7 @@ upgrade_test1(FromVsn,ToVsn,Config) -> %%% - chmod 'start' and 'start_erl' target_system(RelName0,RelVsn,CreateDir,InstallDir,Config) -> {ok,Node} = test_server:start_node(list_to_atom(RelName0),peer, - [{erl,[{release,RelVsn}]}]), + [{erl,[?config(old_rel,Config)]}]), {RelName,Apps,ErtsVsn} = create_relfile(Node,CreateDir,RelName0,RelVsn), |