diff options
author | Siri Hansen <[email protected]> | 2017-10-26 13:00:25 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2017-10-26 13:00:25 +0200 |
commit | 848fb94ca16be0a103b5df4232e3d4ab421c5138 (patch) | |
tree | 99fbf08c2ac684eaed8787e3a459238a9612aecf /lib/observer/test/crashdump_viewer_SUITE.erl | |
parent | 883f8e1d42c73e792de08493e13e0cee9d3384b3 (diff) | |
download | otp-848fb94ca16be0a103b5df4232e3d4ab421c5138.tar.gz otp-848fb94ca16be0a103b5df4232e3d4ab421c5138.tar.bz2 otp-848fb94ca16be0a103b5df4232e3d4ab421c5138.zip |
[cdv] Check if dump version is newer than cdv can handle
If the version of the given crash dump is newer than what
crashdump_viewer is prepared to read, then crashdump_viewer will
display an info dialog and then terminate. This is to allow major
updates of the format of crash dumps.
Diffstat (limited to 'lib/observer/test/crashdump_viewer_SUITE.erl')
-rw-r--r-- | lib/observer/test/crashdump_viewer_SUITE.erl | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/observer/test/crashdump_viewer_SUITE.erl b/lib/observer/test/crashdump_viewer_SUITE.erl index 86a60e15f4..a361b8c321 100644 --- a/lib/observer/test/crashdump_viewer_SUITE.erl +++ b/lib/observer/test/crashdump_viewer_SUITE.erl @@ -25,7 +25,7 @@ %% Test functions -export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, start_stop/1,load_file/1,not_found_items/1, - non_existing/1,not_a_crashdump/1,old_crashdump/1]). + non_existing/1,not_a_crashdump/1,old_crashdump/1,new_crashdump/1]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -83,6 +83,7 @@ all() -> non_existing, not_a_crashdump, old_crashdump, + new_crashdump, load_file, not_found_items ]. @@ -212,6 +213,25 @@ not_a_crashdump(Config) when is_list(Config) -> ok = crashdump_viewer:stop(). +%% Try to load a file with newer version than this crashdump viewer can handle +new_crashdump(Config) -> + Dump = hd(?config(dumps,Config)), + ok = start_backend(Dump), + {ok,{MaxVsn,CurrentVsn}} = crashdump_viewer:get_dump_versions(), + if MaxVsn =/= CurrentVsn -> + ct:fail("Current dump version is not equal to cdv's max version"); + true -> + ok + end, + ok = crashdump_viewer:stop(), + NewerVsn = lists:join($.,[integer_to_list(X+1) || X <- MaxVsn]), + PrivDir = ?config(priv_dir,Config), + NewDump = filename:join(PrivDir,"new_erl_crash.dump"), + ok = file:write_file(NewDump,"=erl_crash_dump:"++NewerVsn++"\n"), + {error, Reason} = start_backend(NewDump), + "This Crashdump Viewer is too old" ++_ = Reason, + ok = crashdump_viewer:stop(). + %% Load files into the tool and view all pages load_file(Config) when is_list(Config) -> case ?t:is_debug() of |